]> granicus.if.org Git - curl/commitdiff
http2: fix build when NOT h2-enabled
authorDaniel Stenberg <daniel@haxx.se>
Mon, 18 May 2015 12:09:32 +0000 (14:09 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 18 May 2015 12:09:32 +0000 (14:09 +0200)
lib/http.c
lib/http2.c
lib/url.c

index e4ff4010a45a9a679cc91e59bbac6d19e6faa14d..e16f6de5c234f8dec71ab72dd0a1388dc3afe4a8 100644 (file)
@@ -163,19 +163,6 @@ CURLcode Curl_http_setup_conn(struct connectdata *conn)
 
   conn->data->req.protop = http;
 
-  http->nread_header_recvbuf = 0;
-  http->bodystarted = FALSE;
-  http->status_code = -1;
-  http->pausedata = NULL;
-  http->pauselen = 0;
-  http->error_code = NGHTTP2_NO_ERROR;
-  http->closed = FALSE;
-
-  /* where to store incoming data for this stream and how big the buffer is */
-  http->mem = conn->data->state.buffer;
-  http->len = BUFSIZE;
-  http->memlen = 0;
-
   Curl_http2_setup_conn(conn);
 
   return CURLE_OK;
index 961750c7e3bccf9398b1eb88e949f2c316a320aa..867162a7669d77cbdd63e8604581c91e34ab47f0 100644 (file)
@@ -96,8 +96,23 @@ static CURLcode http2_disconnect(struct connectdata *conn,
 /* called from Curl_http_setup_conn */
 void Curl_http2_setup_conn(struct connectdata *conn)
 {
+  struct HTTP *http = conn->data->req.protop;
+
   conn->proto.httpc.settings.max_concurrent_streams =
     DEFAULT_MAX_CONCURRENT_STREAMS;
+
+  http->nread_header_recvbuf = 0;
+  http->bodystarted = FALSE;
+  http->status_code = -1;
+  http->pausedata = NULL;
+  http->pauselen = 0;
+  http->error_code = NGHTTP2_NO_ERROR;
+  http->closed = FALSE;
+
+  /* where to store incoming data for this stream and how big the buffer is */
+  http->mem = conn->data->state.buffer;
+  http->len = BUFSIZE;
+  http->memlen = 0;
 }
 
 /*
index 3425039dede573659827bfdef6f133e644d473a3..bc342b0f9cafab7e777ce62ac2ba1b85f0b3e563 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -3365,7 +3365,7 @@ ConnectionExists(struct SessionHandle *data,
             infof(data, "Pipe is full, skip (%zu)\n", pipeLen);
             continue;
           }
-
+#ifdef USE_NGHTTP2
           /* If multiplexed, make sure we don't go over concurrency limit */
           if(check->bits.multiplex) {
             /* Multiplexed connections can only be HTTP/2 for now */
@@ -3376,7 +3376,7 @@ ConnectionExists(struct SessionHandle *data,
               continue;
             }
           }
-
+#endif
           /* We can't use the connection if the pipe is penalized */
           if(Curl_pipeline_penalized(data, check)) {
             infof(data, "Penalized, skip\n");