summaryrefslogtreecommitdiffstats
path: root/redir.c
diff options
context:
space:
mode:
Diffstat (limited to 'redir.c')
-rw-r--r--redir.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/redir.c b/redir.c
index 9731715..22e31af 100644
--- a/redir.c
+++ b/redir.c
@@ -92,7 +92,7 @@ static void hexdump(const char *prefix, const unsigned char *data, size_t size)
static ssize_t redir_write(struct redir *r, const char *buf, size_t count)
{
int rc;
-
+
if (r->trace)
hexdump("out", buf, count);
rc = write(r->sock, buf, count);
@@ -147,7 +147,9 @@ int redir_connect(struct redir *r)
r->sock = tcp_connect(&ai, NULL, NULL, r->host,
strlen(r->port) ? r->port : defport);
if (-1 == r->sock) {
- redir_state(r, REDIR_ERROR);
+ redir_state(r, REDIR_ERROR);
+ /* FIXME: better error message */
+ snprintf(r->err, sizeof(r->err), "connect failed");
return -1;
}
return 0;