Log dropped messages.

This commit is contained in:
Jan Vidar Krey 2009-10-30 18:31:27 +01:00
parent e6cc47070c
commit a51e8830ce
2 changed files with 7 additions and 0 deletions

View File

@ -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

View File

@ -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;
}