CVS update: php3/functions
| From: | steinm | Date: | Tue, 01 Jun 1999 14:25:22 +0000 |
| Subject: | CVS update: php3/functions | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-6361@lists.php.net to get a copy of this message | ||
Date: Tuesday June 1, 1999 @ 10:25
Author: steinm
Update of /repository/php3/functions
In directory php:/tmp/cvs-serv7308
Modified Files:
hw.c
Log Message:
- proper locking of object in hw_changeobject()
Index: php3/functions/hw.c
diff -u php3/functions/hw.c:1.35 php3/functions/hw.c:1.36
--- php3/functions/hw.c:1.35 Fri May 28 05:35:13 1999
+++ php3/functions/hw.c Tue Jun 1 10:25:21 1999
@@ -23,7 +23,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: hw.c,v 1.35 1999/05/28 09:35:13 steinm Exp $ */
+/* $Id: hw.c,v 1.36 1999/06/01 14:25:21 steinm Exp $ */
#if COMPILE_DL
#include "dl/phpdl.h"
#endif
@@ -1284,6 +1284,7 @@
int link, id, type, i;
hw_connection *ptr;
char *modification, *oldobjrec, buf[BUFFERLEN];
+ char *tmp;
HashTable *newobjarr;
TLS_VARS;
@@ -1303,7 +1304,7 @@
}
/* get the old object record */
- if(0 != (ptr->lasterror = send_getobject(ptr->socket, id, &oldobjrec)))
+ if(0 != (ptr->lasterror = send_getandlock(ptr->socket, id, &oldobjrec)))
RETURN_FALSE;
_php3_hash_internal_pointer_reset(newobjarr);
@@ -1352,9 +1353,15 @@
set_swap(ptr->swap_on);
modification[strlen(modification)-1] = '\0';
- if (0 != (ptr->lasterror = send_changeobject(ptr->socket, id, modification)))
+ if (0 != (ptr->lasterror = send_changeobject(ptr->socket, id, modification))) {
+ free(modification);
+ send_unlock(ptr->socket, id);
RETURN_FALSE;
+ }
free(modification);
+ if (0 != (ptr->lasterror = send_unlock(ptr->socket, id))) {
+ RETURN_FALSE;
+ }
RETURN_TRUE;
}
#undef BUFFERLEN