Index: ext/oci8/oci8.c =================================================================== RCS file: /repository/php-src/ext/oci8/oci8.c,v retrieving revision 1.269.2.16.2.24 diff -u -p -d -r1.269.2.16.2.24 oci8.c --- ext/oci8/oci8.c 12 Sep 2006 20:27:28 -0000 1.269.2.16.2.24 +++ ext/oci8/oci8.c 18 Oct 2006 10:01:21 -0000 @@ -1103,16 +1103,21 @@ php_oci_connection *php_oci_do_connect_e if ( (connection->next_ping > 0) && (timestamp >= connection->next_ping) && !php_oci_connection_ping(connection TSRMLS_CC)) { /* server died */ } else { - int rsrc_type; + int rsrc_type, hash_key_len; + 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); + hash_key_len = tmp ? strlen(tmp->hash_key) : 0; + + if (tmp != NULL && rsrc_type == le_pconnection && hash_key_len == 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; } }