diff options
-rw-r--r-- | hiredis.c | 6 | ||||
-rw-r--r-- | hiredis.h | 6 | ||||
-rw-r--r-- | net.c | 6 | ||||
-rw-r--r-- | net.h | 6 |
4 files changed, 12 insertions, 12 deletions
@@ -1025,7 +1025,7 @@ redisContext *redisConnect(const char *ip, int port) { return c; } -redisContext *redisConnectWithTimeout(const char *ip, int port, struct timeval tv) { +redisContext *redisConnectWithTimeout(const char *ip, int port, const struct timeval tv) { redisContext *c; c = redisContextInit(); @@ -1061,7 +1061,7 @@ redisContext *redisConnectUnix(const char *path) { return c; } -redisContext *redisConnectUnixWithTimeout(const char *path, struct timeval tv) { +redisContext *redisConnectUnixWithTimeout(const char *path, const struct timeval tv) { redisContext *c; c = redisContextInit(); @@ -1086,7 +1086,7 @@ redisContext *redisConnectUnixNonBlock(const char *path) { } /* Set read/write timeout on a blocking socket. */ -int redisSetTimeout(redisContext *c, struct timeval tv) { +int redisSetTimeout(redisContext *c, const struct timeval tv) { if (c->flags & REDIS_BLOCK) return redisContextSetTimeout(c,tv); return REDIS_ERR; @@ -173,12 +173,12 @@ typedef struct redisContext { } redisContext; redisContext *redisConnect(const char *ip, int port); -redisContext *redisConnectWithTimeout(const char *ip, int port, struct timeval tv); +redisContext *redisConnectWithTimeout(const char *ip, int port, const struct timeval tv); redisContext *redisConnectNonBlock(const char *ip, int port); redisContext *redisConnectUnix(const char *path); -redisContext *redisConnectUnixWithTimeout(const char *path, struct timeval tv); +redisContext *redisConnectUnixWithTimeout(const char *path, const struct timeval tv); redisContext *redisConnectUnixNonBlock(const char *path); -int redisSetTimeout(redisContext *c, struct timeval tv); +int redisSetTimeout(redisContext *c, const struct timeval tv); int redisEnableKeepAlive(redisContext *c); void redisFree(redisContext *c); int redisBufferRead(redisContext *c); @@ -232,7 +232,7 @@ int redisCheckSocketError(redisContext *c, int fd) { return REDIS_OK; } -int redisContextSetTimeout(redisContext *c, struct timeval tv) { +int redisContextSetTimeout(redisContext *c, const struct timeval tv) { if (setsockopt(c->fd,SOL_SOCKET,SO_RCVTIMEO,&tv,sizeof(tv)) == -1) { __redisSetErrorFromErrno(c,REDIS_ERR_IO,"setsockopt(SO_RCVTIMEO)"); return REDIS_ERR; @@ -244,7 +244,7 @@ int redisContextSetTimeout(redisContext *c, struct timeval tv) { return REDIS_OK; } -int redisContextConnectTcp(redisContext *c, const char *addr, int port, struct timeval *timeout) { +int redisContextConnectTcp(redisContext *c, const char *addr, int port, const struct timeval *timeout) { int s, rv; char _port[6]; /* strlen("65535"); */ struct addrinfo hints, *servinfo, *p; @@ -300,7 +300,7 @@ end: return rv; // Need to return REDIS_OK if alright } -int redisContextConnectUnix(redisContext *c, const char *path, struct timeval *timeout) { +int redisContextConnectUnix(redisContext *c, const char *path, const struct timeval *timeout) { int s; int blocking = (c->flags & REDIS_BLOCK); struct sockaddr_un sa; @@ -40,9 +40,9 @@ #endif int redisCheckSocketError(redisContext *c, int fd); -int redisContextSetTimeout(redisContext *c, struct timeval tv); -int redisContextConnectTcp(redisContext *c, const char *addr, int port, struct timeval *timeout); -int redisContextConnectUnix(redisContext *c, const char *path, struct timeval *timeout); +int redisContextSetTimeout(redisContext *c, const struct timeval tv); +int redisContextConnectTcp(redisContext *c, const char *addr, int port, const struct timeval *timeout); +int redisContextConnectUnix(redisContext *c, const char *path, const struct timeval *timeout); int redisKeepAlive(redisContext *c, int interval); #endif |