/*
This file is part of GNUnet.
- (C) 2014 Christian Grothoff (and other contributing authors)
+ Copyright (C) 2014 Christian Grothoff (and other contributing authors)
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
/**
* Task ID for reconnect.
*/
- GNUNET_SCHEDULER_TaskIdentifier reconnect_task;
+ struct GNUNET_SCHEDULER_Task * reconnect_task;
};
{
struct GNUNET_TRANSPORT_PluginMonitor *pm = cls;
- pm->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
+ pm->reconnect_task = NULL;
pm->client = GNUNET_CLIENT_connect ("transport", pm->cfg);
GNUNET_assert (NULL != pm->client);
send_plugin_mon_request (pm);
reconnect_plugin_ctx (pm);
return;
}
+ if ( (GNUNET_MESSAGE_TYPE_TRANSPORT_MONITOR_PLUGIN_SYNC == ntohs (msg->type)) &&
+ (sizeof (struct GNUNET_MessageHeader) == ntohs (msg->size)) )
+ {
+ /* we are in sync */
+ pm->cb (pm->cb_cls,
+ NULL,
+ NULL,
+ NULL);
+ GNUNET_CLIENT_receive (pm->client,
+ &response_processor,
+ pm,
+ GNUNET_TIME_UNIT_FOREVER_REL);
+ return;
+ }
+
if ( (GNUNET_MESSAGE_TYPE_TRANSPORT_MONITOR_PLUGIN_EVENT != ntohs (msg->type)) ||
(sizeof (struct TransportPluginMonitorMessage) > ntohs (msg->size)) )
{
ps));
GNUNET_free (ps);
}
+ GNUNET_CLIENT_receive (pm->client,
+ &response_processor,
+ pm,
+ GNUNET_TIME_UNIT_FOREVER_REL);
}
GNUNET_CLIENT_disconnect (pm->client);
pm->client = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != pm->reconnect_task)
+ if (NULL != pm->reconnect_task)
{
GNUNET_SCHEDULER_cancel (pm->reconnect_task);
- pm->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
+ pm->reconnect_task = NULL;
}
clear_map (pm);
GNUNET_CONTAINER_multihashmap32_destroy (pm->sessions);