http2: more and better error checking
1 - fixes the warnings when built without http2 support 2 - adds CURLE_HTTP2, a new error code for errors detected by nghttp2 basically when they are about http2 specific things.
This commit is contained in:
14
lib/http.c
14
lib/http.c
@@ -1760,8 +1760,9 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
|
||||
if(result)
|
||||
return result;
|
||||
|
||||
/* TODO: add error checking here */
|
||||
Curl_http2_switched(conn);
|
||||
result = Curl_http2_switched(conn);
|
||||
if(result)
|
||||
return result;
|
||||
break;
|
||||
case NPN_HTTP1_1:
|
||||
/* continue with HTTP/1.1 when explicitly requested */
|
||||
@@ -1773,7 +1774,9 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
|
||||
}
|
||||
else {
|
||||
/* prepare for a http2 request */
|
||||
Curl_http2_setup(conn);
|
||||
result = Curl_http2_setup(conn);
|
||||
if(result)
|
||||
return result;
|
||||
}
|
||||
|
||||
http = data->req.protop;
|
||||
@@ -3007,8 +3010,9 @@ CURLcode Curl_http_readwrite_headers(struct SessionHandle *data,
|
||||
k->upgr101 = UPGR101_RECEIVED;
|
||||
|
||||
/* switch to http2 now */
|
||||
/* TODO: add error checking */
|
||||
Curl_http2_switched(conn);
|
||||
result = Curl_http2_switched(conn);
|
||||
if(result)
|
||||
return result;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user