From be0fc2b801d8001a58c7811220fcf1250b60e3a5 Mon Sep 17 00:00:00 2001 From: Antony Dovgal Date: Mon, 29 May 2006 10:59:30 +0000 Subject: [PATCH] MFH: fix #37531 (oci8 persistent connection corruption) --- ext/oci8/oci8.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c index 06bfccfd4e..8e66cac992 100644 --- a/ext/oci8/oci8.c +++ b/ext/oci8/oci8.c @@ -1055,10 +1055,14 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char /* server died */ } else { + int rsrc_type; + /* 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_addref(connection->rsrc_id) == FAILURE) { + if (zend_list_find(connection->rsrc_id, &rsrc_type) && (rsrc_type == le_pconnection) && zend_list_addref(connection->rsrc_id) == SUCCESS) { + /* do nothing */ + } else { connection->rsrc_id = zend_list_insert(connection, le_pconnection); } return connection; -- 2.50.1