|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2017-02-13 07:56 UTC] ab@php.net
-Status: Open
+Status: Feedback
[2017-02-13 07:56 UTC] ab@php.net
[2017-02-13 08:02 UTC] ab@php.net
-Status: Feedback
+Status: Verified
[2017-02-13 08:02 UTC] ab@php.net
[2017-02-13 11:47 UTC] ab@php.net
-Status: Verified
+Status: Feedback
[2017-02-13 11:47 UTC] ab@php.net
[2017-02-13 16:54 UTC] me at micksam7 dot com
-Status: Feedback
+Status: Open
[2017-02-13 16:54 UTC] me at micksam7 dot com
[2017-02-15 13:52 UTC] ab@php.net
[2017-02-15 13:52 UTC] ab@php.net
-Status: Open
+Status: Closed
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 16:00:02 2025 UTC |
Description: ------------ stream_get_contents() with any maxlength greater than -1 returns an empty string, This only appears to occur with UDP streams opened via stream_socket_client(), specifically on Windows 10. This problem doesn't occur on Linux and may function fine on older versions of Windows. The problem appears to reside somewhere in the php_stream_eof call within _php_stream_copy_to_mem - php_stream_eof seems to always return true on UDP streams on Windows 10 systems. More digging required. Test script: --------------- //Submit DNS Request $data = base64_decode("1oIBAAABAAAAAAAAB2V4YW1wbGUDb3JnAAABAAE="); $fd = stream_socket_client("udp://8.8.8.8:53", $errno, $errstr, 0, STREAM_CLIENT_CONNECT | STREAM_CLIENT_ASYNC_CONNECT); stream_set_blocking($fd, 0); stream_socket_sendto($fd,$data); sleep(1); var_dump(stream_get_contents($fd,65565)); //Does not work var_dump(stream_get_contents($fd)); //No maxlength, works fine stream_socket_shutdown($fd,STREAM_SHUT_RDWR); Expected result: ---------------- Returns a valid DNS response roughly 45 bytes long, then an empty string. string(45) "<>" string(0) "" Actual result: -------------- Returns an empty string, then a valid DNS response. string(0) "" string(45) "<>"