summaryrefslogtreecommitdiff
path: root/lib/tcp.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tcp.c')
-rw-r--r--lib/tcp.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/lib/tcp.c b/lib/tcp.c
index 1801d62..c315143 100644
--- a/lib/tcp.c
+++ b/lib/tcp.c
@@ -37,7 +37,7 @@ _conn_timeout_cb (int fd, short event, void *data)
rs_debug (("%s: connection timeout on %p (fd %d) connecting to %p\n",
__func__, conn, conn->fd, conn->active_peer));
conn->is_connecting = 0;
- rs_err_conn_push_fl (conn, RSE_TIMEOUT_IO, __FILE__, __LINE__, NULL);
+ rs_err_conn_push_fl (conn, RSE_TIMEOUT_CONN, __FILE__, __LINE__, NULL);
event_loopbreak (conn);
}
}
@@ -256,16 +256,11 @@ tcp_write_cb (struct bufferevent *bev, void *ctx)
int
tcp_set_connect_timeout (struct rs_connection *conn)
{
- struct timeval tv;
-
if (!conn->tev)
conn->tev = evtimer_new (conn->evb, _conn_timeout_cb, conn);
if (!conn->tev)
return rs_err_conn_push_fl (conn, RSE_EVENT, __FILE__, __LINE__,
"evtimer_new");
- tv.tv_sec = conn->realm->timeout;
- tv.tv_usec = 0;
- evtimer_add (conn->tev, &tv);
-
+ evtimer_add (conn->tev, &conn->timeout);
return RSE_OK;
}