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
3abbb127
Commit
3abbb127
authored
Dec 23, 2011
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move another 56 bytes from sess to req
parent
097e646a
Changes
18
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
111 additions
and
104 deletions
+111
-104
cache.h
bin/varnishd/cache/cache.h
+10
-10
cache_backend.c
bin/varnishd/cache/cache_backend.c
+2
-2
cache_center.c
bin/varnishd/cache/cache_center.c
+67
-59
cache_dir.c
bin/varnishd/cache/cache_dir.c
+1
-1
cache_dir_dns.c
bin/varnishd/cache/cache_dir_dns.c
+2
-2
cache_esi_deliver.c
bin/varnishd/cache/cache_esi_deliver.c
+1
-1
cache_fetch.c
bin/varnishd/cache/cache_fetch.c
+1
-1
cache_hash.c
bin/varnishd/cache/cache_hash.c
+2
-2
cache_panic.c
bin/varnishd/cache/cache_panic.c
+5
-5
cache_pipe.c
bin/varnishd/cache/cache_pipe.c
+1
-1
cache_response.c
bin/varnishd/cache/cache_response.c
+1
-1
cache_rfc2616.c
bin/varnishd/cache/cache_rfc2616.c
+1
-1
cache_session.c
bin/varnishd/cache/cache_session.c
+6
-6
cache_vcl.c
bin/varnishd/cache/cache_vcl.c
+1
-1
cache_vrt.c
bin/varnishd/cache/cache_vrt.c
+5
-5
cache_vrt_var.c
bin/varnishd/cache/cache_vrt_var.c
+4
-4
cache_wrw.c
bin/varnishd/cache/cache_wrw.c
+1
-1
cache_waiter.c
bin/varnishd/waiter/cache_waiter.c
+0
-1
No files found.
bin/varnishd/cache/cache.h
View file @
3abbb127
...
...
@@ -605,6 +605,16 @@ struct req {
unsigned
char
sendbody
;
unsigned
char
wantbody
;
uint16_t
err_code
;
const
char
*
err_reason
;
struct
director
*
director
;
struct
VCL_conf
*
vcl
;
uint64_t
req_bodybytes
;
char
*
ws_req
;
/* WS above request data */
double
t_resp
;
};
/*--------------------------------------------------------------------*/
...
...
@@ -656,19 +666,9 @@ struct sess {
struct
http
*
http0
;
struct
ws
ws
[
1
];
char
*
ws_req
;
/* WS above request data */
uint16_t
err_code
;
const
char
*
err_reason
;
struct
director
*
director
;
struct
VCL_conf
*
vcl
;
uint64_t
req_bodybytes
;
/* Timestamps, all on TIM_real() timescale */
double
t_req
;
double
t_resp
;
/* TBD fields ------------------------------------------------*/
...
...
bin/varnishd/cache/cache_backend.c
View file @
3abbb127
...
...
@@ -348,7 +348,7 @@ vbe_GetVbe(const struct sess *sp, struct vdi_simple *vs)
/* XXX locking of stats */
VSC_C_main
->
backend_reuse
+=
1
;
WSP
(
sp
,
SLT_Backend
,
"%d %s %s"
,
vc
->
fd
,
sp
->
director
->
vcl_name
,
bp
->
display_name
);
vc
->
fd
,
sp
->
req
->
director
->
vcl_name
,
bp
->
display_name
);
vc
->
vdis
=
vs
;
vc
->
recycled
=
1
;
return
(
vc
);
...
...
@@ -390,7 +390,7 @@ vbe_GetVbe(const struct sess *sp, struct vdi_simple *vs)
vc
->
backend
=
bp
;
VSC_C_main
->
backend_conn
++
;
WSP
(
sp
,
SLT_Backend
,
"%d %s %s"
,
vc
->
fd
,
sp
->
director
->
vcl_name
,
bp
->
display_name
);
vc
->
fd
,
sp
->
req
->
director
->
vcl_name
,
bp
->
display_name
);
vc
->
vdis
=
vs
;
return
(
vc
);
}
...
...
bin/varnishd/cache/cache_center.c
View file @
3abbb127
This diff is collapsed.
Click to expand it.
bin/varnishd/cache/cache_dir.c
View file @
3abbb127
...
...
@@ -105,7 +105,7 @@ VDI_GetFd(const struct director *d, struct sess *sp)
CHECK_OBJ_NOTNULL
(
sp
,
SESS_MAGIC
);
if
(
d
==
NULL
)
d
=
sp
->
director
;
d
=
sp
->
req
->
director
;
CHECK_OBJ_NOTNULL
(
d
,
DIRECTOR_MAGIC
);
return
(
d
->
getfd
(
d
,
sp
));
}
...
...
bin/varnishd/cache/cache_dir_dns.c
View file @
3abbb127
...
...
@@ -403,8 +403,8 @@ vdi_dns_healthy(const struct director *dir, const struct sess *sp)
int i;
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
CHECK_OBJ_NOTNULL(sp->director, DIRECTOR_MAGIC);
CAST_OBJ_NOTNULL(vs, sp->director->priv, VDI_DNS_MAGIC);
CHECK_OBJ_NOTNULL(sp->
req->
director, DIRECTOR_MAGIC);
CAST_OBJ_NOTNULL(vs, sp->
req->
director->priv, VDI_DNS_MAGIC);
dir = vdi_dns_find_backend(sp, vs);
...
...
bin/varnishd/cache/cache_esi_deliver.c
View file @
3abbb127
...
...
@@ -80,7 +80,7 @@ ved_include(struct sess *sp, const char *src, const char *host)
* XXX: or not (for session/backend coupling). Until then
* XXX: make sure we don't trip up the check in vcl_recv.
*/
sp
->
director
=
NULL
;
sp
->
req
->
director
=
NULL
;
sp
->
step
=
STP_RECV
;
http_ForceGet
(
sp
->
http
);
...
...
bin/varnishd/cache/cache_fetch.c
View file @
3abbb127
...
...
@@ -390,7 +390,7 @@ FetchHdr(struct sess *sp, int need_host_hdr)
CHECK_OBJ_NOTNULL
(
wrk
->
busyobj
,
BUSYOBJ_MAGIC
);
htc
=
&
wrk
->
busyobj
->
htc
;
AN
(
sp
->
director
);
AN
(
sp
->
req
->
director
);
AZ
(
sp
->
wrk
->
obj
);
if
(
sp
->
wrk
->
objcore
!=
NULL
)
{
/* pass has no objcore */
...
...
bin/varnishd/cache/cache_hash.c
View file @
3abbb127
...
...
@@ -302,7 +302,7 @@ HSH_Lookup(struct sess *sp, struct objhead **poh)
CHECK_OBJ_NOTNULL
(
sp
,
SESS_MAGIC
);
CHECK_OBJ_NOTNULL
(
sp
->
wrk
,
WORKER_MAGIC
);
CHECK_OBJ_NOTNULL
(
sp
->
http
,
HTTP_MAGIC
);
AN
(
sp
->
director
);
AN
(
sp
->
req
->
director
);
AN
(
hash
);
wrk
=
sp
->
wrk
;
...
...
@@ -393,7 +393,7 @@ HSH_Lookup(struct sess *sp, struct objhead **poh)
if
(
oc
==
NULL
/* We found no live object */
&&
grace_oc
!=
NULL
/* There is a grace candidate */
&&
(
busy_oc
!=
NULL
/* Somebody else is already busy */
||
!
VDI_Healthy
(
sp
->
director
,
sp
)))
{
||
!
VDI_Healthy
(
sp
->
req
->
director
,
sp
)))
{
/* Or it is impossible to fetch */
o
=
oc_getobj
(
sp
->
wrk
,
grace_oc
);
CHECK_OBJ_NOTNULL
(
o
,
OBJECT_MAGIC
);
...
...
bin/varnishd/cache/cache_panic.c
View file @
3abbb127
...
...
@@ -254,10 +254,10 @@ pan_sess(const struct sess *sp)
VSB_printf
(
pan_vsp
,
" handling = %s,
\n
"
,
hand
);
else
VSB_printf
(
pan_vsp
,
" handling = 0x%x,
\n
"
,
sp
->
req
->
handling
);
if
(
sp
->
err_code
)
if
(
sp
->
req
->
err_code
)
VSB_printf
(
pan_vsp
,
" err_code = %d, err_reason = %s,
\n
"
,
sp
->
err_code
,
sp
->
err_reason
?
sp
->
err_reason
:
"(null)"
);
" err_code = %d, err_reason = %s,
\n
"
,
sp
->
req
->
err_code
,
sp
->
req
->
err_reason
?
sp
->
req
->
err_reason
:
"(null)"
);
VSB_printf
(
pan_vsp
,
" restarts = %d, esi_level = %d
\n
"
,
sp
->
req
->
restarts
,
sp
->
req
->
esi_level
);
...
...
@@ -271,8 +271,8 @@ pan_sess(const struct sess *sp)
if
(
sp
->
wrk
!=
NULL
)
pan_wrk
(
sp
->
wrk
);
if
(
VALID_OBJ
(
sp
->
vcl
,
VCL_CONF_MAGIC
))
pan_vcl
(
sp
->
vcl
);
if
(
VALID_OBJ
(
sp
->
req
->
vcl
,
VCL_CONF_MAGIC
))
pan_vcl
(
sp
->
req
->
vcl
);
if
(
VALID_OBJ
(
sp
->
wrk
->
obj
,
OBJECT_MAGIC
))
pan_object
(
sp
->
wrk
->
obj
);
...
...
bin/varnishd/cache/cache_pipe.c
View file @
3abbb127
...
...
@@ -94,7 +94,7 @@ PipeSession(struct sess *sp)
return
;
}
sp
->
t_resp
=
VTIM_real
();
sp
->
req
->
t_resp
=
VTIM_real
();
memset
(
fds
,
0
,
sizeof
fds
);
...
...
bin/varnishd/cache/cache_response.c
View file @
3abbb127
...
...
@@ -139,7 +139,7 @@ RES_BuildHttp(const struct sess *sp)
http_PrintfHeader
(
sp
->
wrk
,
sp
->
vsl_id
,
sp
->
wrk
->
resp
,
"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
);
sp
->
wrk
->
obj
->
exp
.
age
+
sp
->
req
->
t_resp
-
sp
->
wrk
->
obj
->
exp
.
entered
);
http_SetHeader
(
sp
->
wrk
,
sp
->
vsl_id
,
sp
->
wrk
->
resp
,
"Via: 1.1 varnish"
);
http_PrintfHeader
(
sp
->
wrk
,
sp
->
vsl_id
,
sp
->
wrk
->
resp
,
"Connection: %s"
,
sp
->
req
->
doclose
?
"close"
:
"keep-alive"
);
...
...
bin/varnishd/cache/cache_rfc2616.c
View file @
3abbb127
...
...
@@ -98,7 +98,7 @@ RFC2616_Ttl(const struct sess *sp)
if
(
http_GetHdr
(
hp
,
H_Date
,
&
p
))
h_date
=
VTIM_parse
(
p
);
switch
(
sp
->
err_code
)
{
switch
(
sp
->
req
->
err_code
)
{
default:
expp
->
ttl
=
-
1
.;
break
;
...
...
bin/varnishd/cache/cache_session.c
View file @
3abbb127
...
...
@@ -82,7 +82,7 @@ SES_Charge(struct sess *sp)
{
struct
acct
*
a
=
&
sp
->
wrk
->
acct_tmp
;
sp
->
req_bodybytes
+=
a
->
bodybytes
;
sp
->
req
->
req
_bodybytes
+=
a
->
bodybytes
;
#define ACCT(foo) \
sp->wrk->stats.s_##foo += a->foo; \
...
...
@@ -170,7 +170,6 @@ ses_setup(struct sessmem *sm)
sp
->
t_open
=
NAN
;
sp
->
t_idle
=
NAN
;
sp
->
t_req
=
NAN
;
sp
->
t_resp
=
NAN
;
WS_Init
(
sp
->
ws
,
"sess"
,
sm
->
wsp
,
sm
->
workspace
);
sp
->
http
=
sm
->
http
[
0
];
...
...
@@ -274,12 +273,12 @@ SES_Schedule(struct sess *sp)
if
(
Pool_Schedule
(
pp
->
pool
,
sp
))
{
VSC_C_main
->
client_drop_late
++
;
sp
->
t_idle
=
VTIM_real
();
if
(
sp
->
vcl
!=
NULL
)
{
if
(
sp
->
req
->
vcl
!=
NULL
)
{
/*
* A session parked on a busy object can come here
* after it wakes up. Loose the VCL reference.
*/
VCL_Rel
(
&
sp
->
vcl
);
VCL_Rel
(
&
sp
->
req
->
vcl
);
}
SES_Delete
(
sp
,
"dropped"
,
sp
->
t_idle
);
return
(
1
);
...
...
@@ -349,10 +348,11 @@ SES_Delete(struct sess *sp, const char *reason, double now)
assert
(
!
isnan
(
sp
->
t_open
));
assert
(
sp
->
fd
<
0
);
if
(
sp
->
req
!=
NULL
)
if
(
sp
->
req
!=
NULL
)
{
AZ
(
sp
->
req
->
vcl
);
SES_ReleaseReq
(
sp
);
}
AZ
(
sp
->
vcl
);
if
(
*
sp
->
addr
==
'\0'
)
strcpy
(
sp
->
addr
,
"-"
);
if
(
*
sp
->
port
==
'\0'
)
...
...
bin/varnishd/cache/cache_vcl.c
View file @
3abbb127
...
...
@@ -336,7 +336,7 @@ VCL_##func##_method(struct sess *sp) \
sp->req->handling = 0; \
sp->req->cur_method = VCL_MET_ ## upper; \
WSP(sp, SLT_VCL_call, "%s", #func); \
(void)sp->vcl->func##_func(sp); \
(void)sp->
req->
vcl->func##_func(sp); \
WSP(sp, SLT_VCL_return, "%s", VCL_Return_Name(sp->req->handling)); \
sp->req->cur_method = 0; \
assert((1U << sp->req->handling) & bitmap); \
...
...
bin/varnishd/cache/cache_vrt.c
View file @
3abbb127
...
...
@@ -60,8 +60,8 @@ VRT_error(struct sess *sp, unsigned code, const char *reason)
reason
:
"(null)"
);
if
(
code
<
100
||
code
>
999
)
code
=
503
;
sp
->
err_code
=
(
uint16_t
)
code
;
sp
->
err_reason
=
reason
?
reason
:
http_StatusMessage
(
sp
->
err_code
);
sp
->
req
->
err_code
=
(
uint16_t
)
code
;
sp
->
req
->
err_reason
=
reason
?
reason
:
http_StatusMessage
(
sp
->
req
->
err_code
);
}
/*--------------------------------------------------------------------*/
...
...
@@ -75,7 +75,7 @@ VRT_count(const struct sess *sp, unsigned u)
CHECK_OBJ_NOTNULL
(
sp
,
SESS_MAGIC
);
if
(
cache_param
->
vcl_trace
)
WSP
(
sp
,
SLT_VCL_trace
,
"%u %u.%u"
,
u
,
sp
->
vcl
->
ref
[
u
].
line
,
sp
->
vcl
->
ref
[
u
].
pos
);
sp
->
req
->
vcl
->
ref
[
u
].
line
,
sp
->
req
->
vcl
->
ref
[
u
].
pos
);
}
/*--------------------------------------------------------------------*/
...
...
@@ -351,7 +351,7 @@ VRT_backend_string(const struct sess *sp, const struct director *d)
{
CHECK_OBJ_NOTNULL
(
sp
,
SESS_MAGIC
);
if
(
d
==
NULL
)
d
=
sp
->
director
;
d
=
sp
->
req
->
director
;
if
(
d
==
NULL
)
return
(
NULL
);
return
(
d
->
vcl_name
);
...
...
@@ -372,7 +372,7 @@ VRT_Rollback(struct sess *sp)
{
HTTP_Copy
(
sp
->
http
,
sp
->
http0
);
WS_Reset
(
sp
->
ws
,
sp
->
ws_req
);
WS_Reset
(
sp
->
ws
,
sp
->
req
->
ws_req
);
}
/*--------------------------------------------------------------------*/
...
...
bin/varnishd/cache/cache_vrt_var.c
View file @
3abbb127
...
...
@@ -307,14 +307,14 @@ void
VRT_l_req_backend
(
struct
sess
*
sp
,
struct
director
*
be
)
{
CHECK_OBJ_NOTNULL
(
sp
,
SESS_MAGIC
);
sp
->
director
=
be
;
sp
->
req
->
director
=
be
;
}
struct
director
*
__match_proto__
()
VRT_r_req_backend
(
struct
sess
*
sp
)
{
CHECK_OBJ_NOTNULL
(
sp
,
SESS_MAGIC
);
return
(
sp
->
director
);
return
(
sp
->
req
->
director
);
}
/*--------------------------------------------------------------------*/
...
...
@@ -548,7 +548,7 @@ unsigned
VRT_r_req_backend_healthy
(
const
struct
sess
*
sp
)
{
CHECK_OBJ_NOTNULL
(
sp
,
SESS_MAGIC
);
CHECK_OBJ_NOTNULL
(
sp
->
director
,
DIRECTOR_MAGIC
);
return
(
VDI_Healthy
(
sp
->
director
,
sp
));
CHECK_OBJ_NOTNULL
(
sp
->
req
->
director
,
DIRECTOR_MAGIC
);
return
(
VDI_Healthy
(
sp
->
req
->
director
,
sp
));
}
bin/varnishd/cache/cache_wrw.c
View file @
3abbb127
...
...
@@ -159,7 +159,7 @@ WRW_Flush(struct worker *wrk)
* counter to prevent slowlaris attacks
*/
if
(
VTIM_real
()
-
wrk
->
sp
->
t_resp
>
if
(
VTIM_real
()
-
wrk
->
sp
->
req
->
t_resp
>
cache_param
->
send_timeout
)
{
WSL
(
wrk
,
SLT_Debug
,
*
wrw
->
wfd
,
"Hit total send timeout, "
...
...
bin/varnishd/waiter/cache_waiter.c
View file @
3abbb127
...
...
@@ -69,7 +69,6 @@ WAIT_Enter(struct sess *sp)
CHECK_OBJ_NOTNULL
(
sp
,
SESS_MAGIC
);
CHECK_OBJ_NOTNULL
(
sp
->
wrk
,
WORKER_MAGIC
);
AZ
(
sp
->
req
);
AZ
(
sp
->
vcl
);
assert
(
sp
->
fd
>=
0
);
sp
->
wrk
=
NULL
;
...
...
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