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>2014-10-20 23:20:57 +0400
committermichael-grunder <michael.grunder@gmail.com>2014-10-20 23:20:57 +0400
commit66cdeb6b594178fae987745e2c34261f1f23e8c5 (patch)
tree7fce1d1e5716d02f1db838ad4f2ea02c32495abb /redis_array_impl.c
parent0c4ddd90a6cfb0660cb59fd4521b40d289d6067c (diff)
Allow integer connect_timeout in RedisArray
Addresses #520
Diffstat (limited to 'redis_array_impl.c')
-rw-r--r--redis_array_impl.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/redis_array_impl.c b/redis_array_impl.c
index 0776d570..2fcf18e4 100644
--- a/redis_array_impl.c
+++ b/redis_array_impl.c
@@ -278,11 +278,15 @@ RedisArray *ra_load_array(const char *name TSRMLS_DC) {
array_init(z_params_connect_timeout);
sapi_module.treat_data(PARSE_STRING, estrdup(INI_STR("redis.arrays.connecttimeout")), z_params_connect_timeout TSRMLS_CC);
if (zend_hash_find(Z_ARRVAL_P(z_params_connect_timeout), name, strlen(name) + 1, (void **) &z_data_pp) != FAILURE) {
- if (Z_TYPE_PP(z_data_pp) == IS_DOUBLE || Z_TYPE_PP(z_data_pp) == IS_STRING) {
+ if (Z_TYPE_PP(z_data_pp) == IS_DOUBLE ||
+ Z_TYPE_PP(z_data_pp) == IS_STRING ||
+ Z_TYPE_PP(z_data_pp) == IS_LONG)
+ {
if (Z_TYPE_PP(z_data_pp) == IS_DOUBLE) {
d_connect_timeout = Z_DVAL_PP(z_data_pp);
- }
- else {
+ } else if (Z_TYPE_PP(z_data_pp) == IS_LONG) {
+ d_connect_timeout = Z_LVAL_PP(z_data_pp);
+ } else {
d_connect_timeout = atof(Z_STRVAL_PP(z_data_pp));
}
}