Commit 60d01510 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Update VRT to minimal functional level again


git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@549 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 2b46f631
......@@ -11,6 +11,7 @@
#include "shmlog.h"
#include "vrt.h"
#include "vrt_obj.h"
#include "vcl.h"
#include "cache.h"
......@@ -74,32 +75,34 @@ VRT_handling(struct sess *sp, unsigned hand)
sp->handling = hand;
}
int
VRT_obj_valid(struct sess *sp)
/*--------------------------------------------------------------------*/
void
VRT_l_backend_host(struct backend *be, const char *h)
{
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
return (sp->obj->valid);
CHECK_OBJ_NOTNULL(be, BACKEND_MAGIC);
be->hostname = h;
}
int
VRT_obj_cacheable(struct sess *sp)
const char *
VRT_r_backend_host(struct backend *be)
{
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
return (sp->obj->cacheable);
CHECK_OBJ_NOTNULL(be, BACKEND_MAGIC);
return (be->hostname);
}
void
VRT_set_backend_hostname(struct backend *be, const char *h)
VRT_l_backend_port(struct backend *be, const char *p)
{
CHECK_OBJ_NOTNULL(be, BACKEND_MAGIC);
be->hostname = h;
be->portname = p;
}
void
VRT_set_backend_portname(struct backend *be, const char *p)
const char *
VRT_r_backend_port(struct backend *be)
{
CHECK_OBJ_NOTNULL(be, BACKEND_MAGIC);
be->portname = p;
return (be->portname);
}
void
......@@ -122,3 +125,59 @@ VRT_alloc_backends(struct VCL_conf *cp)
cp->backend[i]->magic = BACKEND_MAGIC;
}
}
/*--------------------------------------------------------------------*/
void
VRT_l_obj_ttl(struct sess *sp, double a)
{
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
(void)a;
}
double
VRT_r_obj_ttl(struct sess *sp)
{
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
CHECK_OBJ_NOTNULL(sp->obj, OBJECT_MAGIC); /* XXX */
return (sp->obj->ttl - sp->t_req);
}
double
VRT_r_obj_valid(struct sess *sp)
{
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
CHECK_OBJ_NOTNULL(sp->obj, OBJECT_MAGIC); /* XXX */
return (sp->obj->valid);
}
double
VRT_r_obj_cacheable(struct sess *sp)
{
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
CHECK_OBJ_NOTNULL(sp->obj, OBJECT_MAGIC); /* XXX */
return (sp->obj->cacheable);
}
/*--------------------------------------------------------------------*/
const char *
VRT_r_req_request(struct sess *sp)
{
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
CHECK_OBJ_NOTNULL(sp->http, HTTP_MAGIC);
return (sp->http->hd[HTTP_HDR_REQ].b);
}
const char *
VRT_r_req_url(struct sess *sp)
{
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
CHECK_OBJ_NOTNULL(sp->http, HTTP_MAGIC);
return (sp->http->hd[HTTP_HDR_URL].b);
}
......@@ -24,8 +24,6 @@ struct vrt_acl {
};
void VRT_count(struct sess *, unsigned);
void VRT_no_cache(struct sess *);
void VRT_no_new_cache(struct sess *);
#if 0
int ip_match(unsigned, struct vcl_acl *);
int string_match(const char *, const char *);
......@@ -35,14 +33,9 @@ void VRT_error(struct sess *, unsigned, const char *);
int VRT_switch_config(const char *);
char *VRT_GetHdr(struct sess *, const char *);
char *VRT_GetReq(struct sess *);
void VRT_handling(struct sess *sp, unsigned hand);
int VRT_obj_valid(struct sess *);
int VRT_obj_cacheable(struct sess *);
void VRT_set_backend_name(struct backend *, const char *);
void VRT_set_backend_hostname(struct backend *, const char *);
void VRT_set_backend_portname(struct backend *, const char *);
void VRT_alloc_backends(struct VCL_conf *cp);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment