#23258 [Opn->Bgs]: fgets() hangs 15 seconds on EOF of a socket

From: Date: Mon, 28 Apr 2003 15:33:11 +0000
Subject: #23258 [Opn->Bgs]: fgets() hangs 15 seconds on EOF of a socket
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-38591@lists.php.net to get a copy of this message
ID: 23258 User updated by: markus dot pfefferle at web dot de Reported By: markus dot pfefferle at web dot de -Status: Open +Status: Bogus Bug Type: Sockets related Operating System: Windows 2000 PHP Version: 4.3.2-RC Assigned To: wez New Comment: Oy! I managed to find the cause of this "bug" (and judging by some previous bug reports on here, an answer to all these): It appears that the Windows distribution of the Apache webserver (2.0.44-46) totally ignores the 'Connection: close' line in the http header and keeps connections alive for a period of time dependent and provided by the Parameters KeepAlive On KeepAliveTimeout 15 (!!) in its httpd.conf. I did the same test directing the request below to an Apache server running under Linux, and with the Connection: close header field, the connection was seperated immediately - while without it: the same 15 second delay. So while I thought that providing the "Connection: close" header should have cause an immediate disconnection of the webserver I tested this on, the connection was in fact kept alive all the time for these 15 seconds and therefore the delay with the last fread() operation. So I flag this ticket 'Bogus', you may go gold now with the 4.3.2 (sorry for delaying) and I'll see if I can report this bug to the Apache Group :) Previous Comments: ------------------------------------------------------------------------ [2003-04-28 09:38:46] markus dot pfefferle at web dot de Did as you said, used \r\n, but it makes no difference. Webserver running is Apache 2.0.44 I will try to setup the same installation on a different platform tonight and get back on you about the result. ------------------------------------------------------------------------ [2003-04-28 08:07:16] wez@php.net Please try using this CVS snapshot: http://snaps.php.net/php4-STABLE-latest.tar.gz For Windows: http://snaps.php.net/win32/php4-win32-STABLE-latest.zip I can't reproduce this here under winxp with the latest stable snapshot. Does it work if you use the correct canonical line endings for your headers as specified by the HTTP spec ? "\n" is incorrect, "\r\n" is correct. ------------------------------------------------------------------------ [2003-04-25 05:44:20] wez@php.net I must verify/fix this before 4.3.2 goes gold. ------------------------------------------------------------------------ [2003-04-23 07:15:07] markus dot pfefferle at web dot de Back from Eastern holiday. Downloaded and installed the CVS snapshot (phpinfo() says build 2195) and tried it again. Same error - 15 seconds pause at the last (failing) read from a socket: 1051099825 : string(1) "" 1051099825 : string(1) "" 1051099825 : string(1) "" 1051099825 : string(1) "" 1051099841 : string(0) "" So ticket still open. ------------------------------------------------------------------------ [2003-04-17 09:40:23] wez@php.net Please try using this CVS snapshot: http://snaps.php.net/php4-STABLE-latest.tar.gz For Windows: http://snaps.php.net/win32/php4-win32-STABLE-latest.zip ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/23258 -- Edit this bug report at http://bugs.php.net/?id=23258&edit=1

« previous php.bugs (#38591) next »