@@ -342,7 +342,7 @@ PHP_METHOD(Redis, __construct)
342342}
343343/* }}} */
344344
345- /* {{{ proto boolean Redis::connect(string host, int port [, int timeout])
345+ /* {{{ proto boolean Redis::connect(string host, int port [, double timeout])
346346 */
347347PHP_METHOD (Redis , connect )
348348{
@@ -351,21 +351,21 @@ PHP_METHOD(Redis, connect)
351351 char * host = NULL ;
352352 long port ;
353353
354- struct timeval timeout = { 0L , 0L } ;
354+ double timeout = 0.0 ;
355355 RedisSock * redis_sock = NULL ;
356356
357- if (zend_parse_method_parameters (ZEND_NUM_ARGS () TSRMLS_CC , getThis (), "Osl|l " ,
357+ if (zend_parse_method_parameters (ZEND_NUM_ARGS () TSRMLS_CC , getThis (), "Osl|d " ,
358358 & object , redis_ce , & host , & host_len , & port ,
359- & timeout . tv_sec ) == FAILURE ) {
359+ & timeout ) == FAILURE ) {
360360 RETURN_FALSE ;
361361 }
362362
363- if (timeout . tv_sec < 0L || timeout . tv_sec > INT_MAX ) {
363+ if (timeout < 0L || timeout > INT_MAX ) {
364364 zend_throw_exception (redis_exception_ce , "Invalid timeout" , 0 TSRMLS_CC );
365365 RETURN_FALSE ;
366366 }
367367
368- redis_sock = redis_sock_create (host , host_len , port , timeout . tv_sec );
368+ redis_sock = redis_sock_create (host , host_len , port , timeout );
369369
370370 if (redis_sock_server_open (redis_sock , 1 TSRMLS_CC ) < 0 ) {
371371 redis_free_socket (redis_sock );
0 commit comments