php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #17618 fwrite() lies that it writes
Submitted: 2002-06-05 21:55 UTC Modified: 2002-06-18 04:56 UTC
From: hz11 at nyu dot edu Assigned:
Status: Closed Package: Network related
PHP Version: 4.1.2 OS: FreeBSD
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
50 - 50 = ?
Subscribe to this entry?

 
 [2002-06-05 21:55 UTC] hz11 at nyu dot edu
I'm using 4.1.2 as an Apache module, with the latest 1.x apache on FreeBSD 4.5.

I open a remote server with fsockopen('remote.host', 80)), then fwrite() to it , which works fine.  A problem I noticed is when the remote server (apache) closes the connection (for instance, if I send Connection: close in the HTTP header).  If I then fwrite() to the socket, fwrite reports the number of bytes written.  However, nothing comes out the other end, of course.  Shouldn't fwrite be returning -1 ?  Also, I run is_resource() on the socket, which also returns true.  

Is this expected behavior, or a bug?

Thanks,

Hans




Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-06-18 04:56 UTC] derick@php.net
This bug has been fixed in CVS. You can grab a snapshot of the
CVS version at http://snaps.php.net/. In case this was a documentation 
problem, the fix will show up soon at http://www.php.net/manual/.
In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites.
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Thu Jan 20 19:03:35 2022 UTC