andrei          Fri Feb  2 13:32:17 2001 EDT

  Modified files:              
    /php4/ext/sockets   sockets.c 
  Log:
  Revert bogus patch and fix it properly.
  
  
Index: php4/ext/sockets/sockets.c
diff -u php4/ext/sockets/sockets.c:1.30 php4/ext/sockets/sockets.c:1.31
--- php4/ext/sockets/sockets.c:1.30     Fri Feb  2 12:55:27 2001
+++ php4/ext/sockets/sockets.c  Fri Feb  2 13:32:16 2001
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: sockets.c,v 1.30 2001/02/02 20:55:27 cmv Exp $ */
+/* $Id: sockets.c,v 1.31 2001/02/02 21:32:16 andrei Exp $ */
 
 #include "php.h"
 
@@ -857,27 +857,10 @@
        int salen = sizeof(php_sockaddr_storage);
        int ret;
 
-       switch (ZEND_NUM_ARGS()) {
-               case 3:
-                       if (zend_get_parameters_ex(ZEND_NUM_ARGS(), &fd, &addr, &port) 
== FAILURE)
-                               WRONG_PARAM_COUNT;
-                       break;
-               case 2:
-                       if (zend_get_parameters_ex(ZEND_NUM_ARGS(), &fd, &addr) == 
FAILURE)
-                               WRONG_PARAM_COUNT;
-                       break;
-                       MAKE_STD_ZVAL((*port));
-                       
-               default:
-                       WRONG_PARAM_COUNT;
-       }
-
-/*
        if (ZEND_NUM_ARGS() < 2 || ZEND_NUM_ARGS() > 3 || 
            zend_get_parameters_ex(ZEND_NUM_ARGS(), &fd, &addr, &port) == FAILURE) {
                WRONG_PARAM_COUNT;
        }
-*/
        multi_convert_to_long_ex(ZEND_NUM_ARGS() - 1, fd, port);
        convert_to_string_ex(addr);
 
@@ -906,7 +889,8 @@
 
                        Z_STRVAL_PP(addr) = tmp;
                        Z_STRLEN_PP(addr) = strlen(tmp);
-                       Z_LVAL_PP(port)   = htons(sin->sin_port);
+                       if (ZEND_NUM_ARGS() > 2)
+                               Z_LVAL_PP(port)   = htons(sin->sin_port);
 
                        RETURN_LONG(ret);
                }



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to