summaryrefslogtreecommitdiff
path: root/lib/conn.c
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordberg.se>2013-01-24 17:22:14 +0100
committerLinus Nordberg <linus@nordberg.se>2013-01-24 17:22:14 +0100
commit0fc12902522123ec85913beac30349925b9deed8 (patch)
tree9d3a6b56c1abed4aa2fecfc992d65d1c31d89d01 /lib/conn.c
parent823ea9ba4a39998e3fe210e99e8e59d342fccfda (diff)
Order functions properly in conn.c.
Diffstat (limited to 'lib/conn.c')
-rw-r--r--lib/conn.c36
1 files changed, 19 insertions, 17 deletions
diff --git a/lib/conn.c b/lib/conn.c
index 09a1ac0..64c2344 100644
--- a/lib/conn.c
+++ b/lib/conn.c
@@ -43,6 +43,25 @@ conn_user_dispatch_p (const struct rs_connection *conn)
conn->callbacks.sent_cb);
}
+
+int
+conn_activate_timeout (struct rs_connection *conn)
+{
+ assert (conn);
+ assert (conn->tev);
+ assert (conn->evb);
+ if (conn->timeout.tv_sec || conn->timeout.tv_usec)
+ {
+ rs_debug (("%s: activating timer: %d.%d\n", __func__,
+ conn->timeout.tv_sec, conn->timeout.tv_usec));
+ if (evtimer_add (conn->tev, &conn->timeout))
+ return rs_err_conn_push_fl (conn, RSE_EVENT, __FILE__, __LINE__,
+ "evtimer_add: %d", errno);
+ }
+ return RSE_OK;
+}
+
+/* Public functions. */
int
rs_conn_create (struct rs_context *ctx,
struct rs_connection **conn,
@@ -290,20 +309,3 @@ rs_conn_set_timeout(struct rs_connection *conn, struct timeval *tv)
assert (tv);
conn->timeout = *tv;
}
-
-int
-conn_activate_timeout (struct rs_connection *conn)
-{
- assert (conn);
- assert (conn->tev);
- assert (conn->evb);
- if (conn->timeout.tv_sec || conn->timeout.tv_usec)
- {
- rs_debug (("%s: activating timer: %d.%d\n", __func__,
- conn->timeout.tv_sec, conn->timeout.tv_usec));
- if (evtimer_add (conn->tev, &conn->timeout))
- return rs_err_conn_push_fl (conn, RSE_EVENT, __FILE__, __LINE__,
- "evtimer_add: %d", errno);
- }
- return RSE_OK;
-}