diff options
author | michael-grunder <michael.grunder@gmail.com> | 2013-01-14 09:59:13 +0400 |
---|---|---|
committer | michael-grunder <michael.grunder@gmail.com> | 2013-01-14 09:59:13 +0400 |
commit | 93f77be960b080b303f60884fe0703494f064f08 (patch) | |
tree | b88d1ebd07f0717f610695d6fe99ad30d9b47d37 /library.c | |
parent | 6d244bbe503878b4963e4f632453b365b61ff306 (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.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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); } |