Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpredis/phpredis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormichael-grunder <michael.grunder@gmail.com>2013-01-14 09:59:13 +0400
committermichael-grunder <michael.grunder@gmail.com>2013-01-14 09:59:13 +0400
commit93f77be960b080b303f60884fe0703494f064f08 (patch)
treeb88d1ebd07f0717f610695d6fe99ad30d9b47d37 /library.c
parent6d244bbe503878b4963e4f632453b365b61ff306 (diff)
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 #286
Diffstat (limited to 'library.c')
-rw-r--r--library.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/library.c b/library.c
index 6a93f490..b4b2b97c 100644
--- a/library.c
+++ b/library.c
@@ -915,7 +915,7 @@ PHPAPI int redis_sock_connect(RedisSock *redis_sock TSRMLS_DC)
php_stream_auto_cleanup(redis_sock->stream);
- if(tv.tv_sec != 0) {
+ if(tv.tv_sec != 0 || tv.tv_usec != 0) {
php_stream_set_option(redis_sock->stream, PHP_STREAM_OPTION_READ_TIMEOUT,
0, &tv);
}