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

From: Date: Mon, 28 Apr 2003 14:38:47 +0000
Subject: #23258 [Fbk->Opn]: fgets() hangs 15 seconds on EOF of a socket
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-38572@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: Feedback +Status: Open Bug Type: Sockets related Operating System: Windows 2000 PHP Version: 4.3.2-RC Assigned To: wez New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [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 ------------------------------------------------------------------------ [2003-04-17 09:23:54] markus dot pfefferle at web dot de Err, nevermind. I figured out why - var_dump() writes to the output buffer before echo does. But in the end, the 15 second-problem remains. Here with fread($fp, 1): 1050589160 : string(1) "\n" 1050589160 : string(1) "\n" 1050589160 : string(1) "\n" 1050589160 : string(1) "\n" 1050589175 : string(0) "" It takes fread() and fgets() in Blocking mode 15 seconds to realize that the connection has been severed. ------------------------------------------------------------------------ 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 (#38572) next »