From:             krzycho at wapp dot pl
Operating system: FreeBSD 5.4-R
PHP version:      4.4.2
PHP Bug Type:     Sockets related
Bug description:  socket_recv() don't returns expected value when useing some 
flags

Description:
------------
some flags don't work correctly, cause returned value is not value
returned by the recv() function...
some flags work correct(ex. MSG_PEEK), cause it don't modify value
returned by the recv.

sockets.c (line 322): m = recv(bsd_socket, (void *) t, 1, flags);
sockets.c (line 341): return n;
should be when we use some flags: return m;

Reproduce code:
---------------
define("MSG_OOB",       1); 
define("MSG_PEEK",      2); 
define("MSG_DONTROUTE", 4); 
define("MSG_EOR",       8); 
define("MSG_TRUNC",     16);
define("MSG_CTRUNC",    32);
define("MSG_WAITALL",   64);
$flag=socket_recv($read, $data, 1024, MSG_TRUNC);
echo $flag;


-- 
Edit bug report at http://bugs.php.net/?id=37721&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=37721&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=37721&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=37721&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=37721&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=37721&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=37721&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=37721&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=37721&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=37721&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=37721&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=37721&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=37721&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=37721&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=37721&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=37721&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=37721&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=37721&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=37721&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=37721&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=37721&r=mysqlcfg

Reply via email to