Skip to content

Commit

Permalink
Fixed bug #72175
Browse files Browse the repository at this point in the history
Make sure we don't close the connection we're trying to reuse...
  • Loading branch information
nikic committed Mar 25, 2019
1 parent b8b8809 commit 85095df
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
4 changes: 4 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2019, PHP 7.2.18

- interbase:
. Fixed bug #72175 (Impossibility of creating multiple connections to
Interbase with php 7.x). (Nikita)

- phpdbg:
. Fixed bug #76801 (too many open files). (alekitto)

Expand Down
14 changes: 8 additions & 6 deletions ext/interbase/interbase.c
Original file line number Diff line number Diff line change
Expand Up @@ -939,13 +939,15 @@ static void _php_ibase_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) /*

xlink = (zend_resource*) le->ptr;
if ((!persistent && xlink->type == le_link) || xlink->type == le_plink) {
if (IBG(default_link)) {
zend_list_close(IBG(default_link));
if (IBG(default_link) != xlink) {
GC_REFCOUNT(xlink)++;
if (IBG(default_link)) {
zend_list_delete(IBG(default_link));
}
IBG(default_link) = xlink;
}
xlink->gc.refcount++;
xlink->gc.refcount++;
IBG(default_link) = xlink;
RETVAL_RES(xlink);
GC_REFCOUNT(xlink)++;
RETURN_RES(xlink);
} else {
zend_hash_str_del(&EG(regular_list), hash, sizeof(hash)-1);
}
Expand Down

0 comments on commit 85095df

Please sign in to comment.