Added lots of new asserts which should trigger in case we double delete a ADC message.

This commit is contained in:
Jan Vidar Krey
2010-02-15 19:03:19 +01:00
parent 1ce258bccf
commit 29c162727c
4 changed files with 17 additions and 56 deletions

View File

@@ -126,6 +126,7 @@ void hub_sendq_add(struct hub_sendq* q, struct adc_message* msg_)
#ifdef DEBUG_SENDQ
debug_msg("hub_sendq_add", msg);
#endif
assert(msg->cache && *msg->cache);
list_append(q->queue, msg);
q->size += msg->length;
}
@@ -146,7 +147,7 @@ int hub_sendq_send(struct hub_sendq* q, struct hub_user* user)
int ret;
struct adc_message* msg = list_get_first(q->queue);
if (!msg) return 0;
assert(msg->cache && *msg->cache);
ret = net_con_send(user->connection, msg->cache + q->offset, msg->length - q->offset);
if (ret > 0)

View File

@@ -106,6 +106,8 @@ int route_to_user(struct hub_info* hub, struct hub_user* user, struct adc_messag
if (!user->connection)
return 0;
assert(msg->cache && *msg->cache);
if (hub_sendq_is_empty(user->send_queue) && !user_flag_get(user, flag_pipeline))
{
/* Perform oportunistic write */