]> granicus.if.org Git - php/commitdiff
Fixed bug #36749 (SOAP: 'Error Fetching http body' when using HTTP Proxy)
authorDmitry Stogov <dmitry@php.net>
Mon, 20 Mar 2006 10:36:55 +0000 (10:36 +0000)
committerDmitry Stogov <dmitry@php.net>
Mon, 20 Mar 2006 10:36:55 +0000 (10:36 +0000)
ext/soap/php_http.c

index 697cf7e285b2824e710bae422059dd9be8f309e4..34e55b2bf3e742b4f1da3fa3ac27ea120c1ac45e 100644 (file)
@@ -811,7 +811,22 @@ try_again:
                efree(cookie);
        }
 
-       if (!get_http_body(stream, !http_1_1, http_headers, &http_body, &http_body_size TSRMLS_CC)) {
+       if (http_1_1) {
+               http_close = FALSE;
+               if (use_proxy && !use_ssl) {
+                       connection = get_http_header_value(http_headers,"Proxy-Connection: ");
+                       if (connection) {
+                               if (strncasecmp(connection, "close", sizeof("close")-1) == 0) {
+                                       http_close = TRUE;
+                               }
+                               efree(connection);
+                       }
+               }
+       } else {
+               http_close = TRUE;
+       }       
+
+       if (!get_http_body(stream, http_close, http_headers, &http_body, &http_body_size TSRMLS_CC)) {
                if (request != buf) {efree(request);}
                php_stream_close(stream);
                efree(http_headers);