ID: 30498
User updated by: jacob at internet24 dot de
Reported By: jacob at internet24 dot de
Status: Assigned
Bug Type: SOAP related
Operating System: Gentoo Linux 1.4.16/Kernel 2.6.7
PHP Version: 5.0.2
Assigned To: dmitry
New Comment:
That would be great!
In the mean-time, I'll just have to patch
SOAP::Lite a bit to make it more explicit, letting it return
a "Connection: Keep-Alive" header with each reply
Previous Comments:
[2004-10-21 10:10:29] [EMAIL PROTECTED]
You are right about HTTP/1.1 standard, but not all SOAP servers follow
it. :(
I will think If I can fix current behavior and don't breake support for
other servers.
[2004-10-20 17:46:14] jacob at internet24 dot de
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 this bug report at http://bugs.php.net/?id=30498&edit=1