- update default values, eliminate obsolete ones
[oweals/gnunet.git] / src / testbed / gnunet-service-testbed_connectionpool.c
index ae80c1fd95c519c93c296b1ffaa6aae1682dcc10..6d9a279727f2e818f3bee11fc707db542085d567 100644 (file)
@@ -440,7 +440,7 @@ connection_ready (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 
 /**
  * Function called from peer connect notify callbacks from CORE and TRANSPORT
- * connections. This function calls the pendning peer connect notify callbacks
+ * connections. This function calls the pending peer connect notify callbacks
  * which are queued in an entry.
  *
  * @param cls the #PooledConnection object
@@ -734,7 +734,7 @@ GST_connection_pool_destroy ()
  *
  * @note @a connect_notify_cb will not be called if @a target is
  * already connected @a service level. Use
- * GNUNET_TRANSPORT_check_neighbour_connected() or a similar function from the
+ * GNUNET_TRANSPORT_check_peer_connected() or a similar function from the
  * respective @a service's API to check if the target peer is already connected or
  * not. @a connect_notify_cb will be called only once or never (in case @a target
  * cannot be connected or is already connected).
@@ -885,9 +885,17 @@ GST_connection_pool_get_handle_done (struct GST_ConnectionPool_GetHandle *gh)
              gh,
              gh->service, entry->index);
   if (!gh->connection_ready_called)
+  {
     GNUNET_CONTAINER_DLL_remove (entry->head_waiting, entry->tail_waiting, gh);
+    if ( (NULL == search_waiting (entry, entry->head_waiting))
+         && (GNUNET_SCHEDULER_NO_TASK != entry->notify_task) )
+    {
+      GNUNET_SCHEDULER_cancel (entry->notify_task);
+      entry->notify_task = GNUNET_SCHEDULER_NO_TASK;
+    }
+  }
   if (gh->notify_waiting)
-  { 
+  {
     GNUNET_CONTAINER_DLL_remove (entry->head_notify, entry->tail_notify, gh);
     gh->notify_waiting = 0;
   }