aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2014-12-14 13:09:29 +0000
committerSteve Holme <steve_holme@hotmail.com>2014-12-14 13:11:35 +0000
commit96d3c9363f071f9d1e0d18cc2b0cbc6c89ced344 (patch)
tree9e9b277a417782e9b8160ab7ed439f2fedd3791f
parent4d2c539b6c809430d8c40751ef3529f013afcbe0 (diff)
http2: Use 'CURLcode result' for curl result codes
-rw-r--r--lib/http2.c29
1 files changed, 14 insertions, 15 deletions
diff --git a/lib/http2.c b/lib/http2.c
index 610c9c53a..dac9ab4a1 100644
--- a/lib/http2.c
+++ b/lib/http2.c
@@ -162,15 +162,15 @@ static ssize_t send_callback(nghttp2_session *h2,
struct connectdata *conn = (struct connectdata *)userp;
struct http_conn *httpc = &conn->proto.httpc;
ssize_t written;
- CURLcode rc;
+ CURLcode result = CURLE_OK;
+
(void)h2;
(void)flags;
- rc = 0;
written = ((Curl_send*)httpc->send_underlying)(conn, FIRSTSOCKET,
- data, length, &rc);
+ data, length, &result);
- if(rc == CURLE_AGAIN) {
+ if(result == CURLE_AGAIN) {
return NGHTTP2_ERR_WOULDBLOCK;
}
@@ -677,7 +677,7 @@ CURLcode Curl_http2_request_upgrade(Curl_send_buffer *req,
static ssize_t http2_recv(struct connectdata *conn, int sockindex,
char *mem, size_t len, CURLcode *err)
{
- CURLcode rc;
+ CURLcode result = CURLE_OK;
ssize_t rv;
ssize_t nread;
struct http_conn *httpc = &conn->proto.httpc;
@@ -728,18 +728,17 @@ static ssize_t http2_recv(struct connectdata *conn, int sockindex,
infof(conn->data, "http2_recv: %d bytes buffer\n",
conn->proto.httpc.len);
- rc = 0;
nread = ((Curl_recv*)httpc->recv_underlying)(conn, FIRSTSOCKET,
- httpc->inbuf, H2_BUFSIZE, &rc);
-
- if(rc == CURLE_AGAIN) {
- *err = rc;
+ httpc->inbuf, H2_BUFSIZE,
+ &result);
+ if(result == CURLE_AGAIN) {
+ *err = result;
return -1;
}
if(nread == -1) {
failf(conn->data, "Failed receiving HTTP2 data");
- *err = rc;
+ *err = result;
return 0;
}
@@ -991,7 +990,7 @@ CURLcode Curl_http2_setup(struct connectdata *conn)
CURLcode Curl_http2_switched(struct connectdata *conn,
const char *mem, size_t nread)
{
- CURLcode rc;
+ CURLcode result;
struct http_conn *httpc = &conn->proto.httpc;
int rv;
struct SessionHandle *data = conn->data;
@@ -1005,10 +1004,10 @@ CURLcode Curl_http2_switched(struct connectdata *conn,
(conn, FIRSTSOCKET,
NGHTTP2_CLIENT_CONNECTION_PREFACE,
NGHTTP2_CLIENT_CONNECTION_PREFACE_LEN,
- &rc);
- if(rc)
+ &result);
+ if(result)
/* TODO: This may get CURLE_AGAIN */
- return rc;
+ return result;
if(rv != 24) {
failf(data, "Only sent partial HTTP2 packet");