com php-src: Merge branch 'PHP-5.6' into PHP-7.0: ext/odbc/php _odbc.c

From: Date: Thu, 17 Mar 2016 12:42:34 +0000
Subject: com php-src: Merge branch 'PHP-5.6' into PHP-7.0: ext/odbc/php _odbc.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-91389@lists.php.net to get a copy of this message
Commit: 2291ebc0ea9c71e6170f5331813f77ac6ef03026 Author: Remi Collet <remi@php.net> Thu, 17 Mar 2016 13:42:34 +0100 Parents: b4eedd128ba9f61be08a50c94afd72837d7cf70b d513b4cde5cdb25ea7f8fcd064ee98a6ffa53322 Branches: PHP-7.0 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=2291ebc0ea9c71e6170f5331813f77ac6ef03026 Log: Merge branch 'PHP-5.6' into PHP-7.0 * PHP-5.6: NEWS Fix Bug #63171 Script hangs after max_execution_time Bugs: https://bugs.php.net/63171 Changed paths: MM ext/odbc/php_odbc.c Diff: diff --cc ext/odbc/php_odbc.c index e3c8e86,0cd7135..f432dcd --- a/ext/odbc/php_odbc.c +++ b/ext/odbc/php_odbc.c @@@ -478,18 -477,23 +479,21 @@@ static void _close_odbc_conn(zend_resou odbc_connection *conn = (odbc_connection *)rsrc->ptr; - nument = zend_hash_next_free_element(&EG(regular_list)); - for(i = 1; i < nument; i++) { - ptr = zend_list_find(i, &type); - if (ptr && (type == le_result)) { - res = (odbc_result *)ptr; + ZEND_HASH_FOREACH_PTR(&EG(regular_list), p) { + if (p->ptr && (p->type == le_result)) { + res = (odbc_result *)p->ptr; if (res->conn_ptr == conn) { - zend_list_delete(i); + zend_list_close(p); } } - } + } ZEND_HASH_FOREACH_END(); - safe_odbc_disconnect(conn->hdbc); - SQLFreeConnect(conn->hdbc); - SQLFreeEnv(conn->henv); + /* If aborted via timer expiration, don't try to call any unixODBC function */ + if (!(PG(connection_status) & PHP_CONNECTION_TIMEOUT)) { + safe_odbc_disconnect(conn->hdbc); + SQLFreeConnect(conn->hdbc); + SQLFreeEnv(conn->henv); + } efree(conn); ODBCG(num_links)--; } @@@ -503,18 -508,23 +507,21 @@@ static void _close_odbc_pconn(zend_reso odbc_result *res; odbc_connection *conn = (odbc_connection *)rsrc->ptr; - nument = zend_hash_next_free_element(&EG(persistent_list)); - for(i = 1; i < nument; i++) { - ptr = zend_list_find(i, &type); - if (ptr && (type == le_result)) { - res = (odbc_result *)ptr; + ZEND_HASH_FOREACH_PTR(&EG(regular_list), p) { + if (p->ptr && (p->type == le_result)) { + res = (odbc_result *)p->ptr; if (res->conn_ptr == conn) { - zend_list_delete(i); + zend_list_close(p); } } - } - + } ZEND_HASH_FOREACH_END(); + - safe_odbc_disconnect(conn->hdbc); - SQLFreeConnect(conn->hdbc); - SQLFreeEnv(conn->henv); + /* If aborted via timer expiration, don't try to call any unixODBC function */ + if (!(PG(connection_status) & PHP_CONNECTION_TIMEOUT)) { + safe_odbc_disconnect(conn->hdbc); + SQLFreeConnect(conn->hdbc); + SQLFreeEnv(conn->henv); + } free(conn); ODBCG(num_links)--;

« previous php.cvs (#91389) next »