summaryrefslogtreecommitdiff
path: root/lib/conn.c
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordu.net>2011-03-08 13:37:46 +0100
committerLinus Nordberg <linus@nordu.net>2011-03-08 14:23:37 +0100
commitd464ebb9235fe78e6588e95d4d3333d5ee95ca48 (patch)
treec1a35006abc218813b4425edea4c79bbd3763766 /lib/conn.c
parent657eec7ee5a276521eb456bf648878935e794b6e (diff)
Timeout implemented in request objects, supported by TCP.
TODO: UDP.
Diffstat (limited to 'lib/conn.c')
-rw-r--r--lib/conn.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/conn.c b/lib/conn.c
index feed856..0786de2 100644
--- a/lib/conn.c
+++ b/lib/conn.c
@@ -64,6 +64,7 @@ rs_conn_create (struct rs_context *ctx, struct rs_connection **conn,
c->peers = r->peers; /* FIXME: Copy instead? */
for (p = c->peers; p; p = p->next)
p->conn = c;
+ c->timeout.tv_sec = r->timeout;
c->tryagain = r->retries;
}
else
@@ -313,3 +314,10 @@ rs_conn_receive_packet (struct rs_connection *conn,
return RSE_OK;
}
+void
+rs_conn_set_timeout(struct rs_connection *conn, struct timeval *tv)
+{
+ assert (conn);
+ assert (tv);
+ conn->timeout = *tv;
+}