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
9173a98a
Commit
9173a98a
authored
Dec 23, 2011
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move xid from sess to req
parent
f7ef385a
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
25 additions
and
23 deletions
+25
-23
cache.h
bin/varnishd/cache/cache.h
+2
-1
cache_center.c
bin/varnishd/cache/cache_center.c
+9
-9
cache_cli.c
bin/varnishd/cache/cache_cli.c
+1
-0
cache_esi_deliver.c
bin/varnishd/cache/cache_esi_deliver.c
+2
-2
cache_http.c
bin/varnishd/cache/cache_http.c
+1
-1
cache_panic.c
bin/varnishd/cache/cache_panic.c
+1
-1
cache_response.c
bin/varnishd/cache/cache_response.c
+3
-3
cache_rfc2616.c
bin/varnishd/cache/cache_rfc2616.c
+1
-1
cache_vrt_var.c
bin/varnishd/cache/cache_vrt_var.c
+5
-5
No files found.
bin/varnishd/cache/cache.h
View file @
9173a98a
...
...
@@ -580,6 +580,8 @@ struct object {
struct
req
{
unsigned
magic
;
#define REQ_MAGIC 0x2751aaa1
unsigned
xid
;
};
/*--------------------------------------------------------------------*/
...
...
@@ -625,7 +627,6 @@ struct sess {
/* Request related fields ------------------------------------*/
unsigned
xid
;
int
restarts
;
int
esi_level
;
...
...
bin/varnishd/cache/cache_center.c
View file @
9173a98a
...
...
@@ -113,7 +113,7 @@ cnt_wait(struct sess *sp)
AZ
(
sp
->
vcl
);
AZ
(
wrk
->
obj
);
AZ
(
sp
->
esi_level
);
assert
(
sp
->
xid
==
0
);
assert
(
sp
->
req
->
xid
==
0
);
assert
(
!
isnan
(
sp
->
t_req
));
tmo
=
(
int
)(
1e3
*
cache_param
->
timeout_linger
);
...
...
@@ -397,7 +397,7 @@ cnt_done(struct sess *sp)
sp
->
t_idle
=
W_TIM_real
(
wrk
);
if
(
sp
->
xid
==
0
)
{
if
(
sp
->
req
->
xid
==
0
)
{
sp
->
t_resp
=
sp
->
t_idle
;
}
else
{
dp
=
sp
->
t_resp
-
sp
->
t_req
;
...
...
@@ -410,9 +410,9 @@ cnt_done(struct sess *sp)
(
uintmax_t
)
sp
->
req_bodybytes
);
}
WSP
(
sp
,
SLT_ReqEnd
,
"%u %.9f %.9f %.9f %.9f %.9f"
,
sp
->
xid
,
sp
->
t_req
,
sp
->
t_idle
,
dh
,
dp
,
da
);
sp
->
req
->
xid
,
sp
->
t_req
,
sp
->
t_idle
,
dh
,
dp
,
da
);
}
sp
->
xid
=
0
;
sp
->
req
->
xid
=
0
;
WSL_Flush
(
wrk
,
0
);
sp
->
t_req
=
NAN
;
...
...
@@ -503,7 +503,7 @@ cnt_error(struct sess *sp)
return
(
0
);
}
AN
(
wrk
->
obj
);
wrk
->
obj
->
xid
=
sp
->
xid
;
wrk
->
obj
->
xid
=
sp
->
req
->
xid
;
wrk
->
obj
->
exp
.
entered
=
sp
->
t_req
;
}
else
{
CHECK_OBJ_NOTNULL
(
wrk
->
busyobj
,
BUSYOBJ_MAGIC
);
...
...
@@ -869,7 +869,7 @@ cnt_fetchbody(struct sess *sp)
VSB_delete
(
vary
);
}
wrk
->
obj
->
xid
=
sp
->
xid
;
wrk
->
obj
->
xid
=
sp
->
req
->
xid
;
wrk
->
obj
->
response
=
sp
->
err_code
;
WS_Assert
(
wrk
->
obj
->
ws_o
);
...
...
@@ -1035,7 +1035,7 @@ cnt_first(struct sess *sp)
wrk
=
sp
->
wrk
;
CHECK_OBJ_NOTNULL
(
wrk
,
WORKER_MAGIC
);
assert
(
sp
->
xid
==
0
);
AZ
(
sp
->
req
);
assert
(
sp
->
restarts
==
0
);
AZ
(
sp
->
esi_level
);
...
...
@@ -1595,8 +1595,8 @@ cnt_start(struct sess *sp)
wrk
->
acct_tmp
.
req
++
;
/* Assign XID and log */
sp
->
xid
=
++
xids
;
/* XXX not locked */
WSP
(
sp
,
SLT_ReqStart
,
"%s %s %u"
,
sp
->
addr
,
sp
->
port
,
sp
->
xid
);
sp
->
req
->
xid
=
++
xids
;
/* XXX not locked */
WSP
(
sp
,
SLT_ReqStart
,
"%s %s %u"
,
sp
->
addr
,
sp
->
port
,
sp
->
req
->
xid
);
/* Borrow VCL reference from worker thread */
VCL_Refresh
(
&
wrk
->
vcl
);
...
...
bin/varnishd/cache/cache_cli.c
View file @
9173a98a
...
...
@@ -132,6 +132,7 @@ cli_debug_sizeof(struct cli *cli, const char * const *av, void *priv)
SZOF
(
struct
objcore
);
SZOF
(
struct
objhead
);
SZOF
(
struct
sess
);
SZOF
(
struct
req
);
SZOF
(
struct
vbc
);
SZOF
(
struct
VSC_C_main
);
SZOF
(
struct
lock
);
...
...
bin/varnishd/cache/cache_esi_deliver.c
View file @
9173a98a
...
...
@@ -91,7 +91,7 @@ ved_include(struct sess *sp, const char *src, const char *host)
/* Client content already taken care of */
http_Unset
(
sp
->
http
,
H_Content_Length
);
sxid
=
sp
->
xid
;
sxid
=
sp
->
req
->
xid
;
while
(
1
)
{
sp
->
wrk
=
w
;
CNT_Session
(
sp
);
...
...
@@ -102,7 +102,7 @@ ved_include(struct sess *sp, const char *src, const char *host)
DSL
(
0x20
,
SLT_Debug
,
sp
->
vsl_id
,
"loop waiting for ESI"
);
(
void
)
usleep
(
10000
);
}
sp
->
xid
=
sxid
;
sp
->
req
->
xid
=
sxid
;
AN
(
sp
->
wrk
);
assert
(
sp
->
step
==
STP_DONE
);
sp
->
esi_level
--
;
...
...
bin/varnishd/cache/cache_http.c
View file @
9173a98a
...
...
@@ -880,7 +880,7 @@ http_FilterHeader(const struct sess *sp, unsigned how)
else
http_copyh
(
hp
,
sp
->
http
,
HTTP_HDR_PROTO
);
http_FilterFields
(
sp
->
wrk
,
sp
->
vsl_id
,
hp
,
sp
->
http
,
how
);
http_PrintfHeader
(
sp
->
wrk
,
sp
->
vsl_id
,
hp
,
"X-Varnish: %u"
,
sp
->
xid
);
http_PrintfHeader
(
sp
->
wrk
,
sp
->
vsl_id
,
hp
,
"X-Varnish: %u"
,
sp
->
req
->
xid
);
}
/*--------------------------------------------------------------------
...
...
bin/varnishd/cache/cache_panic.c
View file @
9173a98a
...
...
@@ -235,7 +235,7 @@ pan_sess(const struct sess *sp)
VSB_printf
(
pan_vsp
,
"sp = %p {
\n
"
,
sp
);
VSB_printf
(
pan_vsp
,
" fd = %d, id = %u, xid = %u,
\n
"
,
sp
->
fd
,
sp
->
vsl_id
&
VSL_IDENTMASK
,
sp
->
xid
);
sp
->
fd
,
sp
->
vsl_id
&
VSL_IDENTMASK
,
sp
->
req
->
xid
);
VSB_printf
(
pan_vsp
,
" client = %s %s,
\n
"
,
sp
->
addr
?
sp
->
addr
:
"?.?.?.?"
,
sp
->
port
?
sp
->
port
:
"?"
);
...
...
bin/varnishd/cache/cache_response.c
View file @
9173a98a
...
...
@@ -132,12 +132,12 @@ RES_BuildHttp(const struct sess *sp)
http_PrintfHeader
(
sp
->
wrk
,
sp
->
vsl_id
,
sp
->
wrk
->
resp
,
"Date: %s"
,
time_str
);
if
(
sp
->
xid
!=
sp
->
wrk
->
obj
->
xid
)
if
(
sp
->
req
->
xid
!=
sp
->
wrk
->
obj
->
xid
)
http_PrintfHeader
(
sp
->
wrk
,
sp
->
vsl_id
,
sp
->
wrk
->
resp
,
"X-Varnish: %u %u"
,
sp
->
xid
,
sp
->
wrk
->
obj
->
xid
);
"X-Varnish: %u %u"
,
sp
->
req
->
xid
,
sp
->
wrk
->
obj
->
xid
);
else
http_PrintfHeader
(
sp
->
wrk
,
sp
->
vsl_id
,
sp
->
wrk
->
resp
,
"X-Varnish: %u"
,
sp
->
xid
);
"X-Varnish: %u"
,
sp
->
req
->
xid
);
http_PrintfHeader
(
sp
->
wrk
,
sp
->
vsl_id
,
sp
->
wrk
->
resp
,
"Age: %.0f"
,
sp
->
wrk
->
obj
->
exp
.
age
+
sp
->
t_resp
-
sp
->
wrk
->
obj
->
exp
.
entered
);
http_SetHeader
(
sp
->
wrk
,
sp
->
vsl_id
,
sp
->
wrk
->
resp
,
"Via: 1.1 varnish"
);
...
...
bin/varnishd/cache/cache_rfc2616.c
View file @
9173a98a
...
...
@@ -169,7 +169,7 @@ RFC2616_Ttl(const struct sess *sp)
/* calculated TTL, Our time, Date, Expires, max-age, age */
WSP
(
sp
,
SLT_TTL
,
"%u RFC %.0f %.0f %.0f %.0f %.0f %.0f %.0f %u"
,
sp
->
xid
,
expp
->
ttl
,
-
1
.,
-
1
.,
expp
->
entered
,
sp
->
req
->
xid
,
expp
->
ttl
,
-
1
.,
-
1
.,
expp
->
entered
,
expp
->
age
,
h_date
,
h_expires
,
max_age
);
}
...
...
bin/varnishd/cache/cache_vrt_var.c
View file @
9173a98a
...
...
@@ -416,11 +416,11 @@ VRT_DO_EXP(obj, sp->wrk->obj->exp, keep, 0,
vrt_wsp_exp
(
sp
,
sp
->
wrk
->
obj
->
xid
,
&
sp
->
wrk
->
obj
->
exp
);)
VRT_DO_EXP
(
beresp
,
sp
->
wrk
->
busyobj
->
exp
,
grace
,
0
,
vrt_wsp_exp
(
sp
,
sp
->
xid
,
&
sp
->
wrk
->
busyobj
->
exp
);)
vrt_wsp_exp
(
sp
,
sp
->
req
->
xid
,
&
sp
->
wrk
->
busyobj
->
exp
);)
VRT_DO_EXP
(
beresp
,
sp
->
wrk
->
busyobj
->
exp
,
ttl
,
0
,
vrt_wsp_exp
(
sp
,
sp
->
xid
,
&
sp
->
wrk
->
busyobj
->
exp
);)
vrt_wsp_exp
(
sp
,
sp
->
req
->
xid
,
&
sp
->
wrk
->
busyobj
->
exp
);)
VRT_DO_EXP
(
beresp
,
sp
->
wrk
->
busyobj
->
exp
,
keep
,
0
,
vrt_wsp_exp
(
sp
,
sp
->
xid
,
&
sp
->
wrk
->
busyobj
->
exp
);)
vrt_wsp_exp
(
sp
,
sp
->
req
->
xid
,
&
sp
->
wrk
->
busyobj
->
exp
);)
/*--------------------------------------------------------------------
* req.xid
...
...
@@ -433,9 +433,9 @@ VRT_r_req_xid(struct sess *sp)
int
size
;
CHECK_OBJ_NOTNULL
(
sp
,
SESS_MAGIC
);
size
=
snprintf
(
NULL
,
0
,
"%u"
,
sp
->
xid
)
+
1
;
size
=
snprintf
(
NULL
,
0
,
"%u"
,
sp
->
req
->
xid
)
+
1
;
AN
(
p
=
WS_Alloc
(
sp
->
http
->
ws
,
size
));
assert
(
snprintf
(
p
,
size
,
"%u"
,
sp
->
xid
)
<
size
);
assert
(
snprintf
(
p
,
size
,
"%u"
,
sp
->
req
->
xid
)
<
size
);
return
(
p
);
}
...
...
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