Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 77b17e5

Browse files
Merge in MatMol's changes so we don't throw and then clear an
exception in the context of connect or pconnect Addresses phpredis#361
1 parent 677c8df commit 77b17e5

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

redis.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -634,13 +634,12 @@ PHPAPI int redis_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) {
634634
/* if there is a redis sock already we have to remove it from the list */
635635
if (redis_sock_get(object, &redis_sock TSRMLS_CC, 1) > 0) {
636636
if (zend_hash_find(Z_OBJPROP_P(object), "socket",
637-
sizeof("socket"), (void **) &socket) == FAILURE) {
637+
sizeof("socket"), (void **) &socket) == FAILURE)
638+
{
638639
/* maybe there is a socket but the id isn't known.. what to do? */
639640
} else {
640641
zend_list_delete(Z_LVAL_PP(socket)); /* the refcount should be decreased and the detructor called */
641642
}
642-
} else {
643-
zend_clear_exception(TSRMLS_C); /* clear exception triggered by non-existent socket during connect(). */
644643
}
645644

646645
redis_sock = redis_sock_create(host, host_len, port, timeout, persistent, persistent_id, retry_interval);

0 commit comments

Comments
 (0)