| 868 | } |
| 869 | |
| 870 | int redisAsyncSetTimeout(redisAsyncContext *ac, struct timeval tv) { |
| 871 | if (!ac->c.command_timeout) { |
| 872 | ac->c.command_timeout = hi_calloc(1, sizeof(tv)); |
| 873 | if (ac->c.command_timeout == NULL) { |
| 874 | __redisSetError(&ac->c, REDIS_ERR_OOM, "Out of memory"); |
| 875 | __redisAsyncCopyError(ac); |
| 876 | return REDIS_ERR; |
| 877 | } |
| 878 | } |
| 879 | |
| 880 | if (tv.tv_sec != ac->c.command_timeout->tv_sec || |
| 881 | tv.tv_usec != ac->c.command_timeout->tv_usec) |
| 882 | { |
| 883 | *ac->c.command_timeout = tv; |
| 884 | } |
| 885 | |
| 886 | return REDIS_OK; |
| 887 | } |
nothing calls this directly
no test coverage detected