Commit 727a5f80 authored by Dridi Boukelmoune's avatar Dridi Boukelmoune Committed by Simon Stridsberg

http2_send: Track bankrupt streams

parent c0201724
...@@ -163,7 +163,8 @@ struct h2_sess { ...@@ -163,7 +163,8 @@ struct h2_sess {
struct sess *sess; struct sess *sess;
int refcnt; int refcnt;
unsigned open_streams; int open_streams;
int winup_streams;
uint32_t highest_stream; uint32_t highest_stream;
int goaway; int goaway;
int bogosity; int bogosity;
......
...@@ -267,6 +267,9 @@ h2_do_window(struct worker *wrk, struct h2_req *r2, ...@@ -267,6 +267,9 @@ h2_do_window(struct worker *wrk, struct h2_req *r2,
r2->t_winupd = VTIM_real(); r2->t_winupd = VTIM_real();
h2_send_rel_locked(h2, r2); h2_send_rel_locked(h2, r2);
assert(h2->winup_streams >= 0);
h2->winup_streams++;
while (r2->t_window <= 0 && h2_errcheck(r2, h2) == NULL) { while (r2->t_window <= 0 && h2_errcheck(r2, h2) == NULL) {
r2->cond = &wrk->cond; r2->cond = &wrk->cond;
(void)h2_cond_wait(r2->cond, h2, r2); (void)h2_cond_wait(r2->cond, h2, r2);
...@@ -281,6 +284,10 @@ h2_do_window(struct worker *wrk, struct h2_req *r2, ...@@ -281,6 +284,10 @@ h2_do_window(struct worker *wrk, struct h2_req *r2,
h2_win_charge(r2, h2, w); h2_win_charge(r2, h2, w);
assert (w > 0); assert (w > 0);
} }
assert(h2->winup_streams > 0);
h2->winup_streams--;
h2_send_get_locked(wrk, h2, r2); h2_send_get_locked(wrk, h2, r2);
} }
......
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