]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
httpReconnect() did not reset the read/write buffers (STR #4065)
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Fri, 4 May 2012 18:33:15 +0000 (18:33 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Fri, 4 May 2012 18:33:15 +0000 (18:33 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@10446 7a7537e8-13f0-0310-91df-b6672ffda945

CHANGES-1.5.txt
cups/http.c

index c8dcb991e4403480440dca571f5cfdcbfd17d0ab..0580958c40b61318fc9f9b27db36228e04d6b607 100644 (file)
@@ -3,6 +3,7 @@ CHANGES-1.5.txt
 
 CHANGES IN CUPS V1.5.3
 
+       - httpReconnect() did not reset the read/write buffers (STR #4065)
        - Compiling without threading support failed (STR #4060)
        - Fixed compile problem with old versions of OpenSSL (STR #4036)
        - The network backends did not check SNMP supply levels regularly
index 5bb21f575a6661c523cb11f2db9f48713acdd6c1..b1f6f59f95270d4ee05db8b9a993cafa2f42de2e 100644 (file)
@@ -2356,6 +2356,23 @@ httpReconnect2(http_t *http,             /* I - Connection to server */
     http->fd = -1;
   }
 
+ /*
+  * Reset all state (except fields, which may be reused)...
+  */
+
+  http->state           = HTTP_WAITING;
+  http->status          = HTTP_CONTINUE;
+  http->version         = HTTP_1_1;
+  http->keep_alive      = HTTP_KEEPALIVE_OFF;
+  memset(&http->_hostaddr, 0, sizeof(http->_hostaddr));
+  http->data_encoding   = HTTP_ENCODE_LENGTH;
+  http->_data_remaining = 0;
+  http->used            = 0;
+  http->expect          = 0;
+  http->data_remaining  = 0;
+  http->hostaddr        = NULL;
+  http->wused           = 0;
+
  /*
   * Connect to the server...
   */
@@ -2394,8 +2411,6 @@ httpReconnect2(http_t *http,              /* I - Connection to server */
 
   http->hostaddr = &(addr->addr);
   http->error    = 0;
-  http->status   = HTTP_CONTINUE;
-  http->state    = HTTP_WAITING;
 
 #ifdef HAVE_SSL
   if (http->encryption == HTTP_ENCRYPT_ALWAYS)