cvs: /php4/ext/sybase sybase.c

From: Date: Sat, 26 Feb 2000 21:35:45 +0000
Subject: cvs: /php4/ext/sybase sybase.c
Groups: php.version4 
Request: Send a blank email to php-version4+get-11058@lists.php.net to get a copy of this message
zeev Sat Feb 26 13:35:45 2000 EDT Modified files: /php4/ext/sybase sybase.c Log: Fix Sybase DB compilation Index: php4/ext/sybase/sybase.c diff -u php4/ext/sybase/sybase.c:1.22 php4/ext/sybase/sybase.c:1.23 --- php4/ext/sybase/sybase.c:1.22 Sat Feb 19 15:41:22 2000 +++ php4/ext/sybase/sybase.c Sat Feb 26 13:35:14 2000 @@ -20,7 +20,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: sybase.c,v 1.22 2000/02/19 23:41:22 zeev Exp $ */ +/* $Id: sybase.c,v 1.23 2000/02/26 21:35:14 zeev Exp $ */ #include "php.h" @@ -87,7 +87,6 @@ #endif THREAD_LS sybase_module php_sybase_module; -THREAD_LS static HashTable *resource_list, *resource_plist; #define CHECK_LINK(link) { if (link==-1) { php_error(E_WARNING,"Sybase: A link to the server could not be established"); RETURN_FALSE; } } @@ -159,6 +158,8 @@ static void _close_sybase_link(sybase_link *sybase_ptr) { + ELS_FETCH(); + sybase_ptr->valid = 0; /* @@ -167,7 +168,7 @@ will *not* be in a consistent state. thies@digicol.de */ - zend_hash_apply(resource_list,(int (*)(void *))_clean_invalid_results); + zend_hash_apply(&EG(regular_list),(int (*)(void *))_clean_invalid_results); dbclose(sybase_ptr->link); dbloginfree(sybase_ptr->login); efree(sybase_ptr); @@ -257,9 +258,6 @@ int hashed_details_length; sybase_link sybase,*sybase_ptr; - resource_list = list; - resource_plist = plist; - switch(ARG_COUNT(ht)) { case 0: /* defaults */ host=user=passwd=NULL; @@ -342,7 +340,7 @@ list_entry *le; /* try to find if we already have this link in our persistent list */ - if (zend_hash_find(plist, hashed_details, hashed_details_length+1, (void **) &le)==FAILURE) { /* we don't */ + if (zend_hash_find(&EG(persistent_list), hashed_details, hashed_details_length+1, (void **) &le)==FAILURE) { /* we don't */ list_entry new_le; if (php_sybase_module.max_links!=-1 && php_sybase_module.num_links>=php_sybase_module.max_links) { @@ -377,7 +375,7 @@ memcpy(sybase_ptr,&sybase,sizeof(sybase_link)); new_le.type = php_sybase_module.le_plink; new_le.ptr = sybase_ptr; - if (zend_hash_update(plist, hashed_details, hashed_details_length+1, (void *) &new_le, sizeof(list_entry),NULL)==FAILURE) { + if (zend_hash_update(&EG(persistent_list), hashed_details, hashed_details_length+1, (void *) &new_le, sizeof(list_entry),NULL)==FAILURE) { free(sybase_ptr); efree(hashed_details); dbloginfree(sybase.login); @@ -396,12 +394,12 @@ if (DBDEAD(sybase_ptr->link)==TRUE) { if ((sybase_ptr->link=dbopen(sybase_ptr->login,host))==FAIL) { /*php_error(E_WARNING,"Sybase: Link to server lost, unable to reconnect");*/ - zend_hash_del(plist, hashed_details, hashed_details_length+1); + zend_hash_del(&EG(persistent_list), hashed_details, hashed_details_length+1); efree(hashed_details); RETURN_FALSE; } if (dbsetopt(sybase_ptr->link,DBBUFFER,"2",-1)==FAIL) { - zend_hash_del(plist, hashed_details, hashed_details_length+1); + zend_hash_del(&EG(persistent_list), hashed_details, hashed_details_length+1); efree(hashed_details); RETURN_FALSE; } @@ -417,7 +415,7 @@ * if it doesn't, open a new sybase link, add it to the resource list, * and add a pointer to it with hashed_details as the key. */ - if (zend_hash_find(list,hashed_details,hashed_details_length+1,(void **) &index_ptr)==SUCCESS) { + if (zend_hash_find(&EG(regular_list),hashed_details,hashed_details_length+1,(void **) &index_ptr)==SUCCESS) { int type,link; void *ptr; @@ -432,7 +430,7 @@ efree(hashed_details); return; } else { - zend_hash_del(list,hashed_details,hashed_details_length+1); + zend_hash_del(&EG(regular_list),hashed_details,hashed_details_length+1); } } if (php_sybase_module.max_links!=-1 && php_sybase_module.num_links>=php_sybase_module.max_links) { @@ -463,7 +461,7 @@ /* add it to the hash */ new_index_ptr.ptr = (void *) return_value->value.lval; new_index_ptr.type = le_index_ptr; - if (zend_hash_update(list,hashed_details,hashed_details_length+1,(void *) &new_index_ptr, sizeof(list_entry),NULL)==FAILURE) { + if (zend_hash_update(&EG(regular_list),hashed_details,hashed_details_length+1,(void *) &new_index_ptr, sizeof(list_entry),NULL)==FAILURE) { efree(hashed_details); RETURN_FALSE; }

« previous php.version4 (#11058) next »