Commit f3862b47 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Start keeping track of H2 state

parent ef399466
......@@ -32,17 +32,20 @@ struct h2_sess;
#include "hpack/vhp.h"
enum h2_error_e {
H2E__DUMMY = -1,
#define H2_ERROR(NAME, val, desc) \
H2E_##NAME = val,
#include "tbl/h2_error.h"
};
enum h2_frame_e {
H2_FRAME__DUMMY = -1,
#define H2_FRAME(l,u,t,f) H2_FRAME_##u = t,
#include "tbl/h2_frames.h"
};
enum h2_stream_e {
H2_STREAM__DUMMY = -1,
#define H2_STREAM(U,s,d) H2_S_##U,
#include "tbl/h2_stream.h"
};
......@@ -51,6 +54,7 @@ enum h2_stream_e {
#include "tbl/h2_frames.h"
enum h2setting {
H2_SETTINGS__DUMMY = -1,
#define H2_SETTINGS(n,v,d) H2S_##n = v,
#include "tbl/h2_settings.h"
#undef H2_SETTINGS
......
......@@ -188,6 +188,7 @@ h2_new_req(const struct worker *wrk, struct h2_sess *h2,
r2 = WS_Alloc(req->ws, sizeof *r2);
AN(r2);
INIT_OBJ(r2, H2_REQ_MAGIC);
r2->state = H2_S_IDLE;
r2->h2sess = h2;
r2->stream = stream;
r2->req = req;
......@@ -384,6 +385,7 @@ h2_do_req(struct worker *wrk, void *priv)
assert(CNT_Request(wrk, req) != REQ_FSM_DISEMBARK);
VSL(SLT_Debug, 0, "H2REQ CNT done");
/* XXX clean up req */
r2->state = H2_S_CLOSED;
h2_del_req(wrk, r2, H2E_NO_ERROR);
}
......@@ -400,7 +402,9 @@ h2_rx_headers(struct worker *wrk, struct h2_sess *h2, struct h2_req *r2)
* read frames and proper error handling.
*/
assert(h2->rxf_stream & 1);
xxxassert(h2->rxf_stream & 1);
xxxassert(r2->state == H2_S_IDLE);
r2->state = H2_S_OPEN;
req = r2->req;
CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
......
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