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
d5affe57
Commit
d5affe57
authored
Jun 04, 2014
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Having wasted half an hour on it (again) it's time to kill the
"response/reason" confusion for good.
parent
22b84885
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
21 additions
and
21 deletions
+21
-21
cache.h
bin/varnishd/cache/cache.h
+1
-1
cache_http.c
bin/varnishd/cache/cache_http.c
+7
-7
cache_http1_proto.c
bin/varnishd/cache/cache_http1_proto.c
+8
-8
cache_vrt.c
bin/varnishd/cache/cache_vrt.c
+1
-1
cache_vrt_var.c
bin/varnishd/cache/cache_vrt_var.c
+3
-3
vsl_tags_http.h
include/tbl/vsl_tags_http.h
+1
-1
No files found.
bin/varnishd/cache/cache.h
View file @
d5affe57
...
...
@@ -984,7 +984,7 @@ void VGZ_WrwFlush(struct req *, struct vgz *vg);
unsigned
HTTP_estimate
(
unsigned
nhttp
);
void
HTTP_Copy
(
struct
http
*
to
,
const
struct
http
*
const
fm
);
struct
http
*
HTTP_create
(
void
*
p
,
uint16_t
nhttp
);
const
char
*
http_Status
Message
(
unsigned
);
const
char
*
http_Status
2Reason
(
unsigned
);
unsigned
http_EstimateWS
(
const
struct
http
*
fm
,
unsigned
how
,
uint16_t
*
nhd
);
void
HTTP_Init
(
void
);
void
http_PutResponse
(
struct
http
*
to
,
const
char
*
proto
,
uint16_t
status
,
...
...
bin/varnishd/cache/cache_http.c
View file @
d5affe57
...
...
@@ -116,7 +116,7 @@ static struct http_msg {
};
const
char
*
http_Status
Message
(
unsigned
status
)
http_Status
2Reason
(
unsigned
status
)
{
struct
http_msg
*
mp
;
...
...
@@ -568,7 +568,7 @@ http_ForceGet(const struct http *to)
void
http_PutResponse
(
struct
http
*
to
,
const
char
*
proto
,
uint16_t
status
,
const
char
*
re
sponse
)
const
char
*
re
ason
)
{
char
buf
[
4
];
...
...
@@ -583,9 +583,9 @@ http_PutResponse(struct http *to, const char *proto, uint16_t status,
to
->
status
=
status
;
bprintf
(
buf
,
"%03d"
,
status
%
1000
);
http_PutField
(
to
,
HTTP_HDR_STATUS
,
buf
);
if
(
re
sponse
==
NULL
)
re
sponse
=
http_StatusMessage
(
status
);
http_SetH
(
to
,
HTTP_HDR_RE
SPONSE
,
response
);
if
(
re
ason
==
NULL
)
re
ason
=
http_Status2Reason
(
status
);
http_SetH
(
to
,
HTTP_HDR_RE
ASON
,
reason
);
}
/*--------------------------------------------------------------------
...
...
@@ -689,7 +689,7 @@ http_FilterResp(const struct http *fm, struct http *to, unsigned how)
http_SetH
(
to
,
HTTP_HDR_PROTO
,
"HTTP/1.1"
);
to
->
status
=
fm
->
status
;
http_linkh
(
to
,
fm
,
HTTP_HDR_STATUS
);
http_linkh
(
to
,
fm
,
HTTP_HDR_RE
SPONSE
);
http_linkh
(
to
,
fm
,
HTTP_HDR_RE
ASON
);
http_filterfields
(
to
,
fm
,
how
);
}
...
...
@@ -708,7 +708,7 @@ http_Merge(const struct http *fm, struct http *to, int not_ce)
to
->
status
=
fm
->
status
;
http_SetH
(
to
,
HTTP_HDR_PROTO
,
fm
->
hd
[
HTTP_HDR_PROTO
].
b
);
http_SetH
(
to
,
HTTP_HDR_STATUS
,
fm
->
hd
[
HTTP_HDR_STATUS
].
b
);
http_SetH
(
to
,
HTTP_HDR_RE
SPONSE
,
fm
->
hd
[
HTTP_HDR_RESPONSE
].
b
);
http_SetH
(
to
,
HTTP_HDR_RE
ASON
,
fm
->
hd
[
HTTP_HDR_REASON
].
b
);
for
(
u
=
HTTP_HDR_FIRST
;
u
<
fm
->
nhd
;
u
++
)
fm
->
hdf
[
u
]
|=
HDF_MARKER
;
...
...
bin/varnishd/cache/cache_http1_proto.c
View file @
d5affe57
...
...
@@ -310,7 +310,7 @@ htc_splitline(struct http *hp, const struct http_conn *htc, int req)
}
else
{
h1
=
HTTP_HDR_PROTO
;
h2
=
HTTP_HDR_STATUS
;
h3
=
HTTP_HDR_RE
SPONSE
;
h3
=
HTTP_HDR_RE
ASON
;
}
/* Skip leading LWS */
...
...
@@ -493,13 +493,13 @@ HTTP1_DissectResponse(struct http *hp, const struct http_conn *htc)
}
else
htc_proto_ver
(
hp
);
if
(
hp
->
hd
[
HTTP_HDR_RE
SPONSE
].
b
==
NULL
||
!
Tlen
(
hp
->
hd
[
HTTP_HDR_RE
SPONSE
]))
{
if
(
hp
->
hd
[
HTTP_HDR_RE
ASON
].
b
==
NULL
||
!
Tlen
(
hp
->
hd
[
HTTP_HDR_RE
ASON
]))
{
/* Backend didn't send a response string, use the standard */
hp
->
hd
[
HTTP_HDR_RE
SPONSE
].
b
=
TRUST_ME
(
http_Status
Message
(
hp
->
status
));
hp
->
hd
[
HTTP_HDR_RE
SPONSE
].
e
=
strchr
(
hp
->
hd
[
HTTP_HDR_RE
SPONSE
].
b
,
'\0'
);
hp
->
hd
[
HTTP_HDR_RE
ASON
].
b
=
TRUST_ME
(
http_Status
2Reason
(
hp
->
status
));
hp
->
hd
[
HTTP_HDR_RE
ASON
].
e
=
strchr
(
hp
->
hd
[
HTTP_HDR_RE
ASON
].
b
,
'\0'
);
}
return
(
retval
);
}
...
...
@@ -523,7 +523,7 @@ HTTP1_Write(const struct worker *w, const struct http *hp, int resp)
l
+=
WRW_WriteH
(
w
,
&
hp
->
hd
[
HTTP_HDR_STATUS
],
" "
);
l
+=
WRW_WriteH
(
w
,
&
hp
->
hd
[
HTTP_HDR_RE
SPONSE
],
"
\r\n
"
);
l
+=
WRW_WriteH
(
w
,
&
hp
->
hd
[
HTTP_HDR_RE
ASON
],
"
\r\n
"
);
}
else
{
AN
(
hp
->
hd
[
HTTP_HDR_URL
].
b
);
l
=
WRW_WriteH
(
w
,
&
hp
->
hd
[
HTTP_HDR_METHOD
],
" "
);
...
...
bin/varnishd/cache/cache_vrt.c
View file @
d5affe57
...
...
@@ -63,7 +63,7 @@ VRT_error(const struct vrt_ctx *ctx, unsigned code, const char *reason)
code
=
503
;
ctx
->
req
->
err_code
=
(
uint16_t
)
code
;
ctx
->
req
->
err_reason
=
reason
?
reason
:
http_Status
Message
(
ctx
->
req
->
err_code
);
reason
?
reason
:
http_Status
2Reason
(
ctx
->
req
->
err_code
);
}
/*--------------------------------------------------------------------*/
...
...
bin/varnishd/cache/cache_vrt_var.c
View file @
d5affe57
...
...
@@ -122,11 +122,11 @@ VRT_HDR_LR(req, url, HTTP_HDR_URL)
VRT_HDR_LR
(
req
,
proto
,
HTTP_HDR_PROTO
)
VRT_HDR_R
(
obj
,
proto
,
HTTP_HDR_PROTO
)
VRT_HDR_R
(
obj
,
reason
,
HTTP_HDR_RE
SPONSE
)
VRT_HDR_R
(
obj
,
reason
,
HTTP_HDR_RE
ASON
)
VRT_STATUS_R
(
obj
)
VRT_HDR_LR
(
resp
,
proto
,
HTTP_HDR_PROTO
)
VRT_HDR_LR
(
resp
,
reason
,
HTTP_HDR_RE
SPONSE
)
VRT_HDR_LR
(
resp
,
reason
,
HTTP_HDR_RE
ASON
)
VRT_STATUS_L
(
resp
)
VRT_STATUS_R
(
resp
)
...
...
@@ -134,7 +134,7 @@ VRT_HDR_LR(bereq, method, HTTP_HDR_METHOD)
VRT_HDR_LR
(
bereq
,
url
,
HTTP_HDR_URL
)
VRT_HDR_LR
(
bereq
,
proto
,
HTTP_HDR_PROTO
)
VRT_HDR_LR
(
beresp
,
proto
,
HTTP_HDR_PROTO
)
VRT_HDR_LR
(
beresp
,
reason
,
HTTP_HDR_RE
SPONSE
)
VRT_HDR_LR
(
beresp
,
reason
,
HTTP_HDR_RE
ASON
)
VRT_STATUS_L
(
beresp
)
VRT_STATUS_R
(
beresp
)
...
...
include/tbl/vsl_tags_http.h
View file @
d5affe57
...
...
@@ -55,7 +55,7 @@ SLTH(Protocol, HTTP_HDR_PROTO, 1, 1, "protocol",
SLTH
(
Status
,
HTTP_HDR_STATUS
,
0
,
1
,
"status"
,
"The HTTP status code received.
\n\n
"
)
SLTH
(
Re
sponse
,
HTTP_HDR_RESPONSE
,
0
,
1
,
"response"
,
SLTH
(
Re
ason
,
HTTP_HDR_REASON
,
0
,
1
,
"response"
,
"The HTTP response string received.
\n\n
"
)
SLTH
(
Header
,
HTTP_HDR_FIRST
,
1
,
1
,
"header"
,
...
...
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