Commit 18d58835 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

(isc_killqueue): Now returns an int: the number of payload bytes in

	the killed queue.
parent 6d11353d
...@@ -59,11 +59,12 @@ isc_newqueue(void) ...@@ -59,11 +59,12 @@ isc_newqueue(void)
return msg_q; return msg_q;
} }
void int
isc_killqueue(struct isc_msgqueue * queue) isc_killqueue(struct isc_msgqueue * queue)
{ {
struct isc_msg_q_entry * mqe; struct isc_msg_q_entry * mqe;
struct isc_msg_q_entry * prev; struct isc_msg_q_entry * prev;
int size = 0;
if (queue == NULL) if (queue == NULL)
...@@ -76,13 +77,14 @@ isc_killqueue(struct isc_msgqueue * queue) ...@@ -76,13 +77,14 @@ isc_killqueue(struct isc_msgqueue * queue)
{ {
prev = mqe; prev = mqe;
mqe = mqe->next; mqe = mqe->next;
size += prev->msg->length;
isc_freemsg(prev->msg); isc_freemsg(prev->msg);
isc_free(prev); isc_free(prev);
} }
} }
isc_free(queue); isc_free(queue);
return; return size;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment