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
57adab3d
Commit
57adab3d
authored
Apr 05, 2016
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Eliminate the maxhdr field from struct http_conn
parent
5a8ec687
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
9 deletions
+10
-9
cache.h
bin/varnishd/cache/cache.h
+0
-1
cache_http1_proto.c
bin/varnishd/http1/cache_http1_proto.c
+10
-8
No files found.
bin/varnishd/cache/cache.h
View file @
57adab3d
...
...
@@ -225,7 +225,6 @@ struct http_conn {
int
fd
;
enum
sess_close
doclose
;
unsigned
maxbytes
;
unsigned
maxhdr
;
enum
body_status
body_status
;
struct
ws
*
ws
;
char
*
rxbuf_b
;
...
...
bin/varnishd/http1/cache_http1_proto.c
View file @
57adab3d
...
...
@@ -106,7 +106,8 @@ HTTP1_Complete(struct http_conn *htc)
*/
static
uint16_t
http1_dissect_hdrs
(
struct
http
*
hp
,
char
*
p
,
struct
http_conn
*
htc
)
http1_dissect_hdrs
(
struct
http
*
hp
,
char
*
p
,
struct
http_conn
*
htc
,
unsigned
maxhdr
)
{
char
*
q
,
*
r
;
...
...
@@ -147,7 +148,7 @@ http1_dissect_hdrs(struct http *hp, char *p, struct http_conn *htc)
*
q
++
=
' '
;
}
if
(
q
-
p
>
htc
->
maxhdr
)
{
if
(
q
-
p
>
maxhdr
)
{
VSLb
(
hp
->
vsl
,
SLT_BogoHeader
,
"Header too long: %.*s"
,
(
int
)(
q
-
p
>
20
?
20
:
q
-
p
),
p
);
return
(
400
);
...
...
@@ -205,7 +206,8 @@ http1_dissect_hdrs(struct http *hp, char *p, struct http_conn *htc)
*/
static
uint16_t
http1_splitline
(
struct
http
*
hp
,
struct
http_conn
*
htc
,
const
int
*
hf
)
http1_splitline
(
struct
http
*
hp
,
struct
http_conn
*
htc
,
const
int
*
hf
,
unsigned
maxhdr
)
{
char
*
p
;
int
i
;
...
...
@@ -271,7 +273,7 @@ http1_splitline(struct http *hp, struct http_conn *htc, const int *hf)
*
p
=
'\0'
;
p
+=
i
;
return
(
http1_dissect_hdrs
(
hp
,
p
,
htc
));
return
(
http1_dissect_hdrs
(
hp
,
p
,
htc
,
maxhdr
));
}
/*--------------------------------------------------------------------*/
...
...
@@ -349,8 +351,8 @@ HTTP1_DissectRequest(struct http_conn *htc, struct http *hp)
CHECK_OBJ_NOTNULL
(
htc
,
HTTP_CONN_MAGIC
);
CHECK_OBJ_NOTNULL
(
hp
,
HTTP_MAGIC
);
htc
->
maxhdr
=
cache_param
->
http_req_hdr_len
;
retval
=
http1_splitline
(
hp
,
htc
,
HTTP1_Req
);
retval
=
http1_splitline
(
hp
,
htc
,
HTTP1_Req
,
cache_param
->
http_req_hdr_len
);
if
(
retval
!=
0
)
return
(
retval
);
hp
->
protover
=
http1_proto_ver
(
hp
);
...
...
@@ -415,8 +417,8 @@ HTTP1_DissectResponse(struct http_conn *htc, struct http *hp,
CHECK_OBJ_NOTNULL
(
hp
,
HTTP_MAGIC
);
CHECK_OBJ_NOTNULL
(
req
,
HTTP_MAGIC
);
htc
->
maxhdr
=
cache_param
->
http_resp_hdr_len
;
if
(
http1_splitline
(
hp
,
htc
,
HTTP1_Resp
))
if
(
http1_splitline
(
hp
,
htc
,
HTTP1_Resp
,
cache_param
->
http_resp_hdr_len
))
retval
=
503
;
if
(
retval
==
0
)
{
...
...
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