Commit 72648a74 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Hide struct vfp_ctx properly in cache_filter.h

parent 62c5b886
......@@ -166,25 +166,6 @@ struct http {
uint8_t conds; /* If-* headers present */
};
/*--------------------------------------------------------------------
* VFP filter state
*/
VTAILQ_HEAD(vfp_entry_s, vfp_entry);
struct vfp_ctx {
unsigned magic;
#define VFP_CTX_MAGIC 0x61d9d3e5
int failed;
struct http *req;
struct http *resp;
struct worker *wrk;
struct objcore *oc;
struct vfp_entry_s vfp;
struct vfp_entry *vfp_nxt;
};
/*--------------------------------------------------------------------
* HTTP Protocol connection structure
*
......@@ -437,7 +418,7 @@ struct busyobj {
struct sess *sp;
struct worker *wrk;
struct vfp_ctx vfc[1];
struct vfp_ctx *vfc;
struct ws ws[1];
uintptr_t ws_bo;
......@@ -538,7 +519,7 @@ struct req {
double t_req; /* Headers complete */
struct http_conn htc[1];
struct vfp_ctx vfc[1];
struct vfp_ctx *vfc;
const char *client_identity;
/* HTTP request */
......
......@@ -35,7 +35,7 @@
#include <stdlib.h>
#include "cache_varnishd.h"
#include "cache_filter.h"
#include "cache_objhead.h"
static struct mempool *vbopool;
......@@ -121,6 +121,11 @@ VBO_GetBusyObj(struct worker *wrk, const struct req *req)
p = (void*)PRNDUP(p);
assert(p < bo->end);
bo->vfc = (void*)p;
p += sizeof (*bo->vfc);
p = (void*)PRNDUP(p);
INIT_OBJ(bo->vfc, VFP_CTX_MAGIC);
WS_Init(bo->ws, "bo", p, bo->end - p);
bo->do_stream = 1;
......
......@@ -31,6 +31,7 @@
#include "config.h"
#include "cache_varnishd.h"
#include "cache_filter.h"
#include "cache_vgz.h"
#include "cache_esi.h"
......
......@@ -65,6 +65,25 @@ struct vfp_entry {
uint64_t bytes_out;
};
/*--------------------------------------------------------------------
* VFP filter state
*/
VTAILQ_HEAD(vfp_entry_s, vfp_entry);
struct vfp_ctx {
unsigned magic;
#define VFP_CTX_MAGIC 0x61d9d3e5
int failed;
struct http *req;
struct http *resp;
struct worker *wrk;
struct objcore *oc;
struct vfp_entry_s vfp;
struct vfp_entry *vfp_nxt;
};
enum vfp_status VFP_Suck(struct vfp_ctx *, void *p, ssize_t *lp);
enum vfp_status VFP_Error(struct vfp_ctx *, const char *fmt, ...)
__v_printflike(2, 3);
......
......@@ -33,6 +33,7 @@
#include "config.h"
#include "cache_varnishd.h"
#include "cache_filter.h"
#include <stdio.h>
#include <stdlib.h>
......@@ -122,6 +123,10 @@ Req_New(const struct worker *wrk, struct sess *sp)
p += sz;
p = (void*)PRNDUP(p);
req->vfc = (void*)p;
p += sizeof (*req->vfc);
INIT_OBJ(req->vfc, VFP_CTX_MAGIC);
assert(p < e);
WS_Init(req->ws, "req", p, e - p);
......@@ -136,6 +141,7 @@ Req_New(const struct worker *wrk, struct sess *sp)
VTAILQ_INIT(&req->vdpe);
VRTPRIV_init(req->privs);
return (req);
}
......
......@@ -30,6 +30,7 @@
#include "config.h"
#include "cache/cache_varnishd.h"
#include "cache/cache_filter.h"
#include <errno.h>
#include <stdio.h>
......
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