php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44874 [PATCH] dead pfsockopen'ed sockets aren't reaped when the remote end restarts
Submitted: 2008-04-30 18:40 UTC Modified: 2009-02-08 16:55 UTC
From: Richard dot Krehbiel at gmail dot com Assigned:
Status: Closed Package: Streams related
PHP Version: 5.2CVS-2008-08-13 OS: Windows XP/Server 2003
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: Richard dot Krehbiel at gmail dot com
New email:
PHP Version: OS:

 

 [2008-04-30 18:40 UTC] Richard dot Krehbiel at gmail dot com
Description:
------------
A web page makes a connection to some service with pfsockopen, then that service dies and is restarted;  Future calls to pfsockopen can return the previously opened socket, to which I/O operations immediately fail.

This looks like a reincarnation of #23837, a bug which was closed in 2003.

I did manage to track down the error, to main/streams/xp_socket.c, line  280.  Change "0 == recv" to "0 >= recv".  Windows returns an error at this point, not 0, because it wants to return ECONNRESET.  When I make this change, the issue is resolved.



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-08-13 17:11 UTC] Richard dot Krehbiel at gmail dot com
The latest version still exhibits the bad behavior.

Okay, here's a patch.

http://home.comcast.net/~krehbiel3/xp_socket.c.patch
 [2009-02-08 16:55 UTC] iliaa@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat May 10 01:01:28 2025 UTC