/*
This file is part of GNUnet
- Copyright (C) 2010-2015 Christian Grothoff (and other contributing authors)
+ Copyright (C) 2010-2015 GNUnet e.V.
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
* Then reschedule this function to be called again once more is available.
*
* @param cls the plugin handle
- * @param tc the scheduling context (for rescheduling this function again)
*/
static void
-udp_plugin_select_v4 (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+udp_plugin_select_v4 (void *cls);
/**
* Then reschedule this function to be called again once more is available.
*
* @param cls the plugin handle
- * @param tc the scheduling context (for rescheduling this function again)
*/
static void
-udp_plugin_select_v6 (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+udp_plugin_select_v6 (void *cls);
/**
"Calculated flow delay for UDPv4 at %s for %s\n",
GNUNET_STRINGS_relative_time_to_string (min_delay,
GNUNET_YES),
- GNUNET_i2s (&udpw->session->target));
+ GNUNET_i2s (&min_udpw->session->target));
}
else
{
"Calculated flow delay for UDPv4 at %s for %s\n",
GNUNET_STRINGS_relative_time_to_string (min_delay,
GNUNET_YES),
- GNUNET_i2s (&udpw->session->target));
+ GNUNET_i2s (&min_udpw->session->target));
}
}
plugin->select_task_v4
"Calculated flow delay for UDPv6 at %s for %s\n",
GNUNET_STRINGS_relative_time_to_string (min_delay,
GNUNET_YES),
- GNUNET_i2s (&udpw->session->target));
+ GNUNET_i2s (&min_udpw->session->target));
}
else
{
"Calculated flow delay for UDPv6 at %s for %s\n",
GNUNET_STRINGS_relative_time_to_string (min_delay,
GNUNET_YES),
- GNUNET_i2s (&udpw->session->target));
+ GNUNET_i2s (&min_udpw->session->target));
}
}
plugin->select_task_v6
if (delay.rel_value_us > GNUNET_CONSTANTS_LATENCY_WARN.rel_value_us)
{
LOG (GNUNET_ERROR_TYPE_WARNING,
- "Fragmented message acknowledged after %s\n",
+ "Fragmented message acknowledged after %s (expected at %s)\n",
GNUNET_STRINGS_relative_time_to_string (delay,
- GNUNET_YES));
+ GNUNET_YES),
+ GNUNET_STRINGS_absolute_time_to_string (frag_ctx->next_frag_time));
}
else
{
LOG (GNUNET_ERROR_TYPE_DEBUG,
- "Fragmented message acknowledged after %s\n",
+ "Fragmented message acknowledged after %s (expected at %s)\n",
GNUNET_STRINGS_relative_time_to_string (delay,
- GNUNET_YES));
+ GNUNET_YES),
+ GNUNET_STRINGS_absolute_time_to_string (frag_ctx->next_frag_time));
}
if (NULL != frag_ctx->cont)
GNUNET_assert (NULL != udpw->frag_ctx);
if (GNUNET_OK == result)
{
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Fragment of message with %u bytes transmitted to %s\n",
+ (unsigned int) udpw->payload_size,
+ GNUNET_i2s (&udpw->session->target));
GNUNET_FRAGMENT_context_transmission_done (udpw->frag_ctx->frag);
GNUNET_STATISTICS_update (plugin->env->stats,
"# UDP, fragmented msgs, fragments, sent, success",
}
else
{
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Failed to transmit fragment of message with %u bytes to %s\n",
+ (unsigned int) udpw->payload_size,
+ GNUNET_i2s (&udpw->session->target));
fragmented_message_done (udpw->frag_ctx,
GNUNET_SYSERR);
GNUNET_STATISTICS_update (plugin->env->stats,
msg_len);
enqueue (plugin,
udpw);
+ if (session->address->address_length == sizeof (struct IPv4UdpAddress))
+ schedule_select_v4 (plugin);
+ else
+ schedule_select_v6 (plugin);
}
struct UDP_MessageWrapper *udpw;
struct UDPMessage *udp;
char mbuf[udpmlen] GNUNET_ALIGN;
+ struct GNUNET_TIME_Relative latency;
if ( (sizeof(struct IPv6UdpAddress) == s->address->address_length) &&
(NULL == plugin->sockv6) )
"# UDP, unfragmented bytes payload queued total",
msgbuf_size,
GNUNET_NO);
+ if (s->address->address_length == sizeof (struct IPv4UdpAddress))
+ schedule_select_v4 (plugin);
+ else
+ schedule_select_v6 (plugin);
}
else
{
frag_ctx);
s->frag_ctx = frag_ctx;
s->last_transmit_time = frag_ctx->next_frag_time;
+ latency = GNUNET_TIME_absolute_get_remaining (s->last_transmit_time);
+ if (latency.rel_value_us > GNUNET_CONSTANTS_LATENCY_WARN.rel_value_us)
+ LOG (GNUNET_ERROR_TYPE_WARNING,
+ "Enqueued fragments will take %s for transmission to %s (queue size: %u)\n",
+ GNUNET_STRINGS_relative_time_to_string (latency,
+ GNUNET_YES),
+ GNUNET_i2s (&s->target),
+ (unsigned int) s->msgs_in_queue);
+ else
+ LOG (GNUNET_ERROR_TYPE_DEBUG,
+ "Enqueued fragments will take %s for transmission to %s (queue size: %u)\n",
+ GNUNET_STRINGS_relative_time_to_string (latency,
+ GNUNET_YES),
+ GNUNET_i2s (&s->target),
+ (unsigned int) s->msgs_in_queue);
+
GNUNET_STATISTICS_update (plugin->env->stats,
"# UDP, fragmented messages active",
1,
notify_session_monitor (s->plugin,
s,
GNUNET_TRANSPORT_SS_UPDATE);
- if (s->address->address_length == sizeof (struct IPv4UdpAddress))
- schedule_select_v4 (plugin);
- else
- schedule_select_v6 (plugin);
return udpmlen;
}
* Session was idle, so disconnect it.
*
* @param cls the `struct GNUNET_ATS_Session` to time out
- * @param tc scheduler context
*/
static void
-session_timeout (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+session_timeout (void *cls)
{
struct GNUNET_ATS_Session *s = cls;
struct Plugin *plugin = s->plugin;
if (size != ntohs (msg->size))
{
LOG (GNUNET_ERROR_TYPE_WARNING,
- "UDP malformed message header from %s\n",
+ "UDP malformed message (size %u) header from %s\n",
(unsigned int) size,
GNUNET_a2s (sa,
fromlen));
* Then reschedule this function to be called again once more is available.
*
* @param cls the plugin handle
- * @param tc the scheduling context
*/
static void
-udp_plugin_select_v4 (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+udp_plugin_select_v4 (void *cls)
{
struct Plugin *plugin = cls;
-
+ const struct GNUNET_SCHEDULER_TaskContext *tc;
+
plugin->select_task_v4 = NULL;
- if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
- return;
if (NULL == plugin->sockv4)
return;
+ tc = GNUNET_SCHEDULER_get_task_context ();
if ((0 != (tc->reason & GNUNET_SCHEDULER_REASON_READ_READY)) &&
(GNUNET_NETWORK_fdset_isset (tc->read_ready,
plugin->sockv4)))
* Then reschedule this function to be called again once more is available.
*
* @param cls the plugin handle
- * @param tc the scheduling context
*/
static void
-udp_plugin_select_v6 (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+udp_plugin_select_v6 (void *cls)
{
struct Plugin *plugin = cls;
+ const struct GNUNET_SCHEDULER_TaskContext *tc;
plugin->select_task_v6 = NULL;
- if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
- return;
if (NULL == plugin->sockv6)
return;
+ tc = GNUNET_SCHEDULER_get_task_context ();
if ( (0 != (tc->reason & GNUNET_SCHEDULER_REASON_READ_READY)) &&
(GNUNET_NETWORK_fdset_isset (tc->read_ready,
plugin->sockv6)) )