|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-08-13 05:30 UTC] sniper@php.net
[2003-08-13 05:49 UTC] eduard at sitesupra dot com
[2003-08-13 13:26 UTC] pollita@php.net
[2003-08-13 13:52 UTC] pollita@php.net
[2003-08-18 19:45 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 01 11:00:02 2025 UTC |
Description: ------------ On windows: When you have include() from userstream result of stream_eof() is ignored and stream_read() called 2 times more When few requests occur simultaneosly - apache crushes. On Linux - this works correctly Reproduce code: --------------- <?php class userstream { var $position = 0; var $data = "If you can read this, it worked"; function stream_open($path, $mode, $options, &$opened_path) { return true; } function stream_read($count) { $ret = substr($this->data, $this->position, $count); $this->position += strlen($ret); echo "READ {$this->position}\n"; return $ret; } function stream_eof() { echo "EOF\n"; return $this->position >= strlen($this->data); } function stream_seek($offset,$whence) { echo "SEEK\n"; } function stream_tell() { echo "TELL\n"; return $this->position; } function stream_stat() { echo "STAT\n"; return NULL; } function stream_close() { echo "CLOSE\n"; } } stream_register_wrapper("cookietest", "userstream"); include("cookietest://foo"); ?> Expected result: ---------------- SEEK TELL READ 31 EOF CLOSE If you can read this, it worked Actual result: -------------- SEEK TELL STAT READ 31 EOF READ 31 EOF READ 31 EOF CLOSE If you can read this, it worked