summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorAntony Dovgal <tony2001@php.net>2006-10-18 14:23:23 +0000
committerAntony Dovgal <tony2001@php.net>2006-10-18 14:23:23 +0000
commit91a1333c210b7ac5a2dec8783c52ddb268c6b6e6 (patch)
tree361e469bb382cfa8d9c297257051a4caf0807ead /ext
parent16877a5ad8d9ef008b7b799b7fabe2ec1506d23f (diff)
downloadphp-git-91a1333c210b7ac5a2dec8783c52ddb268c6b6e6.tar.gz
MFH: fix PECL bug #9061 (oci8 might reuse wrong persistent connection)
Diffstat (limited to 'ext')
-rw-r--r--ext/oci8/oci8.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c
index 8314e71fe1..0956504a32 100644
--- a/ext/oci8/oci8.c
+++ b/ext/oci8/oci8.c
@@ -1104,15 +1104,19 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
/* server died */
} else {
int rsrc_type;
+ php_oci_connection *tmp;
/* okay, the connection is open and the server is still alive */
connection->used_this_request = 1;
- smart_str_free_ex(&hashed_details, 0);
- if (zend_list_find(connection->rsrc_id, &rsrc_type) && (rsrc_type == le_pconnection) && zend_list_addref(connection->rsrc_id) == SUCCESS) {
+ tmp = (php_oci_connection *)zend_list_find(connection->rsrc_id, &rsrc_type);
+
+ if (tmp != NULL && rsrc_type == le_pconnection && strlen(tmp->hash_key) == hashed_details.len &&
+ memcmp(tmp->hash_key, hashed_details.c, hashed_details.len) == 0 && zend_list_addref(connection->rsrc_id) == SUCCESS) {
/* do nothing */
} else {
connection->rsrc_id = zend_list_insert(connection, le_pconnection);
}
+ smart_str_free_ex(&hashed_details, 0);
return connection;
}
}