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
c52117a2
Commit
c52117a2
authored
Dec 02, 2016
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1e3 status codes #1
parent
ea1da86f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
6 deletions
+12
-6
cache_req_fsm.c
bin/varnishd/cache/cache_req_fsm.c
+1
-1
cache_vrt.c
bin/varnishd/cache/cache_vrt.c
+3
-3
c00068.vtc
bin/varnishtest/tests/c00068.vtc
+5
-2
generate.py
lib/libvcc/generate.py
+3
-0
No files found.
bin/varnishd/cache/cache_req_fsm.c
View file @
c52117a2
...
...
@@ -160,7 +160,7 @@ cnt_synth(struct worker *wrk, struct req *req)
now
=
W_TIM_real
(
wrk
);
VSLb_ts_req
(
req
,
"Process"
,
now
);
if
(
req
->
err_code
<
100
||
req
->
err_code
>
999
)
if
(
req
->
err_code
<
100
)
req
->
err_code
=
501
;
HTTP_Setup
(
req
->
resp
,
req
->
ws
,
req
->
vsl
,
SLT_RespMethod
);
...
...
bin/varnishd/cache/cache_vrt.c
View file @
c52117a2
...
...
@@ -54,11 +54,11 @@ VRT_synth(VRT_CTX, unsigned code, const char *reason)
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
ctx
->
req
,
REQ_MAGIC
);
if
(
code
<
100
||
code
>
999
)
if
(
code
<
100
)
code
=
503
;
ctx
->
req
->
err_code
=
(
uint16_t
)
code
;
ctx
->
req
->
err_reason
=
reason
?
reason
:
http_Status2Reason
(
ctx
->
req
->
err_code
,
NULL
);
ctx
->
req
->
err_reason
=
reason
?
reason
:
http_Status2Reason
(
ctx
->
req
->
err_code
%
1000
,
NULL
);
}
/*--------------------------------------------------------------------*/
...
...
bin/varnishtest/tests/c00068.vtc
View file @
c52117a2
...
...
@@ -20,14 +20,17 @@ varnish v1 -vcl+backend {
if (req.url == "/332") {
return (synth(332, "FOO"));
} else if (req.url == "/333") {
return (synth(resp.status, resp.reason));
return (synth(resp.status + 1000,
resp.reason));
} else {
return (synth(334, "BAR"));
}
}
sub vcl_synth {
if (resp.status == 333) {
# internal response status >1000 will be taken modulo
# 1000 when sent
if (resp.status == 1333) {
set resp.http.connection = "close";
} else if (resp.status == 332) {
if (req.restarts == 0) {
...
...
lib/libvcc/generate.py
View file @
c52117a2
...
...
@@ -492,6 +492,9 @@ sp_variables = [
(
'backend_response'
,
'backend_error'
),
(
'backend_response'
,
'backend_error'
),
"""
The HTTP status code returned by the server.
Status codes >1000 can be set for vcl-internal
purposes and will be taken modulo 1000 on delivery.
"""
),
(
'beresp.reason'
,
...
...
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