Skip to content

Commit

Permalink
http2_send: Collect the timeout error
Browse files Browse the repository at this point in the history
Conflicts:
	bin/varnishd/http2/cache_http2_send.c
  • Loading branch information
dridi authored and simonvik committed Mar 18, 2024
1 parent e006849 commit 5ffa8a7
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions bin/varnishd/http2/cache_http2_send.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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
Expand Down

0 comments on commit 5ffa8a7

Please sign in to comment.