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
ba8e58b4
Commit
ba8e58b4
authored
Feb 19, 2020
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid spreading req.body status logic all over the place
parent
e9af8be8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
8 deletions
+8
-8
cache.h
bin/varnishd/cache/cache.h
+2
-1
cache_fetch.c
bin/varnishd/cache/cache_fetch.c
+3
-7
cache_http1_fetch.c
bin/varnishd/http1/cache_http1_fetch.c
+3
-0
No files found.
bin/varnishd/cache/cache.h
View file @
ba8e58b4
...
...
@@ -389,7 +389,6 @@ struct busyobj {
* is recycled.
*/
unsigned
retries
;
enum
req_body_state_e
initial_req_body_status
;
struct
req
*
req
;
struct
sess
*
sp
;
struct
worker
*
wrk
;
...
...
@@ -406,6 +405,8 @@ struct busyobj {
struct
objcore
*
stale_oc
;
struct
objcore
*
fetch_objcore
;
const
char
*
no_retry
;
struct
http_conn
*
htc
;
struct
pool_task
fetch_task
;
...
...
bin/varnishd/cache/cache_fetch.c
View file @
ba8e58b4
...
...
@@ -240,7 +240,6 @@ vbf_stp_mkbereq(struct worker *wrk, struct busyobj *bo)
bo
->
ws_bo
=
WS_Snapshot
(
bo
->
ws
);
HTTP_Clone
(
bo
->
bereq
,
bo
->
bereq0
);
bo
->
initial_req_body_status
=
bo
->
req
->
req_body_status
;
if
(
bo
->
req
->
req_body_status
==
REQ_BODY_NONE
)
{
bo
->
req
=
NULL
;
ObjSetState
(
bo
->
wrk
,
bo
->
fetch_objcore
,
BOS_REQ_DONE
);
...
...
@@ -270,12 +269,9 @@ vbf_stp_retry(struct worker *wrk, struct busyobj *bo)
assert
(
bo
->
fetch_objcore
->
boc
->
state
<=
BOS_REQ_DONE
);
if
(
bo
->
fetch_objcore
->
boc
->
state
==
BOS_REQ_DONE
&&
bo
->
initial_req_body_status
!=
REQ_BODY_NONE
&&
bo
->
bereq_body
==
NULL
)
{
/* We have already released the req and there was a
* request body that was not cached. Too late to retry. */
VSLb
(
bo
->
vsl
,
SLT_Error
,
"req.body already consumed"
);
if
(
bo
->
no_retry
!=
NULL
)
{
VSLb
(
bo
->
vsl
,
SLT_Error
,
"Retry not possible, %s"
,
bo
->
no_retry
);
return
(
F_STP_FAIL
);
}
...
...
bin/varnishd/http1/cache_http1_fetch.c
View file @
ba8e58b4
...
...
@@ -120,6 +120,9 @@ V1F_SendReq(struct worker *wrk, struct busyobj *bo, uint64_t *ctr_hdrbytes,
V1L_Chunked
(
wrk
);
i
=
VRB_Iterate
(
wrk
,
bo
->
vsl
,
bo
->
req
,
vbf_iter_req_body
,
bo
);
if
(
bo
->
req
->
req_body_status
!=
REQ_BODY_CACHED
)
bo
->
no_retry
=
"req.body not cached"
;
if
(
bo
->
req
->
req_body_status
==
REQ_BODY_FAIL
)
{
/*
* XXX: (#2332) We should test to see if the backend
...
...
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