/**
* 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
*
* @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).
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;
}