[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r24430 - gnunet/src/transport
From: |
gnunet |
Subject: |
[GNUnet-SVN] r24430 - gnunet/src/transport |
Date: |
Fri, 19 Oct 2012 16:59:57 +0200 |
Author: wachs
Date: 2012-10-19 16:59:57 +0200 (Fri, 19 Oct 2012)
New Revision: 24430
Modified:
gnunet/src/transport/plugin_transport_udp.c
Log:
- dangerous things for a friday: fragmented message timeout
Modified: gnunet/src/transport/plugin_transport_udp.c
===================================================================
--- gnunet/src/transport/plugin_transport_udp.c 2012-10-19 14:32:36 UTC (rev
24429)
+++ gnunet/src/transport/plugin_transport_udp.c 2012-10-19 14:59:57 UTC (rev
24430)
@@ -712,6 +712,7 @@
call_continuation (struct UDP_MessageWrapper *udpw, int result)
{
size_t overhead;
+ struct UDP_MessageWrapper dummy;
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Calling continuation for %u byte message to `%s' with result %s\n",
@@ -750,6 +751,7 @@
udpw->payload_size, GNUNET_NO);
break;
case MSG_FRAGMENTED_COMPLETE:
+ GNUNET_assert (NULL != udpw->frag_ctx);
if (udpw->frag_ctx->cont != NULL)
udpw->frag_ctx->cont (udpw->frag_ctx->cont_cls,
&udpw->session->target, GNUNET_OK,
udpw->frag_ctx->payload_size,
udpw->frag_ctx->on_wire_size);
@@ -768,6 +770,9 @@
GNUNET_STATISTICS_update (plugin->env->stats,
"# UDP, total, bytes payload, sent",
udpw->payload_size, GNUNET_NO);
+ GNUNET_STATISTICS_update (plugin->env->stats,
+ "# UDP, fragmented msgs, messages,
pending",
+ -1, GNUNET_NO);
break;
case MSG_FRAGMENTED:
/* Fragmented message: enqueue next fragment */
@@ -780,9 +785,6 @@
GNUNET_STATISTICS_update (plugin->env->stats,
"# UDP, fragmented msgs, fragments bytes,
sent, success",
udpw->msg_size, GNUNET_NO);
- GNUNET_STATISTICS_update (plugin->env->stats,
- "# UDP, fragmented msgs, messages,
pending",
- -1, GNUNET_NO);
break;
case MSG_ACK:
/* No continuation */
@@ -824,8 +826,9 @@
overhead, GNUNET_NO);
break;
case MSG_FRAGMENTED_COMPLETE:
+ GNUNET_assert (NULL != udpw->frag_ctx);
if (udpw->frag_ctx->cont != NULL)
- udpw->frag_ctx->cont (udpw->frag_ctx->cont_cls,
&udpw->session->target, GNUNET_OK,
+ udpw->frag_ctx->cont (udpw->frag_ctx->cont_cls,
&udpw->session->target, GNUNET_SYSERR,
udpw->frag_ctx->payload_size,
udpw->frag_ctx->on_wire_size);
GNUNET_STATISTICS_update (plugin->env->stats,
"# UDP, fragmented msgs, messages, sent,
failure",
@@ -836,8 +839,15 @@
GNUNET_STATISTICS_update (plugin->env->stats,
"# UDP, fragmented msgs, bytes payload,
sent, failure",
overhead, GNUNET_NO);
+ GNUNET_STATISTICS_update (plugin->env->stats,
+ "# UDP, fragmented msgs, bytes payload,
sent, failure",
+ overhead, GNUNET_NO);
+ GNUNET_STATISTICS_update (plugin->env->stats,
+ "# UDP, fragmented msgs, messages,
pending",
+ -1, GNUNET_NO);
break;
case MSG_FRAGMENTED:
+ GNUNET_assert (NULL != udpw->frag_ctx);
/* Fragmented message: failed to send */
GNUNET_STATISTICS_update (plugin->env->stats,
"# UDP, fragmented msgs, fragments, sent,
failure",
@@ -846,6 +856,14 @@
"# UDP, fragmented msgs, fragments bytes,
sent, failure",
udpw->msg_size, GNUNET_NO);
+ dummy.msg_type = MSG_FRAGMENTED_COMPLETE;
+ dummy.msg_buf = NULL;
+ dummy.msg_size = udpw->frag_ctx->on_wire_size;
+ dummy.payload_size = udpw->frag_ctx->payload_size;
+ dummy.frag_ctx = udpw->frag_ctx;
+ dummy.session = udpw->session;
+ call_continuation (&dummy, GNUNET_SYSERR);
+
break;
case MSG_ACK:
/* ACK message: failed to send */
@@ -1992,10 +2010,6 @@
dummy.frag_ctx = s->frag_ctx;
dummy.session = s;
- GNUNET_STATISTICS_update (plugin->env->stats,
- "# UDP, fragmented msgs, messages, pending",
- -1, GNUNET_NO);
-
call_continuation (&dummy, GNUNET_OK);
GNUNET_free (s->frag_ctx);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r24430 - gnunet/src/transport,
gnunet <=