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
7144af0e
Commit
7144af0e
authored
Feb 17, 2017
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More compact H2 error names
parent
a62435b3
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
22 deletions
+22
-22
cache_http2.h
bin/varnishd/http2/cache_http2.h
+2
-2
cache_http2_hpack.c
bin/varnishd/http2/cache_http2_hpack.c
+16
-16
cache_http2_proto.c
bin/varnishd/http2/cache_http2_proto.c
+4
-4
No files found.
bin/varnishd/http2/cache_http2.h
View file @
7144af0e
...
...
@@ -42,8 +42,8 @@ struct h2_error_s {
typedef
const
struct
h2_error_s
*
h2_error
;
#define H2EC0(U,v,d)
#define H2EC1(U,v,d) extern const struct h2_error_s H2
E_C
_##U[1];
#define H2EC2(U,v,d) extern const struct h2_error_s H2
E_S
_##U[1];
#define H2EC1(U,v,d) extern const struct h2_error_s H2
CE
_##U[1];
#define H2EC2(U,v,d) extern const struct h2_error_s H2
SE
_##U[1];
#define H2EC3(U,v,d) H2EC1(U,v,d) H2EC2(U,v,d)
#define H2_ERROR(NAME, val, sc, desc) H2EC##sc(NAME, val, desc)
#include "tbl/h2_error.h"
...
...
bin/varnishd/http2/cache_http2_hpack.c
View file @
7144af0e
...
...
@@ -49,7 +49,7 @@ h2h_checkhdr(const struct http *hp, const char *b, size_t namelen, size_t len)
if
(
namelen
==
2
)
{
VSLb
(
hp
->
vsl
,
SLT_BogoHeader
,
"Empty name"
);
return
(
H2
E_C
_PROTOCOL_ERROR
);
return
(
H2
CE
_PROTOCOL_ERROR
);
}
for
(
p
=
b
;
p
<
b
+
len
;
p
++
)
{
...
...
@@ -64,7 +64,7 @@ h2h_checkhdr(const struct http *hp, const char *b, size_t namelen, size_t len)
VSLb
(
hp
->
vsl
,
SLT_BogoHeader
,
"Illegal header name: %.*s"
,
(
int
)(
len
>
20
?
20
:
len
),
b
);
return
(
H2
E_C
_PROTOCOL_ERROR
);
return
(
H2
CE
_PROTOCOL_ERROR
);
}
else
if
(
p
<
b
+
namelen
)
{
/* ': ' added by us */
assert
(
*
p
==
':'
||
*
p
==
' '
);
...
...
@@ -75,7 +75,7 @@ h2h_checkhdr(const struct http *hp, const char *b, size_t namelen, size_t len)
VSLb
(
hp
->
vsl
,
SLT_BogoHeader
,
"Illegal header value: %.*s"
,
(
int
)(
len
>
20
?
20
:
len
),
b
);
return
(
H2
E_C
_PROTOCOL_ERROR
);
return
(
H2
CE
_PROTOCOL_ERROR
);
}
}
...
...
@@ -95,7 +95,7 @@ h2h_addhdr(struct http *hp, char *b, size_t namelen, size_t len)
if
(
len
>
UINT_MAX
)
{
/* XXX: cache_param max header size */
VSLb
(
hp
->
vsl
,
SLT_BogoHeader
,
"Header too large: %.20s"
,
b
);
return
(
H2
E_S
_ENHANCE_YOUR_CALM
);
return
(
H2
SE
_ENHANCE_YOUR_CALM
);
}
if
(
b
[
0
]
==
':'
)
{
...
...
@@ -127,7 +127,7 @@ h2h_addhdr(struct http *hp, char *b, size_t namelen, size_t len)
VSLb
(
hp
->
vsl
,
SLT_BogoHeader
,
"Unknown pseudo-header: %.*s"
,
(
int
)(
len
>
20
?
20
:
len
),
b
);
return
(
H2
E_S
_PROTOCOL_ERROR
);
return
(
H2
SE
_PROTOCOL_ERROR
);
}
}
else
n
=
hp
->
nhd
;
...
...
@@ -138,14 +138,14 @@ h2h_addhdr(struct http *hp, char *b, size_t namelen, size_t len)
VSLb
(
hp
->
vsl
,
SLT_BogoHeader
,
"Duplicate pseudo-header: %.*s"
,
(
int
)(
len
>
20
?
20
:
len
),
b
);
return
(
H2
E_S
_PROTOCOL_ERROR
);
return
(
H2
SE
_PROTOCOL_ERROR
);
}
}
else
{
/* Check for space in struct http */
if
(
n
>=
hp
->
shd
)
{
VSLb
(
hp
->
vsl
,
SLT_LostHeader
,
"Too many headers: %.*s"
,
(
int
)(
len
>
20
?
20
:
len
),
b
);
return
(
H2
E_S
_ENHANCE_YOUR_CALM
);
return
(
H2
SE
_ENHANCE_YOUR_CALM
);
}
hp
->
nhd
++
;
}
...
...
@@ -195,7 +195,7 @@ h2h_decode_fini(const struct h2_sess *h2, struct h2h_decode *d)
boundary */
VSLb
(
h2
->
new_req
->
http
->
vsl
,
SLT_BogoHeader
,
"HPACK compression error (%s)"
,
VHD_Error
(
d
->
vhd_ret
));
ret
=
H2
E_C
_COMPRESSION_ERROR
;
ret
=
H2
CE
_COMPRESSION_ERROR
;
}
else
ret
=
d
->
error
;
d
->
magic
=
0
;
...
...
@@ -227,7 +227,7 @@ h2h_decode_bytes(struct h2_sess *h2, struct h2h_decode *d,
/* Only H2E_ENHANCE_YOUR_CALM indicates that we should continue
processing. Other errors should have been returned and handled
by the caller. */
assert
(
d
->
error
==
0
||
d
->
error
==
H2
E_S
_ENHANCE_YOUR_CALM
);
assert
(
d
->
error
==
0
||
d
->
error
==
H2
SE
_ENHANCE_YOUR_CALM
);
while
(
1
)
{
AN
(
d
->
out
);
...
...
@@ -239,14 +239,14 @@ h2h_decode_bytes(struct h2_sess *h2, struct h2h_decode *d,
VSLb
(
hp
->
vsl
,
SLT_BogoHeader
,
"HPACK compression error (%s)"
,
VHD_Error
(
d
->
vhd_ret
));
d
->
error
=
H2
E_C
_COMPRESSION_ERROR
;
d
->
error
=
H2
CE
_COMPRESSION_ERROR
;
break
;
}
else
if
(
d
->
vhd_ret
==
VHD_OK
||
d
->
vhd_ret
==
VHD_MORE
)
{
assert
(
in_u
==
in_l
);
break
;
}
if
(
d
->
error
==
H2
E_S
_ENHANCE_YOUR_CALM
)
{
if
(
d
->
error
==
H2
SE
_ENHANCE_YOUR_CALM
)
{
d
->
out_u
=
0
;
assert
(
d
->
out_u
<
d
->
out_l
);
continue
;
...
...
@@ -258,7 +258,7 @@ h2h_decode_bytes(struct h2_sess *h2, struct h2h_decode *d,
case
VHD_NAME
:
assert
(
d
->
namelen
==
0
);
if
(
d
->
out_l
-
d
->
out_u
<
2
)
{
d
->
error
=
H2
E_S
_ENHANCE_YOUR_CALM
;
d
->
error
=
H2
SE
_ENHANCE_YOUR_CALM
;
break
;
}
d
->
out
[
d
->
out_u
++
]
=
':'
;
...
...
@@ -271,7 +271,7 @@ h2h_decode_bytes(struct h2_sess *h2, struct h2h_decode *d,
case
VHD_VALUE
:
assert
(
d
->
namelen
>
0
);
if
(
d
->
out_l
-
d
->
out_u
<
1
)
{
d
->
error
=
H2
E_S
_ENHANCE_YOUR_CALM
;
d
->
error
=
H2
SE
_ENHANCE_YOUR_CALM
;
break
;
}
d
->
error
=
h2h_checkhdr
(
hp
,
d
->
out
,
d
->
namelen
,
...
...
@@ -289,7 +289,7 @@ h2h_decode_bytes(struct h2_sess *h2, struct h2h_decode *d,
break
;
case
VHD_BUF
:
d
->
error
=
H2
E_S
_ENHANCE_YOUR_CALM
;
d
->
error
=
H2
SE
_ENHANCE_YOUR_CALM
;
break
;
default:
...
...
@@ -297,7 +297,7 @@ h2h_decode_bytes(struct h2_sess *h2, struct h2h_decode *d,
break
;
}
if
(
d
->
error
==
H2
E_S
_ENHANCE_YOUR_CALM
)
{
if
(
d
->
error
==
H2
SE
_ENHANCE_YOUR_CALM
)
{
http_Teardown
(
hp
);
d
->
out
=
d
->
reset
;
d
->
out_l
=
hp
->
ws
->
r
-
d
->
out
;
...
...
@@ -307,7 +307,7 @@ h2h_decode_bytes(struct h2_sess *h2, struct h2h_decode *d,
break
;
}
if
(
d
->
error
==
H2
E_S
_ENHANCE_YOUR_CALM
)
if
(
d
->
error
==
H2
SE
_ENHANCE_YOUR_CALM
)
return
(
0
);
/* Stream error, delay reporting until
h2h_decode_fini so that we can process the
complete header block */
...
...
bin/varnishd/http2/cache_http2_proto.c
View file @
7144af0e
...
...
@@ -41,8 +41,8 @@
#include "vtim.h"
#define H2EC0(U,v,d)
#define H2EC1(U,v,d) const struct h2_error_s H2
E_C
_##U[1] = {{#U,d,v,0,1}};
#define H2EC2(U,v,d) const struct h2_error_s H2
E_S
_##U[1] = {{#U,d,v,1,0}};
#define H2EC1(U,v,d) const struct h2_error_s H2
CE
_##U[1] = {{#U,d,v,0,1}};
#define H2EC2(U,v,d) const struct h2_error_s H2
SE
_##U[1] = {{#U,d,v,1,0}};
#define H2EC3(U,v,d) H2EC1(U,v,d) H2EC2(U,v,d)
#define H2_ERROR(NAME, val, sc, desc) H2EC##sc(NAME, val, desc)
#include "tbl/h2_error.h"
...
...
@@ -394,7 +394,7 @@ h2_do_req(struct worker *wrk, void *priv)
VSL
(
SLT_Debug
,
0
,
"H2REQ CNT done"
);
/* XXX clean up req */
r2
->
state
=
H2_S_CLOSED
;
h2_del_req
(
wrk
,
r2
,
H2
E_S
_NO_ERROR
);
h2_del_req
(
wrk
,
r2
,
H2
SE
_NO_ERROR
);
}
void
__match_proto__
(
h2_frame_f
)
...
...
@@ -765,7 +765,7 @@ h2_new_session(struct worker *wrk, void *arg)
/* Delete all idle streams */
VTAILQ_FOREACH_SAFE
(
r2
,
&
h2
->
streams
,
list
,
r22
)
{
if
(
r2
->
state
==
H2_S_IDLE
)
h2_del_req
(
wrk
,
r2
,
H2
E_S
_NO_ERROR
);
h2_del_req
(
wrk
,
r2
,
H2
SE
_NO_ERROR
);
}
}
...
...
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