CVS update: php4/ext/standard

From: Date: Sat, 19 Jun 1999 13:04:55 +0000
Subject: CVS update: php4/ext/standard
Groups: php.version4 
Request: Send a blank email to php-version4+get-1598@lists.php.net to get a copy of this message
Date: Saturday June 19, 1999 @ 9:04 Author: zeev Update of /repository/php4/ext/standard In directory php:/tmp/cvs-serv26895/ext/standard Modified Files: fsock.c Log Message: Win32/ZTS compiles again Index: php4/ext/standard/fsock.c diff -u php4/ext/standard/fsock.c:1.10 php4/ext/standard/fsock.c:1.11 --- php4/ext/standard/fsock.c:1.10 Fri Jun 18 09:42:20 1999 +++ php4/ext/standard/fsock.c Sat Jun 19 09:04:55 1999 @@ -28,7 +28,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: fsock.c,v 1.10 1999/06/18 13:42:20 ssb Exp $ */ +/* $Id: fsock.c,v 1.11 1999/06/19 13:04:55 zeev Exp $ */ /* Synced with php3 revision 1.121 1999-06-18 [ssb] */ @@ -87,11 +87,6 @@ #include "build-defs.h" #endif -#ifndef ZTS -static HashTable ht_keys; -static HashTable ht_socks; -#endif - static unsigned char third_and_fourth_args_force_ref[] = { 4, BYREF_NONE, BYREF_NONE, BYREF_FORCE, BYREF_FORCE }; function_entry fsock_functions[] = { @@ -130,8 +125,8 @@ }; #ifndef ZTS -static HashTable ht_keys; -static HashTable ht_socks; +static HashTable PG(ht_fsock_keys); +static HashTable PG(ht_fsock_socks); #endif @@ -160,8 +155,9 @@ int _php3_is_persistent_sock(int sock) { char *key; + PLS_FETCH(); - if (_php3_hash_find(&ht_socks, (char *) &sock, sizeof(sock), + if (_php3_hash_find(&PG(ht_fsock_socks), (char *) &sock, sizeof(sock), (void **) &key) == SUCCESS) { return 1; } @@ -289,7 +285,7 @@ key = emalloc(args[0]->value.str.len + 10); sprintf(key, "%s:%d", args[0]->value.str.val, portno); - if (persistent && _php3_hash_find(&ht_keys, key, strlen(key) + 1, + if (persistent && _php3_hash_find(&PG(ht_fsock_keys), key, strlen(key) + 1, (void *) &sockp) == SUCCESS) { efree(key); *sock = *sockp; @@ -364,9 +360,9 @@ *sock=socketd; if (persistent) { - _php3_hash_update(&ht_keys, key, strlen(key) + 1, + _php3_hash_update(&PG(ht_fsock_keys), key, strlen(key) + 1, sock, sizeof(*sock), NULL); - _php3_hash_update(&ht_socks, (char *) sock, sizeof(*sock), + _php3_hash_update(&PG(ht_fsock_socks), (char *) sock, sizeof(*sock), key, strlen(key) + 1, NULL); } if(key) efree(key); @@ -735,8 +731,8 @@ int php3_minit_fsock(INIT_FUNC_ARGS) { #ifndef ZTS - _php3_hash_init(&ht_keys, 0, NULL, NULL, 1); - _php3_hash_init(&ht_socks, 0, NULL, (void (*)(void *))_php3_msock_destroy, 1); + _php3_hash_init(&PG(ht_fsock_keys), 0, NULL, NULL, 1); + _php3_hash_init(&PG(ht_fsock_socks), 0, NULL, (void (*)(void *))_php3_msock_destroy, 1); #endif return SUCCESS; } @@ -746,8 +742,8 @@ int php3_mshutdown_fsock(SHUTDOWN_FUNC_ARGS) { #ifndef ZTS - _php3_hash_destroy(&ht_socks); - _php3_hash_destroy(&ht_keys); + _php3_hash_destroy(&PG(ht_fsock_socks)); + _php3_hash_destroy(&PG(ht_fsock_keys)); #endif php_cleanup_sockbuf(1); return SUCCESS;

« previous php.version4 (#1598) next »