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
 [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-2020 The PHP Group
All rights reserved.
Last updated: Sat Jan 25 23:01:24 2020 UTC