From:
Operating system: Ubuntu 10.04 Lucid Lynx
PHP version: 5.3.3
Package: Streams related
Bug Type: Bug
Bug description:Processing out-of-band data doesn't work
Description:
------------
I'm not sure what's going wrong (stream_socket_sendto() or
stream_socket_recvfrom()) but proccessing out-of-band data doesn't work
correctly. Only the last byte is send as out-of-band data, all other data
is send as usally.
Test script:
---------------
Server:
<?php
$server = stream_socket_server('tcp://127.0.0.1:1234');
$socket = stream_socket_accept($server);
echo "OOB-Data 1/2: '".stream_socket_recvfrom($socket, 1500,
STREAM_OOB)."'\n";
echo "OOB-Data 2/2: '".stream_socket_recvfrom($socket, 1500,
STREAM_OOB)."'\n";
echo "Data 1/2: '".stream_socket_recvfrom($socket, 1500)."'\n";
echo "Data 2/2: '".stream_socket_recvfrom($socket, 1500)."'\n";
fclose($socket);
fclose($server);
?>
Client:
<?php
$socket = stream_socket_client('tcp://127.0.0.1:1234');
stream_socket_sendto($socket, '123456789', STREAM_OOB);
fclose($socket);
?>
Expected result:
----------------
OOB-Data 1/2: '123456789'
OOB-Data 2/2: ''
Data 1/2: ''
Data 2/2: ''
Actual result:
--------------
OOB-Data 1/2: '9'
OOB-Data 2/2: ''
Data 1/2: '12345678'
Data 2/2: ''
--
Edit bug report at http://bugs.php.net/bug.php?id=52848&edit=1
--
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=52848&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=52848&r=trysnapshot53
Try a snapshot (trunk):
http://bugs.php.net/fix.php?id=52848&r=trysnapshottrunk
Fixed in SVN:
http://bugs.php.net/fix.php?id=52848&r=fixed
Fixed in SVN and need be documented:
http://bugs.php.net/fix.php?id=52848&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=52848&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=52848&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=52848&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=52848&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=52848&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=52848&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=52848&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=52848&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=52848&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=52848&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=52848&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=52848&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=52848&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=52848&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=52848&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=52848&r=mysqlcfg