Mailing List Archive

[6.0] 5ffa8a76c http2_send: Collect the timeout error
commit 5ffa8a76cd55b5fae909924086b897bdf1949a49
Author: Dridi Boukelmoune <dridi.boukelmoune@gmail.com>
Date: Thu Nov 16 13:23:18 2023 +0100

http2_send: Collect the timeout error

Conflicts:
bin/varnishd/http2/cache_http2_send.c

diff --git a/bin/varnishd/http2/cache_http2_send.c b/bin/varnishd/http2/cache_http2_send.c
index ddb00baad..b78c95713 100644
--- a/bin/varnishd/http2/cache_http2_send.c
+++ b/bin/varnishd/http2/cache_http2_send.c
@@ -46,6 +46,7 @@ static int
h2_cond_wait(pthread_cond_t *cond, struct h2_sess *h2, struct h2_req *r2)
{
vtim_real now, when = 0.;
+ h2_error h2e;
int r;

AN(cond);
@@ -70,18 +71,16 @@ h2_cond_wait(pthread_cond_t *cond, struct h2_sess *h2, struct h2_req *r2)
* that the stream reached the idle_send_timeout via the lock and
* force it to log it.
*/
- if (h2_stream_tmo(h2, r2, now))
- r = ETIMEDOUT;
- else if (r == ETIMEDOUT)
- AN(h2_stream_tmo(h2, r2, NAN));
-
- if (r == ETIMEDOUT) {
- if (r2->error == NULL)
- r2->error = H2SE_CANCEL;
- return (-1);
+ h2e = h2_stream_tmo(h2, r2, now);
+ if (h2e == NULL && r == ETIMEDOUT) {
+ h2e = h2_stream_tmo(h2, r2, NAN);
+ AN(h2e);
}

- return (0);
+ if (r2->error == NULL)
+ r2->error = h2e;
+
+ return (h2e != NULL ? -1 : 0);
}

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