Commit 77cab367 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Start hammering away on H2 again

parent a6696fc0
......@@ -400,7 +400,6 @@ h2_rx_headers(struct worker *wrk, struct h2_sess *h2, struct h2_req *r2)
* read frames and proper error handling.
*/
xxxassert(h2->rxf_stream & 1);
xxxassert(r2->state == H2_S_IDLE);
r2->state = H2_S_OPEN;
......@@ -429,7 +428,11 @@ h2_rx_headers(struct worker *wrk, struct h2_sess *h2, struct h2_req *r2)
/* XXX: Error handling */
p = h2->rxf_data;
l = h2->rxf_len;
if (h2->rxf_flags & 0x20) {
if (h2->rxf_flags & H2FF_HEADERS_PADDED) {
l -= 1 + *p;
p += 1;
}
if (h2->rxf_flags & H2FF_HEADERS_PRIORITY) {
p += 5;
l -= 5;
}
......@@ -518,6 +521,15 @@ h2_rxframe(struct worker *wrk, struct h2_sess *h2)
h2_vsl_frame(h2, h2->htc->rxbuf_b, 9L + h2->rxf_len);
if (h2->rxf_stream != 0 && !(h2->rxf_stream & 1)) {
/* We don't do push, so all streams must be zero or odd# */
Lck_Lock(&h2->sess->mtx);
VSLb(h2->vsl, SLT_Debug, "H2: illegal stream (=%u)",
h2->rxf_stream);
Lck_Unlock(&h2->sess->mtx);
return (0);
}
Lck_Lock(&h2->sess->mtx);
VTAILQ_FOREACH(r2, &h2->streams, list)
if (r2->stream == h2->rxf_stream)
......@@ -544,7 +556,10 @@ h2_rxframe(struct worker *wrk, struct h2_sess *h2)
break;
#include "tbl/h2_frames.h"
default:
INCOMPL();
VSLb(h2->vsl, SLT_Debug, "H2: Bad frame type 0x%02x on ",
h2->htc->rxbuf_b[3]);
Lck_Unlock(&h2->sess->mtx);
return (0);
}
Lck_Unlock(&h2->sess->mtx);
return (1);
......
......@@ -13,7 +13,7 @@ varnish v1 -cliok "param.set debug +syncvsl"
client c1 {
stream 1 {
txprio -weight 10 -stream 0
txprio -weight 10 -stream 0
} -run
stream 3 {
txprio -weight 10 -stream 0
......@@ -22,7 +22,7 @@ client c1 {
txprio -weight 10 -stream 2
} -run
stream 7 {
txreq -hdr :authority foo.bar
txreq -hdr :authority foo.bar -pad cotton
rxresp
expect resp.status == 200
} -start
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment