Skip to content

Instantly share code, notes, and snippets.

@bagder
Created January 2, 2023 09:05
Show Gist options
  • Save bagder/37a92a45c42fb30a8c6600e263eaa387 to your computer and use it in GitHub Desktop.
Save bagder/37a92a45c42fb30a8c6600e263eaa387 to your computer and use it in GitHub Desktop.
test 359 first fix
diff --git a/lib/http2.c b/lib/http2.c
index 3c8674cbf..ead356307 100644
--- a/lib/http2.c
+++ b/lib/http2.c
@@ -391,12 +391,14 @@ static bool http2_connisdead(struct Curl_cfilter *cf, struct Curl_easy *data)
not in use by any other transfer, there shouldn't be any data here,
only "protocol frames" */
CURLcode result;
ssize_t nread = -1;
+ Curl_attach_connection(data, cf->conn);
nread = Curl_conn_cf_recv(cf->next, data,
ctx->inbuf, H2_BUFSIZE, &result);
+ dead = FALSE;
if(nread != -1) {
H2BUGF(infof(data,
"%d bytes stray data read before trying h2 connection",
(int)nread));
ctx->nread_inbuf = 0;
@@ -406,10 +408,11 @@ static bool http2_connisdead(struct Curl_cfilter *cf, struct Curl_easy *data)
dead = TRUE;
}
else
/* the read failed so let's say this is dead anyway */
dead = TRUE;
+ Curl_detach_connection(data);
}
return dead;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment