/* Extracted from anet.c to work properly with Hiredis error reporting.
*
* Copyright (c) 2006-2010, Salvatore Sanfilippo <antirez at gmail dot com>
- * All rights reserved.
+ * Copyright (c) 2010, Pieter Noordhuis <pcnoordhuis at gmail dot com>
*
+ * All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
#include <stdarg.h>
#include <stdio.h>
-#include "hiredis.h"
+#include "net.h"
#include "sds.h"
/* Forward declaration */
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;
}
}
c->fd = s;
+ c->flags |= REDIS_CONNECTED;
return REDIS_OK;
}
}
c->fd = s;
+ c->flags |= REDIS_CONNECTED;
return REDIS_OK;
}