Restart packet pool list after it became empty.
authorPekka Riikonen <priikone@silcnet.org>
Sun, 22 Oct 2006 10:37:53 +0000 (10:37 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Sun, 22 Oct 2006 10:37:53 +0000 (10:37 +0000)
lib/silccore/silcpacket.c

index 737c36f55a3f8a0008df1afc81e197da03a3ef12..70ef94e281ae463fa1cb9868d1628bdce2dc8cee 100644 (file)
@@ -787,6 +787,8 @@ void silc_packet_free(SilcPacket packet)
 
   /* Put the packet back to freelist */
   silc_list_add(stream->engine->packet_pool, packet);
+  if (silc_list_count(stream->engine->packet_pool) == 1)
+    silc_list_start(stream->engine->packet_pool);
 
   silc_mutex_unlock(stream->engine->lock);
 }