Mailing List Archive

[master] 727a5f803 http2_send: Track bankrupt streams
commit 727a5f80347545b6fc7a6aa48f9fb74e90528f0c
Author: Dridi Boukelmoune <dridi.boukelmoune@gmail.com>
Date: Mon Oct 23 17:15:20 2023 +0200

http2_send: Track bankrupt streams

diff --git a/bin/varnishd/http2/cache_http2.h b/bin/varnishd/http2/cache_http2.h
index 11e957d49..95550c080 100644
--- a/bin/varnishd/http2/cache_http2.h
+++ b/bin/varnishd/http2/cache_http2.h
@@ -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;
diff --git a/bin/varnishd/http2/cache_http2_send.c b/bin/varnishd/http2/cache_http2_send.c
index 39ddcfafd..0d6b3a6e7 100644
--- a/bin/varnishd/http2/cache_http2_send.c
+++ b/bin/varnishd/http2/cache_http2_send.c
@@ -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);
@@ -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);
}

_______________________________________________
varnish-commit mailing list
varnish-commit@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-commit