diff --git a/src/core/hub.c b/src/core/hub.c index 2ba2f9d..499621e 100644 --- a/src/core/hub.c +++ b/src/core/hub.c @@ -257,9 +257,15 @@ int hub_handle_chat_message(struct hub_info* hub, struct hub_user* u, struct adc int relay = 1; int offset; - if (!message || !user_is_logged_in(u)) + if (!message) return 0; + if (!user_is_logged_in(u)) + { + hub_free(message); + return 0; + } + if ((cmd->cache[0] == 'B') && (message[0] == '!' || message[0] == '+')) { /* @@ -480,11 +486,11 @@ void hub_send_flood_warning(struct hub_info* hub, struct hub_user* u, const char adc_msg_add_argument(msg, "110"); adc_msg_add_argument(msg, tmp); hub_free(tmp); - } - route_to_user(hub, u, msg); - user_flag_set(u, flag_flood); - adc_msg_free(msg); + route_to_user(hub, u, msg); + user_flag_set(u, flag_flood); + adc_msg_free(msg); + } } static void hub_event_dispatcher(void* callback_data, struct event_data* message) diff --git a/src/core/probe.c b/src/core/probe.c index 591a358..cf0a47e 100644 --- a/src/core/probe.c +++ b/src/core/probe.c @@ -92,9 +92,10 @@ static void probe_net_event(struct net_connection* con, int events, void *arg) net_con_ssl_handshake(con, net_con_ssl_mode_server, probe->hub->ssl_ctx); return; } -#endif +#else probe_destroy(probe); return; +#endif } } } diff --git a/src/network/backend.c b/src/network/backend.c index b7aad55..d4f39c3 100644 --- a/src/network/backend.c +++ b/src/network/backend.c @@ -79,11 +79,8 @@ int net_backend_init() timeout_queue_initialize(&g_backend->timeout_queue, g_backend->now, 120); /* FIXME: max 120 secs! */ g_backend->cleaner = net_cleanup_initialize(g_backend->common.max); - for (n = 0; n < sizeof(net_backend_init_funcs); n++) + for (n = 0; net_backend_init_funcs[n]; n++) { - if (!net_backend_init_funcs[n]) - break; - g_backend->data = net_backend_init_funcs[n](&g_backend->handler, &g_backend->common); if (g_backend->data) {