From: jacob at internet24 dot de Operating system: Gentoo Linux 1.4.16/Kernel 2.6.7 PHP version: 5.0.2 PHP Bug Type: SOAP related Bug description: Persistent Connection Handling, Talking to SOAP::Lite
Description: ------------ When using SoapClient to do HTTP Soap Requests using a Soap::Lite (0.55) Server in HTTP-Daemon mode, php soap opens a new HTTP connection for each new SOAP operation executed, despite the fact that SOAP::Lite keeps the HTTP connection open as requested by php soap ("Connection: Keep-Alive" set in the Request HTTP headers). The reason for is that php soap closes the persistent socket when it does not receive a "Connection: Keep-Alive" Header in the reply message from SOAP::Lite. Cf.: ext/soap/php_http.c 643 connection = get_http_header_value(http_headers,"Connection: "); 644 if (connection) { 645 if (strncasecmp(connection, "Keep-Alive", sizeof("Keep-Alive")-1) == 0) { 646 http_close = FALSE; 647 } 648 efree(connection); I believe that is an incorrect interpretation of the HTTP/1.1 standard, php soap should only explicitly close the connection, with an HTTP/1.1 server, when it receives a "Connection: Close" in the response, not when there is just no "Connection: Keep-Alive" in the reply headers. Right? Cf.: (http://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html#sec8.1) RFC2616, Section 8.1.2.1 states: "An HTTP/1.1 server MAY assume that a HTTP/1.1 client intends to maintain a persistent connection unless a Connection header including the connection-token "close" was sent in the request. If the server chooses to close the connection immediately after sending the response, it SHOULD send a Connection header including the connection-token close. An HTTP/1.1 client MAY expect a connection to remain open, but would decide to keep it open based on whether the response from a server contains a Connection header with the connection-token close. In case the client does not want to maintain a connection for more than that request, it SHOULD send a Connection header including the connection-token close." -- Edit bug report at http://bugs.php.net/?id=30498&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=30498&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30498&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30498&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=30498&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=30498&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=30498&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=30498&r=needscript Try newer version: http://bugs.php.net/fix.php?id=30498&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=30498&r=support Expected behavior: http://bugs.php.net/fix.php?id=30498&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=30498&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=30498&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=30498&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=30498&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=30498&r=dst IIS Stability: http://bugs.php.net/fix.php?id=30498&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=30498&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=30498&r=float MySQL Configuration Error: http://bugs.php.net/fix.php?id=30498&r=mysqlcfg