MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / redisContextUpdateConnectTimeout

Function redisContextUpdateConnectTimeout

deps/hiredis/net.c:331–345  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

329}
330
331int 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
347int redisContextUpdateCommandTimeout(redisContext *c, const struct timeval *timeout) {
348 /* Same timeval struct, short circuit */

Callers 3

_redisContextConnectTcpFunction · 0.85
redisContextConnectUnixFunction · 0.85
redisConnectWithOptionsFunction · 0.85

Calls 1

hi_mallocFunction · 0.70

Tested by

no test coverage detected