8000 Checks for tv.tv_usec as well as tv.tv_sec when setting the read · jrtkcoder/phpredis@93f77be · GitHub
[go: up one dir, main page]

Skip to content

Commit 93f77be

Browse files
Checks for tv.tv_usec as well as tv.tv_sec when setting the read
timeout option on our socket. We were actually ignoring timeouts < 1 second because of this. Nice catch by @xiaoyjy Fixes phpredis#286
1 parent 6d244bb commit 93f77be

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -915,7 +915,7 @@ PHPAPI int redis_sock_connect(RedisSock *redis_sock TSRMLS_DC)
915915

916916
php_stream_auto_cleanup(redis_sock->stream);
917917

918-
if(tv.tv_sec != 0) {
918+
if(tv.tv_sec != 0 || tv.tv_usec != 0) {
919919
php_stream_set_option(redis_sock->stream, PHP_STREAM_OPTION_READ_TIMEOUT,
920920
0, &tv);
921921
}

0 commit comments

Comments
 (0)
0