Skip to content

Commit 85095df

Browse files
committed
Fixed bug #72175
Make sure we don't close the connection we're trying to reuse...
1 parent b8b8809 commit 85095df

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
33
?? ??? 2019, PHP 7.2.18
44

5+
- interbase:
6+
. Fixed bug #72175 (Impossibility of creating multiple connections to
7+
Interbase with php 7.x). (Nikita)
8+
59
- phpdbg:
610
. Fixed bug #76801 (too many open files). (alekitto)
711

ext/interbase/interbase.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -939,13 +939,15 @@ static void _php_ibase_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) /*
939939

940940
xlink = (zend_resource*) le->ptr;
941941
if ((!persistent && xlink->type == le_link) || xlink->type == le_plink) {
942-
if (IBG(default_link)) {
943-
zend_list_close(IBG(default_link));
942+
if (IBG(default_link) != xlink) {
943+
GC_REFCOUNT(xlink)++;
944+
if (IBG(default_link)) {
945+
zend_list_delete(IBG(default_link));
946+
}
947+
IBG(default_link) = xlink;
944948
}
945-
xlink->gc.refcount++;
946-
xlink->gc.refcount++;
947-
IBG(default_link) = xlink;
948-
RETVAL_RES(xlink);
949+
GC_REFCOUNT(xlink)++;
950+
RETURN_RES(xlink);
949951
} else {
950952
zend_hash_str_del(&EG(regular_list), hash, sizeof(hash)-1);
951953
}

0 commit comments

Comments
 (0)