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
71666a00
Commit
71666a00
authored
Nov 16, 2023
by
Dridi Boukelmoune
Committed by
Simon Stridsberg
Mar 18, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
http2: New send_goaway flag for errors
parent
57efc3b2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
52 additions
and
23 deletions
+52
-23
cache_http2.h
bin/varnishd/http2/cache_http2.h
+6
-4
cache_http2_proto.c
bin/varnishd/http2/cache_http2_proto.c
+22
-12
vtc_http2.c
bin/varnishtest/vtc_http2.c
+2
-2
h2_error.h
include/tbl/h2_error.h
+22
-5
No files found.
bin/varnishd/http2/cache_http2.h
View file @
71666a00
...
...
@@ -42,16 +42,18 @@ struct h2_error_s {
uint32_t
val
;
int
stream
;
int
connection
;
int
send_goaway
;
enum
sess_close
reason
;
};
typedef
const
struct
h2_error_s
*
h2_error
;
#define H2_CUSTOM_ERRORS
#define H2EC1(U,v,r,d) extern const struct h2_error_s H2CE_##U[1];
#define H2EC2(U,v,r,d) extern const struct h2_error_s H2SE_##U[1];
#define H2EC3(U,v,r,d) H2EC1(U,v,r,d) H2EC2(U,v,r,d)
#define H2_ERROR(NAME, val, sc, reason, desc) H2EC##sc(NAME, val, reason, desc)
#define H2EC1(U,v,g,r,d) extern const struct h2_error_s H2CE_##U[1];
#define H2EC2(U,v,g,r,d) extern const struct h2_error_s H2SE_##U[1];
#define H2EC3(U,v,g,r,d) H2EC1(U,v,g,r,d) H2EC2(U,v,g,r,d)
#define H2_ERROR(NAME, val, sc, goaway, reason, desc) \
H2EC##sc(NAME, val, goaway, reason, desc)
#include "tbl/h2_error.h"
#undef H2EC1
#undef H2EC2
...
...
bin/varnishd/http2/cache_http2_proto.c
View file @
71666a00
...
...
@@ -46,10 +46,13 @@
#include "vtim.h"
#define H2_CUSTOM_ERRORS
#define H2EC1(U,v,r,d) const struct h2_error_s H2CE_##U[1] = {{#U,d,v,0,1,r}};
#define H2EC2(U,v,r,d) const struct h2_error_s H2SE_##U[1] = {{#U,d,v,1,0,r}};
#define H2EC3(U,v,r,d) H2EC1(U,v,r,d) H2EC2(U,v,r,d)
#define H2_ERROR(NAME, val, sc, reason, desc) H2EC##sc(NAME, val, reason, desc)
#define H2EC1(U,v,g,r,d) \
const struct h2_error_s H2CE_##U[1] = {{#U,d,v,0,1,g,r}};
#define H2EC2(U,v,g,r,d) \
const struct h2_error_s H2SE_##U[1] = {{#U,d,v,1,0,g,r}};
#define H2EC3(U,v,g,r,d) H2EC1(U,v,g,r,d) H2EC2(U,v,g,r,d)
#define H2_ERROR(NAME, val, sc, goaway, reason, desc) \
H2EC##sc(NAME, val, goaway, reason, desc)
#include "tbl/h2_error.h"
#undef H2EC1
#undef H2EC2
...
...
@@ -61,6 +64,7 @@ static const struct h2_error_s H2NN_ERROR[1] = {{
0xffffffff
,
1
,
1
,
0
,
SC_RX_JUNK
}};
...
...
@@ -88,10 +92,11 @@ h2_framename(enum h2frame h2f)
*/
static
const
h2_error
stream_errors
[]
=
{
#define H2EC1(U,v,r,d)
#define H2EC2(U,v,r,d) [v] = H2SE_##U,
#define H2EC3(U,v,r,d) H2EC1(U,v,r,d) H2EC2(U,v,r,d)
#define H2_ERROR(NAME, val, sc, reason, desc) H2EC##sc(NAME, val, reason, desc)
#define H2EC1(U,v,g,r,d)
#define H2EC2(U,v,g,r,d) [v] = H2SE_##U,
#define H2EC3(U,v,g,r,d) H2EC1(U,v,g,r,d) H2EC2(U,v,g,r,d)
#define H2_ERROR(NAME, val, sc, goaway, reason, desc) \
H2EC##sc(NAME, val, goaway, reason, desc)
#include "tbl/h2_error.h"
#undef H2EC1
#undef H2EC2
...
...
@@ -113,10 +118,11 @@ h2_streamerror(uint32_t u)
*/
static
const
h2_error
conn_errors
[]
=
{
#define H2EC1(U,v,r,d) [v] = H2CE_##U,
#define H2EC2(U,v,r,d)
#define H2EC3(U,v,r,d) H2EC1(U,v,r,d) H2EC2(U,v,r,d)
#define H2_ERROR(NAME, val, sc, reason, desc) H2EC##sc(NAME, val, reason, desc)
#define H2EC1(U,v,g,r,d) [v] = H2CE_##U,
#define H2EC2(U,v,g,r,d)
#define H2EC3(U,v,g,r,d) H2EC1(U,v,g,r,d) H2EC2(U,v,g,r,d)
#define H2_ERROR(NAME, val, sc, goaway, reason, desc) \
H2EC##sc(NAME, val, goaway, reason, desc)
#include "tbl/h2_error.h"
#undef H2EC1
#undef H2EC2
...
...
@@ -1320,6 +1326,10 @@ h2_stream_tmo(struct h2_sess *h2, const struct h2_req *r2, vtim_real now)
if
(
isnan
(
now
))
AN
(
r2
->
t_winupd
);
if
(
h2
->
error
!=
NULL
&&
h2
->
error
->
connection
&&
!
h2
->
error
->
send_goaway
)
return
(
h2
->
error
);
if
(
r2
->
t_winupd
==
0
&&
r2
->
t_send
==
0
)
return
(
NULL
);
...
...
bin/varnishtest/vtc_http2.c
View file @
71666a00
...
...
@@ -51,7 +51,7 @@
#define BUF_SIZE (1024*2048)
static
const
char
*
const
h2_errs
[]
=
{
#define H2_ERROR(n,v,sc,r,t) [v] = #n,
#define H2_ERROR(n,v,sc,
g,
r,t) [v] = #n,
#include <tbl/h2_error.h>
NULL
};
...
...
@@ -1213,7 +1213,7 @@ cmd_var_resolve(const struct stream *s, const char *spec, char *buf)
else
return
(
NULL
);
}
#define H2_ERROR(U,v,sc,r,t) \
#define H2_ERROR(U,v,sc,
g,
r,t) \
if (!strcmp(spec, #U)) { return (#v); }
#include "tbl/h2_error.h"
return
(
spec
);
...
...
include/tbl/h2_error.h
View file @
71666a00
...
...
@@ -37,6 +37,7 @@ H2_ERROR(
/* name */
NO_ERROR
,
/* val */
0
,
/* types */
3
,
/* goaway */
1
,
/* reason */
SC_REM_CLOSE
,
/* descr */
"Graceful shutdown"
)
...
...
@@ -45,6 +46,7 @@ H2_ERROR(
/* name */
PROTOCOL_ERROR
,
/* val */
1
,
/* types */
3
,
/* goaway */
1
,
/* reason */
SC_RX_JUNK
,
/* descr */
"Protocol error detected"
)
...
...
@@ -53,6 +55,7 @@ H2_ERROR(
/* name */
INTERNAL_ERROR
,
/* val */
2
,
/* types */
3
,
/* goaway */
1
,
/* reason */
SC_VCL_FAILURE
,
/* descr */
"Implementation fault"
)
...
...
@@ -61,6 +64,7 @@ H2_ERROR(
/* name */
FLOW_CONTROL_ERROR
,
/* val */
3
,
/* types */
3
,
/* goaway */
1
,
/* reason */
SC_OVERLOAD
,
/* descr */
"Flow-control limits exceeded"
)
...
...
@@ -69,6 +73,7 @@ H2_ERROR(
/* name */
SETTINGS_TIMEOUT
,
/* val */
4
,
/* types */
1
,
/* goaway */
1
,
/* reason */
SC_RX_TIMEOUT
,
/* descr */
"Settings not acknowledged"
)
...
...
@@ -77,6 +82,7 @@ H2_ERROR(
/* name */
STREAM_CLOSED
,
/* val */
5
,
/* types */
2
,
/* goaway */
1
,
/* reason */
SC_NULL
,
/* descr */
"Frame received for closed stream"
)
...
...
@@ -85,6 +91,7 @@ H2_ERROR(
/* name */
FRAME_SIZE_ERROR
,
/* val */
6
,
/* types */
3
,
/* goaway */
1
,
/* reason */
SC_RX_JUNK
,
/* descr */
"Frame size incorrect"
)
...
...
@@ -93,6 +100,7 @@ H2_ERROR(
/* name */
REFUSED_STREAM
,
/* val */
7
,
/* types */
2
,
/* goaway */
1
,
/* reason */
SC_NULL
,
/* descr */
"Stream not processed"
)
...
...
@@ -101,6 +109,7 @@ H2_ERROR(
/* name */
CANCEL
,
/* val */
8
,
/* types */
2
,
/* goaway */
1
,
/* reason */
SC_NULL
,
/* descr */
"Stream cancelled"
)
...
...
@@ -109,6 +118,7 @@ H2_ERROR(
/* name */
COMPRESSION_ERROR
,
/* val */
9
,
/* types */
1
,
/* goaway */
1
,
/* reason */
SC_RX_JUNK
,
/* descr */
"Compression state not updated"
)
...
...
@@ -117,6 +127,7 @@ H2_ERROR(
/* name */
CONNECT_ERROR
,
/* val */
10
,
/* types */
2
,
/* goaway */
1
,
/* reason */
SC_NULL
,
/* descr */
"TCP connection error for CONNECT method"
)
...
...
@@ -125,6 +136,7 @@ H2_ERROR(
/* name */
ENHANCE_YOUR_CALM
,
/* val */
11
,
/* types */
3
,
/* goaway */
1
,
/* reason */
SC_OVERLOAD
,
/* descr */
"Processing capacity exceeded"
)
...
...
@@ -133,6 +145,7 @@ H2_ERROR(
/* name */
INADEQUATE_SECURITY
,
/* val */
12
,
/* types */
1
,
/* goaway */
1
,
/* reason */
SC_RX_JUNK
,
/* descr */
"Negotiated TLS parameters not acceptable"
)
...
...
@@ -141,23 +154,26 @@ H2_ERROR(
/* name */
HTTP_1_1_REQUIRED
,
/* val */
13
,
/* types */
1
,
/* goaway */
1
,
/* reason */
SC_REQ_HTTP20
,
/* descr */
"Use HTTP/1.1 for the request"
)
#ifdef H2_CUSTOM_ERRORS
H2_ERROR
(
/* name */
RAPID_RESET
,
/* val */
11
,
/* ENHANCE_YOUR_CALM */
/* types */
1
,
/* reason */
SC_RAPID_RESET
,
/* descr */
"http/2 rapid reset detected"
/* name */
RAPID_RESET
,
/* val */
11
,
/* ENHANCE_YOUR_CALM */
/* types */
1
,
/* goaway */
1
,
/* reason */
SC_RAPID_RESET
,
/* descr */
"http/2 rapid reset detected"
)
H2_ERROR
(
/* name */
BROKE_WINDOW
,
/* val */
8
,
/* CANCEL */
/* types */
2
,
/* goaway */
0
,
/* reason */
SC_NULL
,
/* descr */
"http/2 stream out of window credits"
)
...
...
@@ -166,6 +182,7 @@ H2_ERROR(
/* name */
BANKRUPT
,
/* val */
11
,
/* ENHANCE_YOUR_CALM */
/* types */
1
,
/* goaway */
0
,
/* reason */
SC_BANKRUPT
,
/* descr */
"http/2 bankrupt connection"
)
...
...
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