aboutsummaryrefslogtreecommitdiff
path: root/lib/http.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2014-07-23 09:23:56 +0200
committerDaniel Stenberg <daniel@haxx.se>2014-07-23 09:23:56 +0200
commit81cd24adb8bf09ef26ab8cf56955136711dbd7df (patch)
treed640d14e8c6fe72e1682324d4a066870f13cef7d /lib/http.c
parent713f96ee0c14d231d89f52f0ad0471336c147e97 (diff)
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.
Diffstat (limited to 'lib/http.c')
-rw-r--r--lib/http.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/http.c b/lib/http.c
index 5e8499aa2..f50ea5262 100644
--- a/lib/http.c
+++ b/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: