ID: 50856 User updated by: info at netzkontrast dot com Reported By: info at netzkontrast dot com Status: Open Bug Type: Streams related Operating System: Ubuntu/Suse/Linux PHP Version: 5.3.1 New Comment:
there is a typo in streamFsockTest.php instead of: fputs($handle, "GET /streamcontent.php HTTP/1.0\r\nHost: mp.devel\r\nConnection: keep-alive\r\n\r\n"); it should be: fputs($handle, "GET /streamcontent.php HTTP/1.0\r\nHost: localhost\r\nConnection: keep-alive\r\n\r\n"); Previous Comments: ------------------------------------------------------------------------ [2010-01-27 09:28:21] info at netzkontrast dot com Description: ------------ I tried the following code with different PHP-versions (5.3.1 + 5.2.8) on different Systems (one ubunto-box and a suse-box i'm totaly stuck, is there anything i'm missing? -- i have prepared some testscripts - streamContent.php (used for testoutput) - streamfiletest.php -> not working - streamSocketTest.php -> not working - streamFsockTest.php -> working Reproduce code: --------------- <?php // streamfiletest.php $filename = "/home/tests/myfile.txt"; $handle = fopen($filename, "r"); stream_set_blocking($handle, 0); $metadata = stream_get_meta_data($handle); var_dump($metadata['blocked']) // should return 0 ?> <?php // streamContent.php for($i = 10;$i;--$i) { echo ". "; if (ob_get_contents())ob_flush();flush();usleep(1000000); } ?> <?php //streamSocketTest.php $handle = fopen("http://localhost/streamContent.php", "r"); stream_set_blocking($handle, 0); while(!feof($handle)) { echo fread($handle, 100); echo "-";usleep(80000); } ?> <?php // streamFsockTest.php $handle = fsockopen("localhost", 80); stream_set_blocking($handle, 0); fputs($handle, "GET /streamcontent.php HTTP/1.0\r\nHost: mp.devel\r\nConnection: keep-alive\r\n\r\n"); while(!feof($handle)) { echo fgets($handle, 10); echo "-";usleep(80000); }?> Expected result: ---------------- streamfiletest.php: 0 streamSocketTest.php: . -----------. ------------. (etc..) streamFsockTest.php: . -----------. ------------. (etc..) Actual result: -------------- streamfiletest.php: 1 streamSocketTest.php: . -. -. - streamFsockTest.php: . -----------. ------------. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=50856&edit=1