diff options
author | Daniel Stenberg <daniel@haxx.se> | 2014-06-14 00:11:01 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2014-06-14 00:11:01 +0200 |
commit | c06e76f6fe0da2c9d06f15b6a57af78155c43149 (patch) | |
tree | 7e4f4dec2cf8f185e20ebe3bb6ca14110075d230 /lib/http2.c | |
parent | 964e43c5e21482f9a0ff8f0be135c4ab8afa9330 (diff) | |
download | curl-c06e76f6fe0da2c9d06f15b6a57af78155c43149.tar.gz |
http2: better return code error checking
Diffstat (limited to 'lib/http2.c')
-rw-r--r-- | lib/http2.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/http2.c b/lib/http2.c index 7fc8bd94f..c850fdb8f 100644 --- a/lib/http2.c +++ b/lib/http2.c @@ -481,8 +481,13 @@ CURLcode Curl_http2_request_upgrade(Curl_send_buffer *req, struct SingleRequest *k = &conn->data->req; uint8_t *binsettings = conn->proto.httpc.binsettings; - Curl_http2_init(conn); - Curl_http2_setup(conn); + result = Curl_http2_init(conn); + if(result) + return result; + + result = Curl_http2_setup(conn); + if(result) + return result; /* As long as we have a fixed set of settings, we don't have to dynamically * figure out the base64 strings since it'll always be the same. However, @@ -779,7 +784,7 @@ static ssize_t http2_send(struct connectdata *conn, int sockindex, return len; } -void Curl_http2_setup(struct connectdata *conn) +CURLcode Curl_http2_setup(struct connectdata *conn) { struct http_conn *httpc = &conn->proto.httpc; if(conn->handler->flags & PROTOPT_SSL) @@ -802,7 +807,7 @@ void Curl_http2_setup(struct connectdata *conn) conn->httpversion = 20; /* Put place holder for status line */ - Curl_add_buffer(httpc->header_recvbuf, "HTTP/2.0 200\r\n", 14); + return Curl_add_buffer(httpc->header_recvbuf, "HTTP/2.0 200\r\n", 14); } int Curl_http2_switched(struct connectdata *conn) |