quiche: after leaving h3_recving state, poll again

This could otherwise easily leave libcurl "hanging" after the entire
transfer is done but without noticing the end-of-transfer signal.

Assisted-by: Lucas Pardue
Closes #8436
This commit is contained in:
Daniel Stenberg 2022-02-11 09:26:07 +01:00
parent 6883180fa5
commit 96f85a0fef
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -596,13 +596,15 @@ static ssize_t h3_stream_recv(struct Curl_easy *data,
if(rcode <= 0) { if(rcode <= 0) {
recvd = -1; recvd = -1;
qs->h3_recving = FALSE; qs->h3_recving = FALSE;
/* fall through into the while loop below */
} }
else else
recvd = rcode; recvd = rcode;
} }
else {
while(recvd < 0) { while(recvd < 0) {
int64_t s = quiche_h3_conn_poll(qs->h3c, qs->conn, &ev); int64_t s = quiche_h3_conn_poll(qs->h3c, qs->conn, &ev);
infof(data, "quiche_h3_conn_poll: %ld", s);
if(s < 0) if(s < 0)
/* nothing more to do */ /* nothing more to do */
break; break;
@ -656,7 +658,6 @@ static ssize_t h3_stream_recv(struct Curl_easy *data,
quiche_h3_event_free(ev); quiche_h3_event_free(ev);
} }
}
if(flush_egress(data, sockfd, qs)) { if(flush_egress(data, sockfd, qs)) {
*curlcode = CURLE_SEND_ERROR; *curlcode = CURLE_SEND_ERROR;
return -1; return -1;