struct PeerInfo *to_remove;
int current_bucket;
struct P2PPendingMessage *pos;
+ unsigned int discarded;
/* Check for disconnect from self message */
if (0 == memcmp (&my_identity, peer, sizeof (struct GNUNET_PeerIdentity)))
GNUNET_CORE_notify_transmit_ready_cancel (to_remove->th);
to_remove->th = NULL;
}
+ discarded = 0;
while (NULL != (pos = to_remove->head))
{
GNUNET_CONTAINER_DLL_remove (to_remove->head,
to_remove->tail,
pos);
+ discarded++;
GNUNET_free (pos);
}
+ GNUNET_STATISTICS_update (GDS_stats,
+ gettext_noop ("# Queued messages discarded (peer disconnected)"), discarded,
+ GNUNET_NO);
+ GNUNET_free (to_remove);
}
pending->importance,
GNUNET_TIME_absolute_get_remaining (pending->timeout),
&peer->id, ntohs (pending->msg->size),
- &core_transmit_notify, peer);
+ &core_transmit_notify, peer);
+ GNUNET_break (NULL != peer->th);
return 0;
}
off = 0;
GNUNET_free (pending);
}
if (peer->head != NULL)
- {
- peer->th
- = GNUNET_CORE_notify_transmit_ready (coreAPI, GNUNET_YES,
- pending->importance,
- GNUNET_TIME_absolute_get_remaining (pending->timeout),
- &peer->id, msize,
- &core_transmit_notify, peer);
- }
+ {
+ peer->th
+ = GNUNET_CORE_notify_transmit_ready (coreAPI, GNUNET_YES,
+ pending->importance,
+ GNUNET_TIME_absolute_get_remaining (pending->timeout),
+ &peer->id, msize,
+ &core_transmit_notify, peer);
+ GNUNET_break (NULL != peer->th);
+ }
return off;
}
&peer->id,
ntohs (pending->msg->size),
&core_transmit_notify, peer);
+ GNUNET_break (NULL != peer->th);
}
return;
}
GNUNET_STATISTICS_update (GDS_stats,
- gettext_noop ("# Peers selected as targets for PUT requests"), target_count,
+ gettext_noop ("# PUT messages queued for transmission"), target_count,
GNUNET_NO);
for (i=0;i<target_count;i++)
{
return;
}
GNUNET_STATISTICS_update (GDS_stats,
- gettext_noop ("# Peers selected as targets for GET requests"), target_count,
+ gettext_noop ("# GET messages queued for transmission"), target_count,
GNUNET_NO);
/* forward request */
for (i=0;i<target_count;i++)
return;
}
GNUNET_STATISTICS_update (GDS_stats,
- gettext_noop ("# REPLIES routed"), 1,
+ gettext_noop ("# RESULT messages queued for transmission"), 1,
GNUNET_NO);
pending = GNUNET_malloc (sizeof (struct P2PPendingMessage) + msize);
pending->importance = 0; /* FIXME */