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
3da2ed68
Commit
3da2ed68
authored
Oct 02, 2017
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ensure consistent req init for vcl switching
Merges #2447
parent
c2406f4f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
28 deletions
+37
-28
cache_req_fsm.c
bin/varnishd/cache/cache_req_fsm.c
+37
-28
No files found.
bin/varnishd/cache/cache_req_fsm.c
View file @
3da2ed68
...
...
@@ -738,35 +738,15 @@ cnt_restart(struct worker *wrk, struct req *req)
return
(
REQ_FSM_MORE
);
}
/*--------------------------------------------------------------------
* We have a complete request, set everything up and start it.
* We can come here both with a request from the client and with
* a interior request during ESI delivery.
/*
* prepare the request for vcl_recv, either initially or after a reset
* e.g. due to vcl switching
*/
static
enum
req_fsm_nxt
cnt_recv
(
struct
worker
*
wrk
,
struct
req
*
req
)
static
void
cnt_recv
_prep
(
struct
req
*
req
,
const
char
*
ci
)
{
unsigned
recv_handling
;
struct
VSHA256Context
sha256ctx
;
const
char
*
xff
;
const
char
*
ci
,
*
cp
;
CHECK_OBJ_NOTNULL
(
wrk
,
WORKER_MAGIC
);
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
AN
(
req
->
vcl
);
AZ
(
req
->
objcore
);
AZ
(
req
->
err_code
);
AZ
(
isnan
(
req
->
t_first
));
AZ
(
isnan
(
req
->
t_prev
));
AZ
(
isnan
(
req
->
t_req
));
ci
=
SES_Get_String_Attr
(
req
->
sp
,
SA_CLIENT_IP
);
cp
=
SES_Get_String_Attr
(
req
->
sp
,
SA_CLIENT_PORT
);
VSLb
(
req
->
vsl
,
SLT_ReqStart
,
"%s %s"
,
ci
,
cp
);
http_VSL_log
(
req
->
http
);
if
(
req
->
restarts
==
0
)
{
/*
...
...
@@ -784,7 +764,6 @@ cnt_recv(struct worker *wrk, struct req *req)
http_CollectHdr
(
req
->
http
,
H_Cache_Control
);
/* By default we use the first backend */
AZ
(
req
->
director_hint
);
req
->
director_hint
=
VCL_DefaultDirector
(
req
->
vcl
);
AN
(
req
->
director_hint
);
...
...
@@ -798,6 +777,37 @@ cnt_recv(struct worker *wrk, struct req *req)
req
->
vdc
->
retval
=
0
;
req
->
is_hit
=
0
;
}
/*--------------------------------------------------------------------
* We have a complete request, set everything up and start it.
* We can come here both with a request from the client and with
* a interior request during ESI delivery.
*/
static
enum
req_fsm_nxt
cnt_recv
(
struct
worker
*
wrk
,
struct
req
*
req
)
{
unsigned
recv_handling
;
struct
VSHA256Context
sha256ctx
;
const
char
*
ci
,
*
cp
;
CHECK_OBJ_NOTNULL
(
wrk
,
WORKER_MAGIC
);
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
AN
(
req
->
vcl
);
AZ
(
req
->
objcore
);
AZ
(
req
->
err_code
);
AZ
(
isnan
(
req
->
t_first
));
AZ
(
isnan
(
req
->
t_prev
));
AZ
(
isnan
(
req
->
t_req
));
ci
=
SES_Get_String_Attr
(
req
->
sp
,
SA_CLIENT_IP
);
cp
=
SES_Get_String_Attr
(
req
->
sp
,
SA_CLIENT_PORT
);
VSLb
(
req
->
vsl
,
SLT_ReqStart
,
"%s %s"
,
ci
,
cp
);
http_VSL_log
(
req
->
http
);
cnt_recv_prep
(
req
,
ci
);
if
(
req
->
req_body_status
==
REQ_BODY_FAIL
)
{
req
->
doclose
=
SC_OVERLOAD
;
...
...
@@ -806,10 +816,9 @@ cnt_recv(struct worker *wrk, struct req *req)
VCL_recv_method
(
req
->
vcl
,
wrk
,
req
,
NULL
,
NULL
);
if
(
wrk
->
handling
==
VCL_RET_VCL
&&
req
->
restarts
==
0
)
{
req
->
director_hint
=
VCL_DefaultDirector
(
req
->
vcl
);
HTTP_Copy
(
req
->
http
,
req
->
http0
);
WS_Reset
(
req
->
ws
,
req
->
ws_req
);
AN
(
req
->
director_hint
);
cnt_recv_prep
(
req
,
ci
);
VCL_recv_method
(
req
->
vcl
,
wrk
,
req
,
NULL
,
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