Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
cfb309ca
Commit
cfb309ca
authored
Jul 22, 2014
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a VXID() macro to strip client/backend bit from VXIDs.
parent
81e52dcd
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
25 additions
and
34 deletions
+25
-34
cache.h
bin/varnishd/cache/cache.h
+1
-0
cache_esi_deliver.c
bin/varnishd/cache/cache_esi_deliver.c
+2
-2
cache_expire.c
bin/varnishd/cache/cache_expire.c
+2
-3
cache_fetch.c
bin/varnishd/cache/cache_fetch.c
+4
-7
cache_http1_fsm.c
bin/varnishd/cache/cache_http1_fsm.c
+4
-6
cache_panic.c
bin/varnishd/cache/cache_panic.c
+1
-1
cache_req_fsm.c
bin/varnishd/cache/cache_req_fsm.c
+7
-9
cache_session.c
bin/varnishd/cache/cache_session.c
+2
-2
cache_vrt_var.c
bin/varnishd/cache/cache_vrt_var.c
+2
-4
No files found.
bin/varnishd/cache/cache.h
View file @
cfb309ca
...
...
@@ -992,6 +992,7 @@ unsigned HTTP1_Write(const struct worker *w, const struct http *hp, const int*);
#undef HTTPH
/* cache_main.c */
#define VXID(u) ((u) & VSL_IDENTMASK)
uint32_t
VXID_Get
(
struct
vxid_pool
*
v
);
extern
volatile
struct
params
*
cache_param
;
void
THR_SetName
(
const
char
*
name
);
...
...
bin/varnishd/cache/cache_esi_deliver.c
View file @
cfb309ca
...
...
@@ -63,8 +63,8 @@ ved_include(struct req *preq, const char *src, const char *host)
req
=
SES_GetReq
(
wrk
,
preq
->
sp
);
req
->
req_body_status
=
REQ_BODY_NONE
;
AN
(
req
->
vsl
->
wid
&
VSL_CLIENTMARKER
);
VSLb
(
req
->
vsl
,
SLT_Begin
,
"req %u esi"
,
preq
->
vsl
->
wid
&
VSL_IDENTMASK
);
VSLb
(
preq
->
vsl
,
SLT_Link
,
"req %u esi"
,
req
->
vsl
->
wid
&
VSL_IDENTMASK
);
VSLb
(
req
->
vsl
,
SLT_Begin
,
"req %u esi"
,
VXID
(
preq
->
vsl
->
wid
)
);
VSLb
(
preq
->
vsl
,
SLT_Link
,
"req %u esi"
,
VXID
(
req
->
vsl
->
wid
)
);
req
->
esi_level
=
preq
->
esi_level
+
1
;
HTTP_Copy
(
req
->
http0
,
preq
->
http0
);
...
...
bin/varnishd/cache/cache_expire.c
View file @
cfb309ca
...
...
@@ -340,8 +340,7 @@ EXP_NukeOne(struct busyobj *bo, struct lru *lru)
exp_mail_it
(
oc
);
VSLb
(
bo
->
vsl
,
SLT_ExpKill
,
"LRU x=%u"
,
ObjGetXID
(
oc
,
bo
->
stats
)
&
VSL_IDENTMASK
);
VSLb
(
bo
->
vsl
,
SLT_ExpKill
,
"LRU x=%u"
,
VXID
(
ObjGetXID
(
oc
,
bo
->
stats
)));
AN
(
bo
->
stats
);
AN
(
oc
);
(
void
)
HSH_DerefObjCore
(
bo
->
stats
,
&
oc
);
...
...
@@ -473,7 +472,7 @@ exp_expire(struct exp_priv *ep, double now)
o
=
ObjGetObj
(
oc
,
&
ep
->
wrk
->
stats
);
CHECK_OBJ_NOTNULL
(
o
,
OBJECT_MAGIC
);
VSLb
(
&
ep
->
vsl
,
SLT_ExpKill
,
"EXP_Expired x=%u t=%.0f"
,
ObjGetXID
(
oc
,
&
ep
->
wrk
->
stats
)
&
VSL_IDENTMASK
,
VXID
(
ObjGetXID
(
oc
,
&
ep
->
wrk
->
stats
))
,
EXP_Ttl
(
NULL
,
&
oc
->
exp
)
-
now
);
(
void
)
HSH_DerefObjCore
(
&
ep
->
wrk
->
stats
,
&
oc
);
return
(
0
);
...
...
bin/varnishd/cache/cache_fetch.c
View file @
cfb309ca
...
...
@@ -238,7 +238,7 @@ vbf_stp_retry(struct worker *wrk, struct busyobj *bo)
VSLb
(
bo
->
vsl
,
SLT_Link
,
"bereq %u retry"
,
wid
);
VSLb
(
bo
->
vsl
,
SLT_End
,
"%s"
,
""
);
VSL_Flush
(
bo
->
vsl
,
0
);
owid
=
bo
->
vsl
->
wid
&
VSL_IDENTMASK
;
owid
=
VXID
(
bo
->
vsl
->
wid
)
;
bo
->
vsl
->
wid
=
wid
|
VSL_BACKENDMARKER
;
VSLb
(
bo
->
vsl
,
SLT_Begin
,
"bereq %u retry"
,
owid
);
VSLb_ts_busyobj
(
bo
,
"Start"
,
bo
->
t_prev
);
...
...
@@ -272,8 +272,7 @@ vbf_stp_startfetch(struct worker *wrk, struct busyobj *bo)
HTTP_Setup
(
bo
->
bereq
,
bo
->
ws
,
bo
->
vsl
,
SLT_BereqMethod
);
HTTP_Copy
(
bo
->
bereq
,
bo
->
bereq0
);
http_PrintfHeader
(
bo
->
bereq
,
"X-Varnish: %u"
,
bo
->
vsl
->
wid
&
VSL_IDENTMASK
);
http_PrintfHeader
(
bo
->
bereq
,
"X-Varnish: %u"
,
VXID
(
bo
->
vsl
->
wid
));
VCL_backend_fetch_method
(
bo
->
vcl
,
wrk
,
NULL
,
bo
,
bo
->
bereq
->
ws
);
...
...
@@ -871,10 +870,8 @@ VBF_Fetch(struct worker *wrk, struct req *req, struct objcore *oc,
default:
WRONG
(
"Wrong fetch mode"
);
}
VSLb
(
bo
->
vsl
,
SLT_Begin
,
"bereq %u %s "
,
req
->
vsl
->
wid
&
VSL_IDENTMASK
,
how
);
VSLb
(
req
->
vsl
,
SLT_Link
,
"bereq %u %s "
,
bo
->
vsl
->
wid
&
VSL_IDENTMASK
,
how
);
VSLb
(
bo
->
vsl
,
SLT_Begin
,
"bereq %u %s "
,
VXID
(
req
->
vsl
->
wid
),
how
);
VSLb
(
req
->
vsl
,
SLT_Link
,
"bereq %u %s "
,
VXID
(
bo
->
vsl
->
wid
),
how
);
bo
->
refcount
=
2
;
...
...
bin/varnishd/cache/cache_http1_fsm.c
View file @
cfb309ca
...
...
@@ -246,10 +246,9 @@ http1_cleanup(struct sess *sp, struct worker *wrk, struct req *req)
if
(
HTTP1_Reinit
(
req
->
htc
)
==
HTTP1_COMPLETE
)
{
AZ
(
req
->
vsl
->
wid
);
req
->
vsl
->
wid
=
VXID_Get
(
&
wrk
->
vxid_pool
)
|
VSL_CLIENTMARKER
;
VSLb
(
req
->
vsl
,
SLT_Begin
,
"req %u rxreq"
,
req
->
sp
->
vxid
&
VSL_IDENTMASK
);
VSLb
(
req
->
vsl
,
SLT_Begin
,
"req %u rxreq"
,
VXID
(
req
->
sp
->
vxid
));
VSL
(
SLT_Link
,
req
->
sp
->
vxid
,
"req %u rxreq"
,
req
->
vsl
->
wid
&
VSL_IDENTMASK
);
VXID
(
req
->
vsl
->
wid
)
);
VSLb_ts_req
(
req
,
"Start"
,
sp
->
t_idle
);
VSLb_ts_req
(
req
,
"Req"
,
sp
->
t_idle
);
req
->
t_req
=
req
->
t_prev
;
...
...
@@ -318,10 +317,9 @@ http1_dissect(struct worker *wrk, struct req *req)
*/
if
(
req
->
vsl
->
wid
==
0
)
{
req
->
vsl
->
wid
=
VXID_Get
(
&
wrk
->
vxid_pool
)
|
VSL_CLIENTMARKER
;
VSLb
(
req
->
vsl
,
SLT_Begin
,
"req %u rxreq"
,
req
->
sp
->
vxid
&
VSL_IDENTMASK
);
VSLb
(
req
->
vsl
,
SLT_Begin
,
"req %u rxreq"
,
VXID
(
req
->
sp
->
vxid
));
VSL
(
SLT_Link
,
req
->
sp
->
vxid
,
"req %u rxreq"
,
req
->
vsl
->
wid
&
VSL_IDENTMASK
);
VXID
(
req
->
vsl
->
wid
)
);
}
/* Borrow VCL reference from worker thread */
...
...
bin/varnishd/cache/cache_panic.c
View file @
cfb309ca
...
...
@@ -391,7 +391,7 @@ pan_sess(const struct sess *sp)
VSB_printf
(
pan_vsp
,
" sp = %p {
\n
"
,
sp
);
VSB_printf
(
pan_vsp
,
" fd = %d, vxid = %u,
\n
"
,
sp
->
fd
,
sp
->
vxid
&
VSL_IDENTMASK
);
sp
->
fd
,
VXID
(
sp
->
vxid
)
);
VSB_printf
(
pan_vsp
,
" client = %s %s,
\n
"
,
sp
->
client_addr_str
,
sp
->
client_port_str
);
switch
(
sp
->
sess_step
)
{
...
...
bin/varnishd/cache/cache_req_fsm.c
View file @
cfb309ca
...
...
@@ -108,11 +108,11 @@ cnt_deliver(struct worker *wrk, struct req *req)
if
(
req
->
wrk
->
stats
.
cache_hit
)
http_PrintfHeader
(
req
->
resp
,
"X-Varnish: %u %u"
,
req
->
vsl
->
wid
&
VSL_IDENTMASK
,
req
->
obj
->
vxid
&
VSL_IDENTMASK
);
"X-Varnish: %u %u"
,
VXID
(
req
->
vsl
->
wid
)
,
VXID
(
req
->
obj
->
vxid
)
);
else
http_PrintfHeader
(
req
->
resp
,
"X-Varnish: %u"
,
req
->
vsl
->
wid
&
VSL_IDENTMASK
);
"X-Varnish: %u"
,
VXID
(
req
->
vsl
->
wid
)
);
/* We base Age calculation upon the last timestamp taken during
client request processing. This gives some inaccuracy, but
...
...
@@ -221,8 +221,7 @@ cnt_synth(struct worker *wrk, struct req *req)
VTIM_format
(
now
,
date
);
http_PrintfHeader
(
h
,
"Date: %s"
,
date
);
http_SetHeader
(
h
,
"Server: Varnish"
);
http_PrintfHeader
(
req
->
resp
,
"X-Varnish: %u"
,
req
->
vsl
->
wid
&
VSL_IDENTMASK
);
http_PrintfHeader
(
req
->
resp
,
"X-Varnish: %u"
,
VXID
(
req
->
vsl
->
wid
));
http_PutResponse
(
h
,
"HTTP/1.1"
,
req
->
err_code
,
req
->
err_reason
);
AZ
(
req
->
synth_body
);
...
...
@@ -599,10 +598,9 @@ cnt_pipe(struct worker *wrk, struct req *req)
wrk
->
stats
.
s_pipe
++
;
bo
=
VBO_GetBusyObj
(
wrk
,
req
);
HTTP_Setup
(
bo
->
bereq
,
bo
->
ws
,
bo
->
vsl
,
SLT_BereqMethod
);
VSLb
(
bo
->
vsl
,
SLT_Begin
,
"bereq %u pipe"
,
req
->
vsl
->
wid
&
VSL_IDENTMASK
);
VSLb
(
bo
->
vsl
,
SLT_Begin
,
"bereq %u pipe"
,
VXID
(
req
->
vsl
->
wid
)
);
http_FilterReq
(
bo
->
bereq
,
req
->
http
,
0
);
// XXX: 0 ?
http_PrintfHeader
(
bo
->
bereq
,
"X-Varnish: %u"
,
req
->
vsl
->
wid
&
VSL_IDENTMASK
);
http_PrintfHeader
(
bo
->
bereq
,
"X-Varnish: %u"
,
VXID
(
req
->
vsl
->
wid
));
http_SetHeader
(
bo
->
bereq
,
"Connection: close"
);
VCL_pipe_method
(
req
->
vcl
,
wrk
,
req
,
bo
,
req
->
http
->
ws
);
...
...
@@ -611,7 +609,7 @@ cnt_pipe(struct worker *wrk, struct req *req)
INCOMPL
();
assert
(
wrk
->
handling
==
VCL_RET_PIPE
);
VSLb
(
req
->
vsl
,
SLT_Link
,
"bereq %u pipe"
,
bo
->
vsl
->
wid
&
VSL_IDENTMASK
);
VSLb
(
req
->
vsl
,
SLT_Link
,
"bereq %u pipe"
,
VXID
(
bo
->
vsl
->
wid
)
);
PipeRequest
(
req
,
bo
);
assert
(
WRW_IsReleased
(
wrk
));
http_Teardown
(
bo
->
bereq
);
...
...
bin/varnishd/cache/cache_session.c
View file @
cfb309ca
...
...
@@ -134,8 +134,8 @@ ses_sess_pool_task(struct worker *wrk, void *arg)
req
=
SES_GetReq
(
wrk
,
sp
);
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
AN
(
req
->
vsl
->
wid
&
VSL_CLIENTMARKER
);
VSLb
(
req
->
vsl
,
SLT_Begin
,
"req %u rxreq"
,
sp
->
vxid
&
VSL_IDENTMASK
);
VSL
(
SLT_Link
,
sp
->
vxid
,
"req %u rxreq"
,
req
->
vsl
->
wid
&
VSL_IDENTMASK
);
VSLb
(
req
->
vsl
,
SLT_Begin
,
"req %u rxreq"
,
VXID
(
sp
->
vxid
)
);
VSL
(
SLT_Link
,
sp
->
vxid
,
"req %u rxreq"
,
VXID
(
req
->
vsl
->
wid
)
);
sp
->
sess_step
=
S_STP_NEWREQ
;
ses_req_pool_task
(
wrk
,
req
);
...
...
bin/varnishd/cache/cache_vrt_var.c
View file @
cfb309ca
...
...
@@ -504,8 +504,7 @@ VRT_r_req_xid(const struct vrt_ctx *ctx)
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
ctx
->
req
,
REQ_MAGIC
);
return
(
WS_Printf
(
ctx
->
req
->
http
->
ws
,
"%u"
,
ctx
->
req
->
vsl
->
wid
&
VSL_IDENTMASK
));
return
(
WS_Printf
(
ctx
->
req
->
http
->
ws
,
"%u"
,
VXID
(
ctx
->
req
->
vsl
->
wid
)));
}
const
char
*
...
...
@@ -515,8 +514,7 @@ VRT_r_bereq_xid(const struct vrt_ctx *ctx)
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
ctx
->
bo
,
BUSYOBJ_MAGIC
);
return
(
WS_Printf
(
ctx
->
bo
->
bereq
->
ws
,
"%u"
,
ctx
->
bo
->
vsl
->
wid
&
VSL_IDENTMASK
));
return
(
WS_Printf
(
ctx
->
bo
->
bereq
->
ws
,
"%u"
,
VXID
(
ctx
->
bo
->
vsl
->
wid
)));
}
/*--------------------------------------------------------------------*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment