summaryrefslogtreecommitdiff
path: root/ext/odbc
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2017-11-01 15:19:31 +0300
committerDmitry Stogov <dmitry@zend.com>2017-11-01 15:19:31 +0300
commit67d5f39a47b15e28293d9d6558b80ded049179fe (patch)
treee8f11a2a68bb06f259e8e3eeed5b102884df9fa6 /ext/odbc
parentf5664a149260ed4a83aa5cfb13ad11ed18c56af6 (diff)
downloadphp-git-67d5f39a47b15e28293d9d6558b80ded049179fe.tar.gz
Persistent resources are "thread-local".
Register persistent resources through new functions zend_register_persistent_resource()/zend_register_persistent_resource_ex().
Diffstat (limited to 'ext/odbc')
-rw-r--r--ext/odbc/php_odbc.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c
index be8fd12e11..8bfa5b3dad 100644
--- a/ext/odbc/php_odbc.c
+++ b/ext/odbc/php_odbc.c
@@ -2571,8 +2571,6 @@ try_and_get_another_connection:
/* the link is not in the persistent list */
if ((le = zend_hash_str_find_ptr(&EG(persistent_list), hashed_details, hashed_len)) == NULL) {
- zend_resource new_le;
-
if (ODBCG(max_links) != -1 && ODBCG(num_links) >= ODBCG(max_links)) {
php_error_docref(NULL, E_WARNING, "Too many open links (%ld)", ODBCG(num_links));
efree(hashed_details);
@@ -2589,11 +2587,7 @@ try_and_get_another_connection:
RETURN_FALSE;
}
- new_le.type = le_pconn;
- new_le.ptr = db_conn;
- new_le.handle = -1;
- if (zend_hash_str_update_mem(&EG(persistent_list), hashed_details, hashed_len, &new_le,
- sizeof(zend_resource)) == NULL) {
+ if (zend_register_persistent_resource(hashed_details, hashed_len, db_conn, le_pconn) == NULL) {
free(db_conn);
efree(hashed_details);
RETURN_FALSE;