new operation queue for limiting overlay connects
[oweals/gnunet.git] / src / transport / gnunet-service-transport_neighbours.c
index 6636152e63a5289f3fd2f06a5736e701e703424c..232c77c2f7a675e81a94c54de125e8c9f87b07bf 100644 (file)
@@ -980,6 +980,8 @@ master_task (void *cls,
  * @param cls NULL
  * @param target identity of the neighbour that was disconnected
  * @param result GNUNET_OK if the disconnect got out successfully
+ * @param payload bytes payload
+ * @param physical bytes physical
  */
 static void
 send_disconnect_cont (void *cls, const struct GNUNET_PeerIdentity *target,
@@ -1126,6 +1128,8 @@ disconnect_neighbour (struct NeighbourMapEntry *n)
  * @param cls the 'struct MessageQueue' of the message
  * @param receiver intended receiver
  * @param success whether it worked or not
+ * @param size_payload bytes payload sent
+ * @param physical bytes sent on wire
  */
 static void
 transmit_send_continuation (void *cls,
@@ -1149,9 +1153,16 @@ transmit_send_continuation (void *cls,
       GNUNET_SCHEDULER_cancel (n->task);
     n->task = GNUNET_SCHEDULER_add_now (&master_task, n);    
   }
-  GNUNET_assert (bytes_in_send_queue >= mq->message_buf_size);
+  if (bytes_in_send_queue < mq->message_buf_size)
+  {
+      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                  "bytes_in_send_queue `%u' mq->message_buf_size %u\n",
+                  bytes_in_send_queue, mq->message_buf_size );
+      GNUNET_break (0);
+  }
+
+
   GNUNET_break (size_payload == mq->message_buf_size);
-  GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "%u %u res: %u\n",size_payload, mq->message_buf_size, success);
   bytes_in_send_queue -= mq->message_buf_size;
   GNUNET_STATISTICS_set (GST_stats,
                         gettext_noop