/*--------------------------------------------------------------------*/
+const char *
+VRT_r_resp_proto(struct sess *sp)
+{
+ CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
+ CHECK_OBJ_NOTNULL(sp->obj, OBJECT_MAGIC);
+ return (sp->obj->http.hd[HTTP_HDR_PROTO].b);
+}
+
+const char *
+VRT_r_resp_response(struct sess *sp)
+{
+ CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
+ CHECK_OBJ_NOTNULL(sp->obj, OBJECT_MAGIC);
+ return (sp->obj->http.hd[HTTP_HDR_RESPONSE].b);
+}
+
+int
+VRT_r_resp_status(struct sess *sp)
+{
+ CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
+ CHECK_OBJ_NOTNULL(sp->obj, OBJECT_MAGIC);
+ return (atoi(sp->obj->http.hd[HTTP_HDR_STATUS].b));
+}
+
+/*--------------------------------------------------------------------*/
+
struct sockaddr *
VRT_r_client_ip(struct sess *sp)
{
void VRT_l_obj_cacheable(struct sess *, unsigned);
double VRT_r_obj_ttl(struct sess *);
void VRT_l_obj_ttl(struct sess *, double);
+const char * VRT_r_resp_proto(struct sess *);
+void VRT_l_resp_proto(struct sess *, const char *);
+int VRT_r_resp_status(struct sess *);
+void VRT_l_resp_status(struct sess *, int);
+const char * VRT_r_resp_response(struct sess *);
+void VRT_l_resp_response(struct sess *, const char *);
const char * VRT_r_resp_http_(struct sess *);
void VRT_l_resp_http_(struct sess *, const char *);
{ obj.valid BOOL { hit fetch discard timeout} }
{ obj.cacheable BOOL { hit fetch discard timeout} }
{ obj.ttl TIME { hit fetch discard timeout} }
+ { resp.proto STRING { fetch } }
+ { resp.status INT { fetch } }
+ { resp.response STRING { fetch } }
{ resp.http. HEADER { fetch } }
}
set tt(BOOL) "unsigned"
set tt(BACKEND) "struct backend *"
set tt(TIME) "double"
+set tt(INT) "int"
set tt(HEADER) "const char *"
set tt(HOSTNAME) "const char *"
set tt(PORTNAME) "const char *"
"VRT_l_obj_ttl(sp, ",
VCL_MET_HIT | VCL_MET_FETCH | VCL_MET_DISCARD | VCL_MET_TIMEOUT
},
+ { "resp.proto", STRING, 10,
+ "VRT_r_resp_proto(sp)",
+ "VRT_l_resp_proto(sp, ",
+ VCL_MET_FETCH
+ },
+ { "resp.status", INT, 11,
+ "VRT_r_resp_status(sp)",
+ "VRT_l_resp_status(sp, ",
+ VCL_MET_FETCH
+ },
+ { "resp.response", STRING, 13,
+ "VRT_r_resp_response(sp)",
+ "VRT_l_resp_response(sp, ",
+ VCL_MET_FETCH
+ },
{ "resp.http.", HEADER, 10,
"VRT_r_resp_http_(sp)",
"VRT_l_resp_http_(sp, ",