summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/send.c2
-rw-r--r--lib/udp.c3
2 files changed, 4 insertions, 1 deletions
diff --git a/lib/send.c b/lib/send.c
index 0872471..a8ad1d5 100644
--- a/lib/send.c
+++ b/lib/send.c
@@ -103,6 +103,8 @@ rs_packet_send (struct rs_packet *pkt, void *user_data)
}
else /* UDP */
{
+ event_assign (conn->wev, conn->evb, event_get_fd (conn->wev),
+ EV_WRITE, event_get_callback (conn->wev), pkt);
err = event_add (conn->wev, NULL);
if (err < 0)
return rs_err_conn_push_fl (conn, RSE_EVENT, __FILE__, __LINE__,
diff --git a/lib/udp.c b/lib/udp.c
index 19968b3..911616d 100644
--- a/lib/udp.c
+++ b/lib/udp.c
@@ -128,6 +128,7 @@ _evcb (evutil_socket_t fd, short what, void *user_data)
{
struct rs_packet *pkt = (struct rs_packet *) user_data;
assert (pkt);
+ assert (pkt->conn);
if (!pkt->conn->is_connected)
event_on_connect (pkt->conn, pkt);
@@ -150,7 +151,7 @@ udp_init (struct rs_connection *conn, struct rs_packet *pkt)
assert (!conn->bev);
conn->rev = event_new (conn->evb, conn->fd, EV_READ|EV_PERSIST, _evcb, NULL);
- conn->wev = event_new (conn->evb, conn->fd, EV_WRITE, _evcb, pkt);
+ conn->wev = event_new (conn->evb, conn->fd, EV_WRITE, _evcb, NULL);
if (!conn->rev || !conn->wev)
{
if (conn->rev)