summaryrefslogtreecommitdiff
path: root/lib/conn.c
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordu.net>2011-03-06 14:46:57 +0100
committerLinus Nordberg <linus@nordu.net>2011-03-06 14:46:57 +0100
commit7636505962a348d9564e53922834dc6df1274653 (patch)
tree28a696ab93922db7a3ebb47093e6225040ebc1fe /lib/conn.c
parentfda0bfd44f940688f85fe3a99a0c8cd91611452f (diff)
UDP w/o bufferevents, part 1.
Sending, no retransmitting and no receiving.
Diffstat (limited to 'lib/conn.c')
-rw-r--r--lib/conn.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/conn.c b/lib/conn.c
index 904596b..48d2fe5 100644
--- a/lib/conn.c
+++ b/lib/conn.c
@@ -8,6 +8,7 @@
#include <assert.h>
#include <debug.h>
#include <event2/event.h>
+#include <event2/bufferevent.h>
#include <radsec/radsec.h>
#include <radsec/radsec-impl.h>
@@ -126,25 +127,22 @@ rs_conn_destroy (struct rs_connection *conn)
assert (conn);
- if (conn->is_connected)
- {
- err = rs_conn_disconnect (conn);
- if (err)
- return err;
- }
-
/* NOTE: conn->realm is owned by context. */
/* NOTE: conn->peers is owned by context. */
+ if (conn->is_connected)
+ err = rs_conn_disconnect (conn);
if (conn->tev)
event_free (conn->tev);
+ if (conn->bev)
+ bufferevent_free (conn->bev);
if (conn->evb)
event_base_free (conn->evb);
/* TODO: free tls_ctx */
/* TODO: free tls_ssl */
- return 0;
+ return err;
}
int