if (buf == NULL)
{
-#if DEBUG_TRANSPORT
+#if DEBUG_TRANSPORT_TIMEOUT
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
"Timeout while trying to transmit `%s' request.\n",
"HELLO");
* @param cls closure (struct GNUNET_TRANSPORT_Handle *)
* @param msg message received, NULL on timeout or fatal error
*/
-static void demultiplexer (void *cls,
+static void demultiplexer (void *cls,
const struct GNUNET_MessageHeader *msg);
struct GNUNET_TRANSPORT_Handle *h = cls;
struct ControlMessage *pos;
struct NeighbourList *n;
+ struct NeighbourList *next;
h->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
if ( (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
n = h->neighbours;
while (NULL != n)
{
+ next = n->next;
if (n->is_connected)
neighbour_disconnect (n);
- n = n->next;
+ n = next;
}
#if DEBUG_TRANSPORT
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Connecting to transport service.\n");
struct NeighbourList *n;
struct HelloWaitList *hwl;
struct GNUNET_CLIENT_Connection *client;
+ struct ControlMessage *cm;
#if DEBUG_TRANSPORT
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Transport disconnect called!\n");
hwl->rec (hwl->rec_cls, NULL);
GNUNET_free (hwl);
}
+
+ /* Check for still scheduled control messages, cancel delay tasks if so */
+ /* Added because somehow a notify_delay_task is remaining scheduled and is ever so annoying */
+ while ( (NULL != (cm = handle->control_head)))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ _("Disconnect before control message sent!\n"));
+ if (cm->notify_delay_task != GNUNET_SCHEDULER_NO_TASK)
+ {
+ GNUNET_SCHEDULER_cancel (handle->sched, cm->notify_delay_task);
+ cm->notify_delay_task = GNUNET_SCHEDULER_NO_TASK;
+ }
+ GNUNET_CONTAINER_DLL_remove (handle->control_head,
+ handle->control_tail,
+ cm);
+ GNUNET_free (cm);
+ }
+ /* end check */
+
if (handle->reconnect_task != GNUNET_SCHEDULER_NO_TASK)
{
GNUNET_SCHEDULER_cancel (handle->sched, handle->reconnect_task);