X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/2612e0521fde55db2c720092d4ad02a8f015f46e..6c682e559cd250049ce483d60af19a42d0177d72:/deps/hiredis/net.c?ds=inline diff --git a/deps/hiredis/net.c b/deps/hiredis/net.c index 599ba9d6..88171461 100644 --- a/deps/hiredis/net.c +++ b/deps/hiredis/net.c @@ -1,8 +1,9 @@ /* Extracted from anet.c to work properly with Hiredis error reporting. * * Copyright (c) 2006-2010, Salvatore Sanfilippo - * All rights reserved. + * Copyright (c) 2010, Pieter Noordhuis * + * All rights reserved. * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * @@ -43,7 +44,7 @@ #include #include -#include "hiredis.h" +#include "net.h" #include "sds.h" /* Forward declaration */ @@ -114,7 +115,7 @@ int redisContextConnectTcp(redisContext *c, const char *addr, int port) { he = gethostbyname(addr); if (he == NULL) { __redisSetError(c,REDIS_ERR_OTHER, - sdscatprintf(sdsempty(),"can't resolve: %s",addr)); + sdscatprintf(sdsempty(),"Can't resolve: %s",addr)); close(s); return REDIS_ERR; } @@ -137,6 +138,7 @@ int redisContextConnectTcp(redisContext *c, const char *addr, int port) { } c->fd = s; + c->flags |= REDIS_CONNECTED; return REDIS_OK; } @@ -163,5 +165,6 @@ int redisContextConnectUnix(redisContext *c, const char *path) { } c->fd = s; + c->flags |= REDIS_CONNECTED; return REDIS_OK; }