Skip to content

Commit

Permalink
http2_send: Track bankrupt streams
Browse files Browse the repository at this point in the history
  • Loading branch information
Dridi authored and simonvik committed Mar 18, 2024
1 parent c020172 commit 727a5f8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bin/varnishd/http2/cache_http2.h
Expand Up @@ -163,7 +163,8 @@ struct h2_sess {

struct sess *sess;
int refcnt;
unsigned open_streams;
int open_streams;
int winup_streams;
uint32_t highest_stream;
int goaway;
int bogosity;
Expand Down
7 changes: 7 additions & 0 deletions bin/varnishd/http2/cache_http2_send.c
Expand Up @@ -267,6 +267,9 @@ h2_do_window(struct worker *wrk, struct h2_req *r2,
r2->t_winupd = VTIM_real();
h2_send_rel_locked(h2, r2);

assert(h2->winup_streams >= 0);
h2->winup_streams++;

while (r2->t_window <= 0 && h2_errcheck(r2, h2) == NULL) {
r2->cond = &wrk->cond;
(void)h2_cond_wait(r2->cond, h2, r2);
Expand All @@ -281,6 +284,10 @@ h2_do_window(struct worker *wrk, struct h2_req *r2,
h2_win_charge(r2, h2, w);
assert (w > 0);
}

assert(h2->winup_streams > 0);
h2->winup_streams--;

h2_send_get_locked(wrk, h2, r2);
}

Expand Down

0 comments on commit 727a5f8

Please sign in to comment.