cvs: php4 /ext/standard fsock.c
| From: | Thies C. Arntzen | Date: | Mon, 19 Jun 2000 09:02:48 +0000 |
| Subject: | cvs: php4 /ext/standard fsock.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-368@lists.php.net to get a copy of this message | ||
thies Mon Jun 19 02:02:48 2000 EDT
Modified files:
/php4/ext/standard fsock.c
Log:
(fsockopen) fix #5090
Index: php4/ext/standard/fsock.c
diff -u php4/ext/standard/fsock.c:1.50 php4/ext/standard/fsock.c:1.51
--- php4/ext/standard/fsock.c:1.50 Mon Jun 5 12:47:44 2000
+++ php4/ext/standard/fsock.c Mon Jun 19 02:02:48 2000
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: fsock.c,v 1.50 2000/06/05 19:47:44 andi Exp $ */
+/* $Id: fsock.c,v 1.51 2000/06/19 09:02:48 thies Exp $ */
/* Synced with php 3.0 revision 1.121 1999-06-18 [ssb] */
/* Synced with php 3.0 revision 1.133 1999-07-21 [sas] */
@@ -232,20 +232,12 @@
timeout.tv_usec = conv % 1000000;
/* fall-through */
case 4:
- if(!ParameterPassedByReference(ht,4)) {
- php_error(E_WARNING,"error string argument to fsockopen not passed by reference");
- }
- pval_copy_constructor(*args[3]);
- (*args[3])->value.str.val = empty_string;
- (*args[3])->value.str.len = 0;
- (*args[3])->type = IS_STRING;
+ zval_dtor(*args[3]);
+ ZVAL_STRING(*args[3],"",1);
/* fall-through */
case 3:
- if(!ParameterPassedByReference(ht,3)) {
- php_error(E_WARNING,"error argument to fsockopen not passed by reference");
- }
- (*args[2])->type = IS_LONG;
- (*args[2])->value.lval = 0;
+ zval_dtor(*args[2]);
+ ZVAL_LONG(*args[2],0);
break;
}
convert_to_string_ex(args[0]);
@@ -294,10 +286,14 @@
if (connect_nonb(socketd, (struct sockaddr *)&server, sizeof(server), &timeout) ==
SOCK_CONN_ERR) {
CLOSE_SOCK(1);
- if(arg_count>2) (*args[2])->value.lval = errno;
- if(arg_count>3) {
- (*args[3])->value.str.val = estrdup(strerror(errno));
- (*args[3])->value.str.len = strlen((*args[3])->value.str.val);
+
+ if (arg_count>2) {
+ zval_dtor(*args[2]);
+ ZVAL_LONG(*args[2],errno);
+ }
+ if (arg_count>3) {
+ zval_dtor(*args[3]);
+ ZVAL_STRING(*args[3],strerror(errno),1);
}
RETURN_FALSE;
}