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

Skip to content

Commit 7e4cdb4

Browse files
author
Mathieu Kooiman
committed
Don't throw exceptions for (p)connect calls.
When Redis::(p)connect() is called on a newly created Redis instance that will always cause an exception to be thrown. The connect code will actually try and cancel the exception but this is problematic when you are using tools like APM (pecl.php.net/apm) which hook into the exception handler: it will already have handled it. This change simply stops the connect from throwing exceptions for that situation.
1 parent de139e8 commit 7e4cdb4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

redis.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,7 @@ PHPAPI int redis_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) {
629629
}
630630

631631
/* if there is a redis sock already we have to remove it from the list */
632-
if (redis_sock_get(object, &redis_sock TSRMLS_CC, 0) > 0) {
632+
if (redis_sock_get(object, &redis_sock TSRMLS_CC, 1) > 0) {
633633
if (zend_hash_find(Z_OBJPROP_P(object), "socket",
634634
sizeof("socket"), (void **) &socket) == FAILURE) {
635635
/* maybe there is a socket but the id isn't known.. what to do? */

0 commit comments

Comments
 (0)