diff options
author | Linus Nordberg <linus@nordu.net> | 2011-03-08 13:37:46 +0100 |
---|---|---|
committer | Linus Nordberg <linus@nordu.net> | 2011-03-08 14:23:37 +0100 |
commit | d464ebb9235fe78e6588e95d4d3333d5ee95ca48 (patch) | |
tree | c1a35006abc218813b4425edea4c79bbd3763766 /lib/conn.c | |
parent | 657eec7ee5a276521eb456bf648878935e794b6e (diff) |
Timeout implemented in request objects, supported by TCP.
TODO: UDP.
Diffstat (limited to 'lib/conn.c')
-rw-r--r-- | lib/conn.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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; +} |