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
5b70451f
Commit
5b70451f
authored
Mar 22, 2017
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes to and better test-coverage of exception paths in H2 upgrade.
parent
42044142
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
13 deletions
+43
-13
cache_http2_proto.c
bin/varnishd/http2/cache_http2_proto.c
+0
-1
cache_http2_session.c
bin/varnishd/http2/cache_http2_session.c
+5
-7
t02000.vtc
bin/varnishtest/tests/t02000.vtc
+9
-1
t02001.vtc
bin/varnishtest/tests/t02001.vtc
+29
-4
No files found.
bin/varnishd/http2/cache_http2_proto.c
View file @
5b70451f
...
...
@@ -181,7 +181,6 @@ h2_del_req(struct worker *wrk, struct h2_req *r2)
Req_Release
(
r2
->
req
);
if
(
r
)
return
;
/* All streams gone, including stream #0, clean up */
req
=
h2
->
srq
;
Req_Cleanup
(
sp
,
wrk
,
req
);
...
...
bin/varnishd/http2/cache_http2_session.c
View file @
5b70451f
...
...
@@ -192,11 +192,12 @@ h2_b64url_settings(struct h2_sess *h2, struct req *req)
/**********************************************************************/
static
int
h2_ou_session
(
const
struct
worker
*
wrk
,
struct
h2_sess
*
h2
,
h2_ou_session
(
struct
worker
*
wrk
,
struct
h2_sess
*
h2
,
struct
req
*
req
)
{
ssize_t
sz
;
enum
htc_status_e
hs
;
struct
h2_req
*
r2
;
if
(
h2_b64url_settings
(
h2
,
req
))
{
VSLb
(
h2
->
vsl
,
SLT_Debug
,
"H2: Bad HTTP-Settings"
);
...
...
@@ -220,7 +221,7 @@ h2_ou_session(const struct worker *wrk, struct h2_sess *h2,
HTC_RxInit
(
h2
->
htc
,
h2
->
ws
);
/* Start req thread */
(
void
)
h2_new_req
(
wrk
,
h2
,
1
,
req
);
r2
=
h2_new_req
(
wrk
,
h2
,
1
,
req
);
req
->
req_step
=
R_STP_RECV
;
req
->
transport
=
&
H2_transport
;
req
->
req_step
=
R_STP_TRANSPORT
;
...
...
@@ -233,7 +234,8 @@ h2_ou_session(const struct worker *wrk, struct h2_sess *h2,
hs
=
HTC_RxStuff
(
h2
->
htc
,
H2_prism_complete
,
NULL
,
NULL
,
NAN
,
h2
->
sess
->
t_idle
+
cache_param
->
timeout_idle
,
256
);
if
(
hs
!=
HTC_S_COMPLETE
)
{
VSLb
(
h2
->
vsl
,
SLT_Debug
,
"H2: No OU PRISM (hs=%d)"
,
hs
);
VSLb
(
h2
->
vsl
,
SLT_Debug
,
"H2: No/Bad OU PRISM (hs=%d)"
,
hs
);
h2_del_req
(
wrk
,
r2
);
return
(
0
);
}
XXXAZ
(
Pool_Task
(
wrk
->
pool
,
&
req
->
task
,
TASK_QUEUE_REQ
));
...
...
@@ -285,11 +287,7 @@ h2_new_session(struct worker *wrk, void *arg)
h2
->
req0
=
h2_new_req
(
wrk
,
h2
,
0
,
NULL
);
if
(
req
->
err_code
==
H2_OU_MARKER
&&
!
h2_ou_session
(
wrk
,
h2
,
req
))
{
CNT_AcctLogCharge
(
wrk
->
stats
,
req
);
VCL_Rel
(
&
req
->
vcl
);
Req_Release
(
req
);
h2_del_req
(
wrk
,
h2
->
req0
);
SES_Delete
(
h2
->
sess
,
SC_RX_JUNK
,
NAN
);
return
;
}
assert
(
HTC_S_COMPLETE
==
H2_prism_complete
(
h2
->
htc
));
...
...
bin/varnishtest/tests/t02000.vtc
View file @
5b70451f
...
...
@@ -8,9 +8,17 @@ server s1 {
varnish v1 -vcl+backend {} -start
varnish v1 -cliok "param.set feature +http2"
varnish v1 -cliok "param.set debug +syncvsl"
varnish v1 -cliok "param.set feature -http2"
client c1 {
txpri
expect_close
} -run
varnish v1 -cliok "param.set feature +http2"
client c1 {
stream 1 {
txprio -weight 10 -stream 0
...
...
bin/varnishtest/tests/t02001.vtc
View file @
5b70451f
...
...
@@ -27,16 +27,41 @@ client c1 {
server s1 {
rxreq
expect req.url == /upgrade
expect req.url == /upgrade1
expect req.http.host == foo.bar
expect req.bodylen == 4
txresp -status 401 -bodylen 8
rxreq
expect req.url == /upgrade2
expect req.http.host == foo.bar
barrier b1 sync
txresp -status 40
1
-bodylen 11
txresp -status 40
2
-bodylen 11
} -start
delay .5
varnish v1 -cliok "param.set feature +http2"
# We don't support upgrades with body
client c1 {
send "POST /upgrade1 HTTP/1.1\r\n"
send "Host: foo.bar\r\n"
send "Upgrade: h2c\r\n"
send "HTTP2-Settings: AAMAAABkAAQAAP__\r\n"
send "Content-Length: 4\r\n"
send "\r\n"
send "FOO\n"
rxresp
expect resp.status == 401
expect resp.bodylen == 8
} -run
delay .5
client c1 {
send "GET /upgrade HTTP/1.1\r\n"
send "GET /upgrade
2
HTTP/1.1\r\n"
send "Host: foo.bar\r\n"
send "Upgrade: h2c\r\n"
send "HTTP2-Settings: AAMAAABkAAQAAP__\r\n"
...
...
@@ -56,7 +81,7 @@ client c1 {
barrier b1 sync
stream 1 {
rxresp
expect resp.status == 40
1
expect resp.status == 40
2
expect resp.bodylen == 11
} -run
} -run
...
...
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