From 81cd24adb8bf09ef26ab8cf56955136711dbd7df Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 23 Jul 2014 09:23:56 +0200 Subject: 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. --- lib/http.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'lib/http.c') 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: -- cgit v1.2.3