]> granicus.if.org Git - curl/commitdiff
http: Add some include guards for the new HTTP/2 stuff
authorJay Satiro <raysatiro@yahoo.com>
Tue, 19 May 2015 00:53:58 +0000 (20:53 -0400)
committerJay Satiro <raysatiro@yahoo.com>
Tue, 19 May 2015 00:53:58 +0000 (20:53 -0400)
lib/http.c
lib/http.h

index e16f6de5c234f8dec71ab72dd0a1388dc3afe4a8..63b014896ad1a91daa8ce90486654dc7236027cd 100644 (file)
@@ -172,10 +172,12 @@ static CURLcode http_disconnect(struct connectdata *conn, bool dead_connection)
 {
   struct HTTP *http = conn->data->req.protop;
   (void)dead_connection;
+#ifdef USE_NGHTTP2
   if(http) {
     Curl_add_buffer_free(http->header_recvbuf);
     http->header_recvbuf = NULL; /* clear the pointer */
   }
+#endif
   return CURLE_OK;
 }
 
@@ -1484,11 +1486,13 @@ CURLcode Curl_http_done(struct connectdata *conn,
     http->send_buffer = NULL; /* clear the pointer */
   }
 
+#ifdef USE_NGHTTP2
   if(http->header_recvbuf) {
     DEBUGF(infof(data, "free header_recvbuf!!\n"));
     Curl_add_buffer_free(http->header_recvbuf);
     http->header_recvbuf = NULL; /* clear the pointer */
   }
+#endif
 
   if(HTTPREQ_POST_FORM == data->set.httpreq) {
     data->req.bytecount = http->readbytecount + http->writebytecount;
index cb861e2e580c03bd89a57063a4d9c6266080a3ca..415be39e1d2f0bde897e3af0d11cc470a2dc078b 100644 (file)
@@ -154,6 +154,7 @@ struct HTTP {
   void *send_buffer; /* used if the request couldn't be sent in one chunk,
                         points to an allocated send_buffer struct */
 
+#ifdef USE_NGHTTP2
   /*********** for HTTP/2 we store stream-local data here *************/
   int32_t stream_id; /* stream we are interested in */
 
@@ -175,16 +176,19 @@ struct HTTP {
   const uint8_t *upload_mem; /* points to a buffer to read from */
   size_t upload_len; /* size of the buffer 'upload_mem' points to */
   curl_off_t upload_left; /* number of bytes left to upload */
+#endif
 };
 
 typedef int (*sending)(void); /* Curl_send */
 typedef int (*recving)(void); /* Curl_recv */
 
+#ifdef USE_NGHTTP2
 /* h2 settings for this connection */
 struct h2settings {
   uint32_t max_concurrent_streams;
   bool enable_push;
 };
+#endif
 
 
 struct http_conn {