cvs: php4 /ext/sockets sockets.c
| From: | Jason Greene | Date: | Wed, 28 Aug 2002 06:15:13 +0000 |
| Subject: | cvs: php4 /ext/sockets sockets.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-13723@lists.php.net to get a copy of this message | ||
jason Wed Aug 28 02:15:13 2002 EDT
Modified files:
/php4/ext/sockets sockets.c
Log:
@socket_recvfrom is now binary safe (Jason)
Zero the structure so that when the tcp layer of the OS decides to ignore it,
we do not think we are getting a value
Index: php4/ext/sockets/sockets.c
diff -u php4/ext/sockets/sockets.c:1.119 php4/ext/sockets/sockets.c:1.120
--- php4/ext/sockets/sockets.c:1.119 Sun Aug 25 19:28:42 2002
+++ php4/ext/sockets/sockets.c Wed Aug 28 02:15:13 2002
@@ -19,7 +19,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: sockets.c,v 1.119 2002/08/25 23:28:42 jason Exp $ */
+/* $Id: sockets.c,v 1.120 2002/08/28 06:15:13 jason Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -1392,12 +1392,13 @@
zval_dtor(arg2);
zval_dtor(arg5);
- ZVAL_STRING(arg2, recv_buf, 0);
+ ZVAL_STRINGL(arg2, recv_buf, retval, 0);
ZVAL_STRING(arg5, s_un.sun_path, 1);
break;
case AF_INET:
slen = sizeof(sin);
+ memset(&sin, 0, slen);
sin.sin_family = AF_INET;
if (arg6 == NULL) {
@@ -1418,7 +1419,7 @@
address = inet_ntoa(sin.sin_addr);
- ZVAL_STRING(arg2, recv_buf, 0);
+ ZVAL_STRINGL(arg2, recv_buf, retval, 0);
ZVAL_STRING(arg5, address ? address : "0.0.0.0", 1);
ZVAL_LONG(arg6, ntohs(sin.sin_port));
break;