Don't assert, rather print error messages.

Signed-off-by: Jan Vidar Krey <janvidar@extatic.org>
This commit is contained in:
Jan Vidar Krey 2009-03-13 17:07:06 +01:00
parent f6af8cf389
commit 5a0f01d1ec
1 changed files with 8 additions and 4 deletions

View File

@ -177,8 +177,10 @@ void net_on_write(int fd, short ev, void *arg)
user->send_queue_size -= ret;
user->send_queue_offset = 0;
assert(user->send_queue_size >= 0);
assert(user->send_queue_offset >= 0);
if ((user->send_queue_size < 0) || (user->send_queue_offset < 0))
{
hub_log(log_error, "INVALID: send_queue_size=%d, send_queue_offset=%d", user->send_queue_size, user->send_queue_offset);
}
list_remove(user->send_queue, msg);
@ -198,8 +200,10 @@ void net_on_write(int fd, short ev, void *arg)
user->send_queue_size -= ret;
user->send_queue_offset += ret;
assert(user->send_queue_size >= 0);
assert(user->send_queue_offset >= 0);
if ((user->send_queue_size < 0) || (user->send_queue_offset < 0))
{
hub_log(log_error, "INVALID: send_queue_size=%d, send_queue_offset=%d", user->send_queue_size, user->send_queue_offset);
}
break;
}
}