php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #7341 php_read() causes funky effects
Submitted: 2000-10-19 11:19 UTC Modified: 2000-11-23 22:58 UTC
From: vincent dot negrier at mixad dot com Assigned: chrisv (profile)
Status: Closed Package: Sockets related
PHP Version: 4.0.3pl1 OS: Linux 2.2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: vincent dot negrier at mixad dot com
New email:
PHP Version: OS:

 

 [2000-10-19 11:19 UTC] vincent dot negrier at mixad dot com
since 4.0.3 (or is it pl1 ?) the PHP read() fucntion doesn't call the C read() directly but passes thru php_read().

I had to disable php_read (using read() instead) in sockets.c because my script suddenly took 99% of system resources and didn't work anymore.

I also noticed the return value of php_read() was not the same .. read() returns 0 if connection is lost where php_read returns a negative value.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-10-22 19:50 UTC] chrisv@php.net
The php read() function never called the C read() function directly.. I made some changes to it so that it would be possible to choose whether you wanted to use the wrapper or the original function (which seem to work for me) by setting sockets.use_system_read in the php.ini file in the latest CVS.

Try that and see how it works.
 [2000-10-22 19:55 UTC] chrisv@php.net
More info from bug #7343: [vincent.negrier@mixad.com]

I think this might help :

- I'm using nonblocking sockets
- I think the old behavior was okay and I don't see the point of changing it (stop reading
after CR/LF/\0 ...). Having another function (reads() ?) for this would be better ...

I think the problems comes from me using nonblocking sockets, and that php_read() IS
blocking.

 [2000-11-23 22:58 UTC] chrisv@php.net
I've attempted to correct this bug, no replies on it that I've seen. I'm closing this bug; if the effects of php_read() still persist, please reopen the report.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 20:01:29 2024 UTC