struct GNUNET_MessageHeader *m = buf;
if ((NULL == buf) && (0 == size))
+ {
+ th = NULL;
return 0;
+ }
GNUNET_assert (size >= sizeof (struct GNUNET_MessageHeader));
GNUNET_assert (size < GNUNET_SERVER_MAX_MESSAGE_SIZE);
if (benchmark_send)
{
start_time = GNUNET_TIME_absolute_get ();
- th = GNUNET_TRANSPORT_notify_transmit_ready (handle, peer, 32 * 1024, 0,
+ if (NULL == th)
+ th = GNUNET_TRANSPORT_notify_transmit_ready (handle, peer, 32 * 1024, 0,
GNUNET_TIME_UNIT_FOREVER_REL,
&transmit_data, NULL);
}
shutdown_task (void *cls,
const struct GNUNET_SCHEDULER_TaskContext *tc)
{
+ if (NULL != th)
+ {
+ GNUNET_TRANSPORT_notify_transmit_ready_cancel(th);
+ th = NULL;
+ }
if (NULL != handle)
{
GNUNET_TRANSPORT_disconnect(handle);