src/irc_net.c
changeset 45 71e65564afd2
parent 44 6bd70113e1ed
child 46 0c13bca53ae1
--- a/src/irc_net.c	Thu Mar 12 22:06:01 2009 +0200
+++ b/src/irc_net.c	Thu Mar 12 22:50:08 2009 +0200
@@ -20,11 +20,26 @@
     }
 }
 
+static void irc_net_conn_error (struct irc_conn *conn, struct error_info *err, void *arg)
+{
+    struct irc_net *net = arg;
+    
+    // log an error
+    log_err_info(err, "irc_conn failed");
+
+    // destroy and set NULL
+    irc_conn_destroy(conn);
+    net->conn = NULL;
+
+    // XXX: reconnect?
+}
+
 /**
  * Our irc_conn_callbacks list
  */
 struct irc_conn_callbacks _conn_callbacks = {
     .on_registered  = &irc_net_conn_registered,
+    .on_error       = &irc_net_conn_error,
 };
 
 /**