Rename COPYING -> LICENSE.
[radsecproxy.git] / lib / send.c
index f169ff9..6b887c5 100644 (file)
@@ -1,5 +1,5 @@
 /* Copyright 2011 NORDUnet A/S. All rights reserved.
-   See the file COPYING for licensing information.  */
+   See LICENSE for licensing information.  */
 
 #if defined HAVE_CONFIG_H
 #include <config.h>
@@ -35,6 +35,8 @@ _conn_open (struct rs_connection *conn, struct rs_packet *pkt)
   if (conn->realm->type == RS_CONN_TYPE_TCP
       || conn->realm->type == RS_CONN_TYPE_TLS)
     {
+      if (tcp_init_connect_timer (conn))
+       return -1;
       if (event_init_bufferevent (conn, conn->active_peer))
        return -1;
     }
@@ -42,6 +44,8 @@ _conn_open (struct rs_connection *conn, struct rs_packet *pkt)
     {
       if (udp_init (conn, pkt))
        return -1;
+      if (udp_init_retransmit_timer (conn))
+       return -1;
     }
 
   if (!conn->is_connected)
@@ -99,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__,