From cbcd4c18a3fb3bf32f884954843185f4761f3543 Mon Sep 17 00:00:00 2001 From: Arnaud Cornet Date: Fri, 14 Dec 2007 22:06:20 +0100 Subject: [PATCH] Fix fatal() on /bip jump. --- src/bip.c | 4 ++-- src/connection.c | 10 +++++----- src/irc.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/bip.c b/src/bip.c index 5436e53..81022e1 100644 --- a/src/bip.c +++ b/src/bip.c @@ -1843,9 +1843,9 @@ void adm_bip_help(struct link_client *ic, int admin) "|all_connections"); bip_notify(ic, "/BIP ADD_CONN "); bip_notify(ic, "/BIP DEL_CONN "); - } else { + } else { bip_notify(ic, "/BIP LIST networks|connections"); - } + } bip_notify(ic, "/BIP JUMP # jump to next server (in same network)"); bip_notify(ic, "/BIP BLRESET # reset backlog (this connection only). Add -q flag and the operation is quiet."); #ifdef HAVE_LIBSSL diff --git a/src/connection.c b/src/connection.c index 120c3a4..5b869ff 100644 --- a/src/connection.c +++ b/src/connection.c @@ -736,7 +736,7 @@ list_t *wait_event(list_t *cn_list, int *msec, int *nc) struct timeval btv, etv; *nc = 0; - cn_newdata = list_new(NULL); + cn_newdata = list_new(list_ptr_cmp); FD_ZERO(&fds_read); FD_ZERO(&fds_write); FD_ZERO(&fds_except); @@ -747,7 +747,7 @@ list_t *wait_event(list_t *cn_list, int *msec, int *nc) mylog(LOG_DEBUGTOOMUCH, "I've seen socket %d !", cn->handle); if (cn->connected == CONN_DISCONN) { - list_add_first(cn_newdata, cn); + list_add_first_uniq(cn_newdata, cn); continue; } @@ -832,9 +832,9 @@ list_t *wait_event(list_t *cn_list, int *msec, int *nc) if (check_event_except(&fds_except, cn)) { mylog(LOG_DEBUGTOOMUCH, "Notify on FD %d (state %d)", cn->handle, cn->connected); - list_add_first(cn_newdata, cn); + list_add_first_uniq(cn_newdata, cn); continue; - } + } if (check_event_write(&fds_write, cn, nc)) { if (cn_is_in_error(cn)) toadd = 1; @@ -846,7 +846,7 @@ list_t *wait_event(list_t *cn_list, int *msec, int *nc) toadd = 1; } if (toadd) - list_add_first(cn_newdata, cn); + list_add_first_uniq(cn_newdata, cn); } return cn_newdata; } diff --git a/src/irc.c b/src/irc.c index ba1eb95..417ad6c 100644 --- a/src/irc.c +++ b/src/irc.c @@ -1201,7 +1201,7 @@ int irc_dispatch(bip_t *bip, struct link_any *l, struct line *line) return irc_dispatch_loging_client(bip, (struct link_client*)l, line); break; -#ifdef HAVE_LIBSSL +#ifdef HAVE_LIBSSL case IRC_TYPE_TRUST_CLIENT: return irc_dispatch_trust_client((struct link_client*)l, line); break;