{
case GNUNET_TRANSPORT_PS_NOT_CONNECTED:
case GNUNET_TRANSPORT_PS_INIT_ATS:
- case GNUNET_TRANSPORT_PS_INIT_BLACKLIST:
case GNUNET_TRANSPORT_PS_CONNECT_SENT:
- case GNUNET_TRANSPORT_PS_CONNECT_RECV_BLACKLIST_INBOUND:
case GNUNET_TRANSPORT_PS_CONNECT_RECV_ATS:
- case GNUNET_TRANSPORT_PS_CONNECT_RECV_BLACKLIST:
case GNUNET_TRANSPORT_PS_CONNECT_RECV_ACK:
return GNUNET_NO;
case GNUNET_TRANSPORT_PS_CONNECTED:
case GNUNET_TRANSPORT_PS_RECONNECT_ATS:
- case GNUNET_TRANSPORT_PS_RECONNECT_BLACKLIST:
case GNUNET_TRANSPORT_PS_RECONNECT_SENT:
- case GNUNET_TRANSPORT_PS_CONNECTED_SWITCHING_BLACKLIST:
case GNUNET_TRANSPORT_PS_CONNECTED_SWITCHING_CONNECT_SENT:
return GNUNET_YES;
case GNUNET_TRANSPORT_PS_DISCONNECT:
return "S_NOT_CONNECTED";
case GNUNET_TRANSPORT_PS_INIT_ATS:
return "S_INIT_ATS";
- case GNUNET_TRANSPORT_PS_INIT_BLACKLIST:
- return "S_INIT_BLACKLIST";
case GNUNET_TRANSPORT_PS_CONNECT_SENT:
return "S_CONNECT_SENT";
- case GNUNET_TRANSPORT_PS_CONNECT_RECV_BLACKLIST_INBOUND:
- return "S_CONNECT_RECV_BLACKLIST_INBOUND";
case GNUNET_TRANSPORT_PS_CONNECT_RECV_ATS:
return "S_CONNECT_RECV_ATS";
- case GNUNET_TRANSPORT_PS_CONNECT_RECV_BLACKLIST:
- return "S_CONNECT_RECV_BLACKLIST";
case GNUNET_TRANSPORT_PS_CONNECT_RECV_ACK:
return "S_CONNECT_RECV_ACK";
case GNUNET_TRANSPORT_PS_CONNECTED:
return "S_CONNECTED";
case GNUNET_TRANSPORT_PS_RECONNECT_ATS:
return "S_RECONNECT_ATS";
- case GNUNET_TRANSPORT_PS_RECONNECT_BLACKLIST:
- return "S_RECONNECT_BLACKLIST";
case GNUNET_TRANSPORT_PS_RECONNECT_SENT:
return "S_RECONNECT_SENT";
- case GNUNET_TRANSPORT_PS_CONNECTED_SWITCHING_BLACKLIST:
- return "S_CONNECTED_SWITCHING_BLACKLIST";
case GNUNET_TRANSPORT_PS_CONNECTED_SWITCHING_CONNECT_SENT:
return "S_CONNECTED_SWITCHING_CONNECT_SENT";
case GNUNET_TRANSPORT_PS_DISCONNECT:
{
switch (state)
{
+ case GNUNET_TRANSPORT_VS_NONE:
+ return "NONE";
case GNUNET_TRANSPORT_VS_NEW:
return "NEW";
case GNUNET_TRANSPORT_VS_REMOVE:
/**
* Send our subscription request to the service.
*
- * @param pal_ctx our context
+ * @param val_ctx our context
*/
static void
send_val_mon_request (struct GNUNET_TRANSPORT_ValidationMonitoringContext *val_ctx)
{
struct ValidationMonitorMessage msg;
- msg.header.size = htons (sizeof (struct PeerMonitorMessage));
+ msg.header.size = htons (sizeof (struct ValidationMonitorMessage));
msg.header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_MONITOR_VALIDATION_REQUEST);
msg.one_shot = htonl (val_ctx->one_shot);
msg.peer = val_ctx->peer;
val_ctx));
}
-
/**
* Task run to re-establish the connection.
*
* @param tc scheduler context, unused
*/
static void
-do_connect (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+do_peer_connect (void *cls,
+ const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct GNUNET_TRANSPORT_PeerMonitoringContext *pal_ctx = cls;
pal_ctx->client = NULL;
pal_ctx->backoff = GNUNET_TIME_STD_BACKOFF (pal_ctx->backoff);
pal_ctx->reconnect_task = GNUNET_SCHEDULER_add_delayed (pal_ctx->backoff,
- &do_connect,
+ &do_peer_connect,
pal_ctx);
}
+
+/**
+ * Task run to re-establish the connection.
+ *
+ * @param cls our 'struct GNUNET_TRANSPORT_PeerAddressLookupContext*'
+ * @param tc scheduler context, unused
+ */
+static void
+do_val_connect (void *cls,
+ const struct GNUNET_SCHEDULER_TaskContext *tc)
+{
+ struct GNUNET_TRANSPORT_ValidationMonitoringContext *val_ctx = cls;
+
+ val_ctx->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
+ val_ctx->client = GNUNET_CLIENT_connect ("transport", val_ctx->cfg);
+ GNUNET_assert (NULL != val_ctx->client);
+ send_val_mon_request (val_ctx);
+}
+
/**
* Cut the existing connection and reconnect.
*
- * @param pal_ctx our context
+ * @param val_ctx our context
*/
static void
reconnect_val_ctx (struct GNUNET_TRANSPORT_ValidationMonitoringContext *val_ctx)
val_ctx->client = NULL;
val_ctx->backoff = GNUNET_TIME_STD_BACKOFF (val_ctx->backoff);
val_ctx->reconnect_task = GNUNET_SCHEDULER_add_delayed (val_ctx->backoff,
- &do_connect,
+ &do_val_connect,
val_ctx);
}
if (msg == NULL)
{
- GNUNET_break (0);
if (val_ctx->one_shot)
{
/* Disconnect */
size = ntohs (msg->size);
GNUNET_break (ntohs (msg->type) ==
GNUNET_MESSAGE_TYPE_TRANSPORT_MONITOR_VALIDATION_RESPONSE);
+
if (size == sizeof (struct GNUNET_MessageHeader))
{
/* Done! */
uint16_t size;
size_t alen;
size_t tlen;
- GNUNET_break (0);
+
if (msg == NULL)
{
if (pal_ctx->one_shot)