]> granicus.if.org Git - php/commitdiff
Fixed several tests failes
authorXinchen Hui <laruence@gmail.com>
Sun, 18 May 2014 04:02:54 +0000 (12:02 +0800)
committerXinchen Hui <laruence@gmail.com>
Sun, 18 May 2014 04:02:54 +0000 (12:02 +0800)
ext/sockets/conversions.c
ext/sockets/sockets.c
ext/sockets/tests/socket_import_stream-2.phpt
ext/sockets/tests/socket_import_stream-4.phpt
ext/sockets/tests/socket_set_block-retval.phpt
ext/sockets/tests/socket_set_nonblock-retval.phpt

index ff96e95c4c7e95783e2a680bd868aa512a1c6fcd..05b3f9d51aec862a8bf931934765b5984d409f9f 100644 (file)
@@ -308,6 +308,7 @@ static long from_zval_integer_common(const zval *arr_value, ser_context *ctx)
        long ret = 0;
        zval lzval;
 
+       ZVAL_NULL(&lzval);
        if (Z_TYPE_P(arr_value) != IS_LONG) {
                ZVAL_COPY(&lzval, arr_value);
                arr_value = &lzval;
@@ -926,7 +927,7 @@ static void from_zval_write_control_array(const zval *arr, char *msghdr_c, ser_c
        char                            buf[sizeof("element #4294967295")];
        char                            *bufp = buf;
        zval                            *elem;
-       uint32_t                        i;
+       uint32_t                        i = 0;
        int                                     num_elems;
        void                            *control_buf;
        zend_llist_element      *alloc;
index 1237b6c39e0a1b911baa53d06db94f35a010b14a..b858a4733ed5ef85cf13e56a095116688cb3c695 100644 (file)
@@ -1192,6 +1192,11 @@ PHP_FUNCTION(socket_getsockname)
                RETURN_FALSE;
        }
 
+       ZVAL_DEREF(addr);
+       if (port != NULL) {
+               ZVAL_DEREF(port);
+       }
+
        switch (sa->sa_family) {
 #if HAVE_IPV6
                case AF_INET6:
@@ -2099,6 +2104,7 @@ PHP_FUNCTION(socket_create_pair)
        php_sock[0] = php_create_socket();
        php_sock[1] = php_create_socket();
 
+       ZVAL_DEREF(fds_array_zval);
        if (domain != AF_INET
 #if HAVE_IPV6
                && domain != AF_INET6
index 085f0e3834cd9281d42498fe75ca29699820f800..4f06bbd7198305944e08b57d2f7d1972e8d57495 100644 (file)
@@ -43,7 +43,7 @@ bool(false)
 resource(%d) of type (stream)
 bool(true)
 
-Warning: socket_import_stream(): %d is not a valid stream resource in %s on line %d
+Warning: socket_import_stream(): supplied resource is not a valid stream resource in %s on line %d
 bool(false)
 Done.
 
index 8095d8dac7bb3651c2176c28e9e21254bb14652e..4b645014d7bd19b3e8aef46a7d626f774773abda 100644 (file)
@@ -76,7 +76,7 @@ stream_set_blocking 1
 
 close stream
 stream_set_blocking 
-Warning: stream_set_blocking(): %d is not a valid stream resource in %s on line %d
+Warning: stream_set_blocking(): supplied resource is not a valid stream resource in %s on line %d
 
 socket_set_block 
 Warning: socket_set_block(): unable to set blocking mode [%d]: %s in %s on line %d
@@ -88,13 +88,13 @@ Warning: socket_get_option(): unable to retrieve socket option [%d]: %s in %s on
 
 close socket
 stream_set_blocking 
-Warning: stream_set_blocking(): %d is not a valid stream resource in %s on line %d
+Warning: stream_set_blocking(): supplied resource is not a valid stream resource in %s on line %d
 
 socket_set_block 
-Warning: socket_set_block(): %d is not a valid Socket resource in %s on line %d
+Warning: socket_set_block(): supplied resource is not a valid Socket resource in %s on line %d
 
 socket_get_option 
-Warning: socket_get_option(): %d is not a valid Socket resource in %s on line %d
+Warning: socket_get_option(): supplied resource is not a valid Socket resource in %s on line %d
 
 
 Done.
index 2aa4b0e5c41db0a589b48ac06ebfb8cc467f0182..88e0029989a82318e2f73ecfa0fb5ff4e35535a2 100644 (file)
@@ -21,7 +21,7 @@ var_dump(socket_set_block($socket2));
 --EXPECTF--
 bool(true)
 
-Warning: socket_set_block(): %d is not a valid Socket resource in %s on line %d
+Warning: socket_set_block(): supplied resource is not a valid Socket resource in %s on line %d
 bool(false)
 --CREDITS--
 Robin Mehner, robin@coding-robin.de
index b90861859abb59b9293e34b52508c00afeacf268..c9bb1150abb645ba202dd02545294a636d0019a0 100644 (file)
@@ -21,7 +21,7 @@ var_dump(socket_set_nonblock($socket2));
 --EXPECTF--
 bool(true)
 
-Warning: socket_set_nonblock(): %d is not a valid Socket resource in %s on line %d
+Warning: socket_set_nonblock(): supplied resource is not a valid Socket resource in %s on line %d
 bool(false)
 --CREDITS--
 Robin Mehner, robin@coding-robin.de