1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-22 08:08:50 -05:00

http2_recv: return error better on fatal h2 errors

Ref #1012
Figured-out-by: Tatsuhiro Tsujikawa
This commit is contained in:
Daniel Stenberg 2017-08-18 16:29:55 +02:00
parent ffb2bc394b
commit 9e82d125e6
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -1582,7 +1582,7 @@ static ssize_t http2_recv(struct connectdata *conn, int sockindex,
failf(data, "nghttp2_session_mem_recv() returned %d:%s\n", failf(data, "nghttp2_session_mem_recv() returned %d:%s\n",
rv, nghttp2_strerror((int)rv)); rv, nghttp2_strerror((int)rv));
*err = CURLE_RECV_ERROR; *err = CURLE_RECV_ERROR;
return 0; return -1;
} }
DEBUGF(infof(data, "nghttp2_session_mem_recv() returns %zd\n", rv)); DEBUGF(infof(data, "nghttp2_session_mem_recv() returns %zd\n", rv));
if(nread == rv) { if(nread == rv) {
@ -1600,7 +1600,7 @@ static ssize_t http2_recv(struct connectdata *conn, int sockindex,
rv = h2_session_send(data, httpc->h2); rv = h2_session_send(data, httpc->h2);
if(rv != 0) { if(rv != 0) {
*err = CURLE_SEND_ERROR; *err = CURLE_SEND_ERROR;
return 0; return -1;
} }
if(should_close_session(httpc)) { if(should_close_session(httpc)) {