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
61c19388
Commit
61c19388
authored
Aug 17, 2020
by
Reza Naghibi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix shard director in pipe mode
Switch the ctx and workspace to the req when resolving in pipe mode.
parent
911d2b8c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
2 deletions
+11
-2
cache_backend.c
bin/varnishd/cache/cache_backend.c
+1
-1
cache_director.c
bin/varnishd/cache/cache_director.c
+3
-0
vmod_shard.c
lib/libvmod_directors/vmod_shard.c
+7
-1
No files found.
bin/varnishd/cache/cache_backend.c
View file @
61c19388
...
...
@@ -352,7 +352,7 @@ vbe_dir_http1pipe(const struct director *d, struct req *req, struct busyobj *bo)
v1a
.
req
=
req
->
acct
.
req_hdrbytes
;
req
->
acct
.
req_hdrbytes
=
0
;
req
->
res_mode
=
RES_PIPE
;
assert
(
req
->
res_mode
&
RES_PIPE
)
;
pfd
=
vbe_dir_getfd
(
req
->
wrk
,
bp
,
bo
,
0
);
...
...
bin/varnishd/cache/cache_director.c
View file @
61c19388
...
...
@@ -193,8 +193,11 @@ VDI_Http1Pipe(struct req *req, struct busyobj *bo)
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
CHECK_OBJ_NOTNULL
(
bo
,
BUSYOBJ_MAGIC
);
req
->
res_mode
=
RES_PIPE
;
d
=
vdi_resolve
(
req
->
wrk
,
bo
);
if
(
d
==
NULL
||
d
->
http1pipe
==
NULL
)
{
req
->
res_mode
=
0
;
VSLb
(
bo
->
vsl
,
SLT_VCL_Error
,
"Backend does not support pipe"
);
return
(
SC_TX_ERROR
);
}
...
...
lib/libvmod_directors/vmod_shard.c
View file @
61c19388
...
...
@@ -759,7 +759,13 @@ vmod_shard_resolve(const struct director *dir, struct worker *wrk,
ctx
->
sp
=
bo
->
sp
;
ctx
->
now
=
bo
->
t_prev
;
ctx
->
ws
=
bo
->
ws
;
ctx
->
method
=
VCL_MET_BACKEND_FETCH
;
if
(
bo
->
req
)
{
CHECK_OBJ_NOTNULL
(
bo
->
req
,
REQ_MAGIC
);
if
(
bo
->
req
->
res_mode
&
RES_PIPE
)
{
ctx
->
req
=
bo
->
req
;
ctx
->
ws
=
ctx
->
req
->
ws
;
}
}
pp
=
vmod_shard_param_read
(
ctx
,
vshard
,
vshard
->
param
,
pstk
,
"shard_resolve"
);
...
...
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