http2: when marked for closure and wanted to close == OK

It could otherwise return an error even when closed correctly if GOAWAY
had been received previously.

Reported-by: Tom van der Woerdt
Fixes #4267
Closes #4268
This commit is contained in:
Daniel Stenberg 2019-08-26 16:00:05 +02:00
parent 5cd0b6f1f3
commit c1b6a384f9
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
1 changed files with 5 additions and 0 deletions

View File

@ -1559,6 +1559,11 @@ static ssize_t http2_recv(struct connectdata *conn, int sockindex,
if(should_close_session(httpc)) {
H2BUGF(infof(data,
"http2_recv: nothing to do in this session\n"));
if(conn->bits.close) {
/* already marked for closure, return OK and we're done */
*err = CURLE_OK;
return 0;
}
*err = CURLE_HTTP2;
return -1;
}