| 329 | } |
| 330 | |
| 331 | int redisContextUpdateConnectTimeout(redisContext *c, const struct timeval *timeout) { |
| 332 | /* Same timeval struct, short circuit */ |
| 333 | if (c->connect_timeout == timeout) |
| 334 | return REDIS_OK; |
| 335 | |
| 336 | /* Allocate context timeval if we need to */ |
| 337 | if (c->connect_timeout == NULL) { |
| 338 | c->connect_timeout = hi_malloc(sizeof(*c->connect_timeout)); |
| 339 | if (c->connect_timeout == NULL) |
| 340 | return REDIS_ERR; |
| 341 | } |
| 342 | |
| 343 | memcpy(c->connect_timeout, timeout, sizeof(*c->connect_timeout)); |
| 344 | return REDIS_OK; |
| 345 | } |
| 346 | |
| 347 | int redisContextUpdateCommandTimeout(redisContext *c, const struct timeval *timeout) { |
| 348 | /* Same timeval struct, short circuit */ |
no test coverage detected