From a51e8830ceb4073805e1a2b3636425a8867accd1 Mon Sep 17 00:00:00 2001 From: Jan Vidar Krey Date: Fri, 30 Oct 2009 18:31:27 +0100 Subject: [PATCH] Log dropped messages. --- src/core/netevent.c | 1 + src/core/route.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/src/core/netevent.c b/src/core/netevent.c index 21ceee5..af343a0 100644 --- a/src/core/netevent.c +++ b/src/core/netevent.c @@ -132,6 +132,7 @@ int handle_net_read(struct hub_user* user) { hub_recvq_set(q, 0, 0); user_flag_set(user, flag_maxbuf); + LOG_WARN("Received message past max_recv_buffer, dropping message."); } } else diff --git a/src/core/route.c b/src/core/route.c index bbaa1c7..cc17301 100644 --- a/src/core/route.c +++ b/src/core/route.c @@ -81,10 +81,16 @@ static inline int check_send_queue(struct hub_info* hub, struct hub_user* user, return 1; if ((user->send_queue->size + msg->length) > get_max_send_queue(hub)) + { + LOG_WARN("send queue overflowed, message discarded."); return -1; + } if (user->send_queue->size > get_max_send_queue_soft(hub) && msg->priority < 0) + { + LOG_WARN("send queue soft overflowed."); return 0; + } return 1; }