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
948f3fc1
Commit
948f3fc1
authored
Mar 28, 2024
by
Dridi Boukelmoune
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
http2_hpack: New custom h2 error for http_req_size
parent
b6764e83
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
7 deletions
+17
-7
cache_http2_hpack.c
bin/varnishd/http2/cache_http2_hpack.c
+8
-7
h2_error.h
include/tbl/h2_error.h
+9
-0
No files found.
bin/varnishd/http2/cache_http2_hpack.c
View file @
948f3fc1
...
@@ -343,7 +343,8 @@ h2h_decode_bytes(struct h2_sess *h2, const uint8_t *in, size_t in_l)
...
@@ -343,7 +343,8 @@ h2h_decode_bytes(struct h2_sess *h2, const uint8_t *in, size_t in_l)
/* Only H2E_ENHANCE_YOUR_CALM indicates that we should continue
/* Only H2E_ENHANCE_YOUR_CALM indicates that we should continue
processing. Other errors should have been returned and handled
processing. Other errors should have been returned and handled
by the caller. */
by the caller. */
assert
(
d
->
error
==
0
||
d
->
error
==
H2SE_ENHANCE_YOUR_CALM
);
if
(
d
->
error
!=
NULL
)
assert
(
H2_ERROR_MATCH
(
d
->
error
,
H2SE_ENHANCE_YOUR_CALM
));
while
(
1
)
{
while
(
1
)
{
AN
(
d
->
out
);
AN
(
d
->
out
);
...
@@ -362,7 +363,7 @@ h2h_decode_bytes(struct h2_sess *h2, const uint8_t *in, size_t in_l)
...
@@ -362,7 +363,7 @@ h2h_decode_bytes(struct h2_sess *h2, const uint8_t *in, size_t in_l)
break
;
break
;
}
}
if
(
d
->
error
==
H2SE_ENHANCE_YOUR_CALM
)
{
if
(
H2_ERROR_MATCH
(
d
->
error
,
H2SE_ENHANCE_YOUR_CALM
)
)
{
d
->
out_u
=
0
;
d
->
out_u
=
0
;
assert
(
d
->
out_u
<
d
->
out_l
);
assert
(
d
->
out_u
<
d
->
out_l
);
continue
;
continue
;
...
@@ -374,7 +375,7 @@ h2h_decode_bytes(struct h2_sess *h2, const uint8_t *in, size_t in_l)
...
@@ -374,7 +375,7 @@ h2h_decode_bytes(struct h2_sess *h2, const uint8_t *in, size_t in_l)
case
VHD_NAME
:
case
VHD_NAME
:
assert
(
d
->
namelen
==
0
);
assert
(
d
->
namelen
==
0
);
if
(
d
->
out_l
-
d
->
out_u
<
2
)
{
if
(
d
->
out_l
-
d
->
out_u
<
2
)
{
d
->
error
=
H2SE_
ENHANCE_YOUR_CALM
;
d
->
error
=
H2SE_
REQ_SIZE
;
break
;
break
;
}
}
d
->
out
[
d
->
out_u
++
]
=
':'
;
d
->
out
[
d
->
out_u
++
]
=
':'
;
...
@@ -387,7 +388,7 @@ h2h_decode_bytes(struct h2_sess *h2, const uint8_t *in, size_t in_l)
...
@@ -387,7 +388,7 @@ h2h_decode_bytes(struct h2_sess *h2, const uint8_t *in, size_t in_l)
case
VHD_VALUE
:
case
VHD_VALUE
:
assert
(
d
->
namelen
>
0
);
assert
(
d
->
namelen
>
0
);
if
(
d
->
out_l
-
d
->
out_u
<
1
)
{
if
(
d
->
out_l
-
d
->
out_u
<
1
)
{
d
->
error
=
H2SE_
ENHANCE_YOUR_CALM
;
d
->
error
=
H2SE_
REQ_SIZE
;
break
;
break
;
}
}
d
->
error
=
h2h_addhdr
(
hp
,
d
);
d
->
error
=
h2h_addhdr
(
hp
,
d
);
...
@@ -401,7 +402,7 @@ h2h_decode_bytes(struct h2_sess *h2, const uint8_t *in, size_t in_l)
...
@@ -401,7 +402,7 @@ h2h_decode_bytes(struct h2_sess *h2, const uint8_t *in, size_t in_l)
break
;
break
;
case
VHD_BUF
:
case
VHD_BUF
:
d
->
error
=
H2SE_
ENHANCE_YOUR_CALM
;
d
->
error
=
H2SE_
REQ_SIZE
;
break
;
break
;
default:
default:
...
@@ -409,7 +410,7 @@ h2h_decode_bytes(struct h2_sess *h2, const uint8_t *in, size_t in_l)
...
@@ -409,7 +410,7 @@ h2h_decode_bytes(struct h2_sess *h2, const uint8_t *in, size_t in_l)
break
;
break
;
}
}
if
(
d
->
error
==
H2SE_ENHANCE_YOUR_CALM
)
{
if
(
H2_ERROR_MATCH
(
d
->
error
,
H2SE_ENHANCE_YOUR_CALM
)
)
{
d
->
out
=
d
->
reset
;
d
->
out
=
d
->
reset
;
d
->
out_l
=
e
-
d
->
out
;
d
->
out_l
=
e
-
d
->
out
;
d
->
out_u
=
0
;
d
->
out_u
=
0
;
...
@@ -418,7 +419,7 @@ h2h_decode_bytes(struct h2_sess *h2, const uint8_t *in, size_t in_l)
...
@@ -418,7 +419,7 @@ h2h_decode_bytes(struct h2_sess *h2, const uint8_t *in, size_t in_l)
break
;
break
;
}
}
if
(
d
->
error
==
H2SE_ENHANCE_YOUR_CALM
)
if
(
H2_ERROR_MATCH
(
d
->
error
,
H2SE_ENHANCE_YOUR_CALM
)
)
return
(
0
);
/* Stream error, delay reporting until
return
(
0
);
/* Stream error, delay reporting until
h2h_decode_fini so that we can process the
h2h_decode_fini so that we can process the
complete header block */
complete header block */
...
...
include/tbl/h2_error.h
View file @
948f3fc1
...
@@ -197,6 +197,15 @@ H2_ERROR(
...
@@ -197,6 +197,15 @@ H2_ERROR(
/* reason */
SC_BANKRUPT
,
/* reason */
SC_BANKRUPT
,
/* descr */
"http/2 bankrupt connection"
/* descr */
"http/2 bankrupt connection"
)
)
H2_ERROR
(
/* name */
REQ_SIZE
,
/* val */
11
,
/* ENHANCE_YOUR_CALM */
/* types */
2
,
/* goaway */
0
,
/* reason */
SC_NULL
,
/* descr */
"HTTP/2 header list exceeded http_req_size"
)
# undef H2_CUSTOM_ERRORS
# undef H2_CUSTOM_ERRORS
#endif
#endif
...
...
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