]> granicus.if.org Git - curl/commitdiff
http-proxy: fix chunked-encoded CONNECT responses
authorDaniel Stenberg <daniel@haxx.se>
Fri, 16 Jun 2017 15:30:39 +0000 (17:30 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 16 Jun 2017 19:56:56 +0000 (21:56 +0200)
Regression since 5113ad0424.

... and remove 'flaky' from test 1061 again

Closes #1579

lib/http_proxy.c
lib/urldata.h
tests/data/test1061

index bb788bd2e59bb865872d79f6db73ad7a49ba7c96..e1545ddf4809fb0734c0329f57678699f1e5085b 100644 (file)
@@ -188,7 +188,6 @@ static CURLcode CONNECT(struct connectdata *conn,
   CURLcode result;
   curl_socket_t tunnelsocket = conn->sock[sockindex];
   bool closeConnection = FALSE;
-  bool chunked_encoding = FALSE;
   time_t check;
   struct http_connect_state *s = conn->connect_state;
 
@@ -454,7 +453,7 @@ static CURLcode CONNECT(struct connectdata *conn,
               infof(data, "Ignore %" CURL_FORMAT_CURL_OFF_T
                     " bytes of response-body\n", s->cl);
             }
-            else if(chunked_encoding) {
+            else if(s->chunked_encoding) {
               CHUNKcode r;
 
               infof(data, "Ignore chunked response-body\n");
@@ -541,7 +540,7 @@ static CURLcode CONNECT(struct connectdata *conn,
           else if(Curl_compareheader(s->line_start,
                                      "Transfer-Encoding:", "chunked")) {
             infof(data, "CONNECT responded chunked\n");
-            chunked_encoding = TRUE;
+            s->chunked_encoding = TRUE;
             /* init our chunky engine */
             Curl_httpchunk_init(conn);
           }
index 23423e11b50673c7492d8c8077a8a000eb754ffd..62037d0f2e51a06053f9c6043aef41f7b1ec2bb5 100644 (file)
@@ -905,6 +905,7 @@ struct http_connect_state {
   char *line_start;
   char *ptr; /* where to store more data */
   curl_off_t cl; /* size of content to read and ignore */
+  bool chunked_encoding;
   enum {
     TUNNEL_INIT,    /* init/default/no tunnel state */
     TUNNEL_CONNECT, /* CONNECT has been sent off */
index 35d5d35aee35c602fa555e8157e47747f4f8e8af..c481d39c4bb09d6dc03c43383d1e37fbfed3371a 100644 (file)
@@ -8,7 +8,6 @@ HTTP proxy
 chunked Transfer-Encoding
 proxytunnel
 HTTP proxy Digest auth
-flaky
 </keywords>
 </info>