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
bdf117b9
Commit
bdf117b9
authored
Feb 17, 2017
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More error-handling work
parent
9a13765b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
7 deletions
+23
-7
cache_http2.h
bin/varnishd/http2/cache_http2.h
+1
-0
cache_http2_proto.c
bin/varnishd/http2/cache_http2_proto.c
+22
-7
No files found.
bin/varnishd/http2/cache_http2.h
View file @
bdf117b9
...
@@ -94,6 +94,7 @@ struct h2_sess {
...
@@ -94,6 +94,7 @@ struct h2_sess {
struct
sess
*
sess
;
struct
sess
*
sess
;
int
refcnt
;
int
refcnt
;
uint32_t
highest_stream
;
uint32_t
highest_stream
;
int
bogosity
;
struct
h2_req_s
streams
;
struct
h2_req_s
streams
;
...
...
bin/varnishd/http2/cache_http2_proto.c
View file @
bdf117b9
...
@@ -528,34 +528,49 @@ h2_procframe(struct worker *wrk, struct h2_sess *h2)
...
@@ -528,34 +528,49 @@ h2_procframe(struct worker *wrk, struct h2_sess *h2)
h2_error
h2e
;
h2_error
h2e
;
if
(
h2
->
rxf_stream
!=
0
&&
!
(
h2
->
rxf_stream
&
1
))
{
if
(
h2
->
rxf_stream
!=
0
&&
!
(
h2
->
rxf_stream
&
1
))
{
/*
We don't do push, so all streams must be zero or odd#
*/
/*
No even streams, we don't do PUSH_PROMISE
*/
VSLb
(
h2
->
vsl
,
SLT_Debug
,
"H2: illegal stream (=%u)"
,
VSLb
(
h2
->
vsl
,
SLT_Debug
,
"H2: illegal stream (=%u)"
,
h2
->
rxf_stream
);
h2
->
rxf_stream
);
return
(
0
);
return
(
H2CE_PROTOCOL_ERROR
);
// rfc7540 5.1.1
}
}
VTAILQ_FOREACH
(
r2
,
&
h2
->
streams
,
list
)
VTAILQ_FOREACH
(
r2
,
&
h2
->
streams
,
list
)
if
(
r2
->
stream
==
h2
->
rxf_stream
)
if
(
r2
->
stream
==
h2
->
rxf_stream
)
break
;
break
;
if
(
r2
==
NULL
)
{
if
(
r2
==
NULL
)
{
xxxassert
(
h2
->
rxf_stream
>
h2
->
highest_stream
);
if
(
h2
->
rxf_stream
<=
h2
->
highest_stream
)
return
(
H2CE_PROTOCOL_ERROR
);
// rfc7540 5.1.1
h2
->
highest_stream
=
h2
->
rxf_stream
;
h2
->
highest_stream
=
h2
->
rxf_stream
;
r2
=
h2_new_req
(
wrk
,
h2
,
h2
->
rxf_stream
,
NULL
);
r2
=
h2_new_req
(
wrk
,
h2
,
h2
->
rxf_stream
,
NULL
);
AN
(
r2
);
}
}
if
(
h2
->
htc
->
rxbuf_b
[
3
]
>=
H2FMAX
)
{
if
(
h2
->
htc
->
rxbuf_b
[
3
]
>=
H2FMAX
)
{
h2
->
bogosity
++
;
VSLb
(
h2
->
vsl
,
SLT_Debug
,
VSLb
(
h2
->
vsl
,
SLT_Debug
,
"H2: Unknown Frame
%d
"
,
h2
->
htc
->
rxbuf_b
[
3
]);
"H2: Unknown Frame
0x%02x
"
,
h2
->
htc
->
rxbuf_b
[
3
]);
return
(
0
);
return
(
0
);
// rfc7540 4.1
}
}
h2f
=
h2flist
+
h2
->
htc
->
rxbuf_b
[
3
];
h2f
=
h2flist
+
h2
->
htc
->
rxbuf_b
[
3
];
AN
(
h2f
->
name
);
if
(
h2f
->
name
==
NULL
||
h2f
->
func
==
NULL
)
{
h2
->
bogosity
++
;
VSLb
(
h2
->
vsl
,
SLT_Debug
,
"H2: Unimplemented Frame 0x%02x"
,
h2
->
htc
->
rxbuf_b
[
3
]);
return
(
0
);
// rfc7540 4.1
}
if
(
h2
->
rxf_flags
&
~
h2f
->
flags
)
{
if
(
h2
->
rxf_flags
&
~
h2f
->
flags
)
{
h2
->
bogosity
++
;
VSLb
(
h2
->
vsl
,
SLT_Debug
,
"H2: Bad flags 0x%02x on %s"
,
VSLb
(
h2
->
vsl
,
SLT_Debug
,
"H2: Bad flags 0x%02x on %s"
,
h2
->
rxf_flags
,
h2f
->
name
);
h2
->
rxf_flags
,
h2f
->
name
);
return
(
0
);
h2
->
rxf_flags
&=
h2f
->
flags
;
// rfc7540 4.1
}
}
h2e
=
h2f
->
func
(
wrk
,
h2
,
r2
);
h2e
=
h2f
->
func
(
wrk
,
h2
,
r2
);
if
(
h2e
==
0
)
return
(
0
);
if
(
h2
->
rxf_stream
==
0
||
h2e
->
connection
)
return
(
h2e
);
// Connection errors one level up
/* XXX handle stream error */
XXXAZ
(
h2e
);
XXXAZ
(
h2e
);
return
(
0
);
return
(
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