src/irc_net.c
changeset 45 71e65564afd2
parent 44 6bd70113e1ed
child 46 0c13bca53ae1
equal deleted inserted replaced
44:6bd70113e1ed 45:71e65564afd2
    18             // XXX: fuck...
    18             // XXX: fuck...
    19             FATAL_ERR(err, "irc_chan_join failed");
    19             FATAL_ERR(err, "irc_chan_join failed");
    20     }
    20     }
    21 }
    21 }
    22 
    22 
       
    23 static void irc_net_conn_error (struct irc_conn *conn, struct error_info *err, void *arg)
       
    24 {
       
    25     struct irc_net *net = arg;
       
    26     
       
    27     // log an error
       
    28     log_err_info(err, "irc_conn failed");
       
    29 
       
    30     // destroy and set NULL
       
    31     irc_conn_destroy(conn);
       
    32     net->conn = NULL;
       
    33 
       
    34     // XXX: reconnect?
       
    35 }
       
    36 
    23 /**
    37 /**
    24  * Our irc_conn_callbacks list
    38  * Our irc_conn_callbacks list
    25  */
    39  */
    26 struct irc_conn_callbacks _conn_callbacks = {
    40 struct irc_conn_callbacks _conn_callbacks = {
    27     .on_registered  = &irc_net_conn_registered,
    41     .on_registered  = &irc_net_conn_registered,
       
    42     .on_error       = &irc_net_conn_error,
    28 };
    43 };
    29 
    44 
    30 /**
    45 /**
    31  * Propagate the command to the appropriate irc_chan based on the given name
    46  * Propagate the command to the appropriate irc_chan based on the given name
    32  */
    47  */