- fix
authorMatthias Wachs <wachs@net.in.tum.de>
Tue, 23 Oct 2012 15:01:43 +0000 (15:01 +0000)
committerMatthias Wachs <wachs@net.in.tum.de>
Tue, 23 Oct 2012 15:01:43 +0000 (15:01 +0000)
src/transport/plugin_transport_udp.c
src/transport/template_cfg_peer1.conf
src/transport/template_cfg_peer2.conf

index f67bbd915600bc0319b34d6c8d4a54eb1f0f4696..0b858a51f15d97a56e686f9181a1da79264d3196 100644 (file)
@@ -717,7 +717,6 @@ static void
 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",
@@ -860,15 +859,6 @@ call_continuation (struct UDP_MessageWrapper *udpw, int result)
           GNUNET_STATISTICS_update (plugin->env->stats,
                                     "# 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 */
@@ -1977,9 +1967,6 @@ read_process_ack (struct Plugin *plugin,
                  char *addr,
                  socklen_t fromlen)
 {
-  struct UDP_MessageWrapper dummy;
-  struct UDP_MessageWrapper *udpw;
-  struct UDP_MessageWrapper *tmp;
   const struct GNUNET_MessageHeader *ack;
   const struct UDP_ACK_Message *udp_ack;
   struct LookupContext l_ctx;
@@ -2202,19 +2189,31 @@ remove_timeout_messages_and_select (struct UDP_MessageWrapper *head,
     if (GNUNET_TIME_UNIT_ZERO.rel_value == remaining.rel_value)
     {
       /* Message timed out */
-      call_continuation (udpw, GNUNET_SYSERR);
       switch (udpw->msg_type) {
         case MSG_UNFRAGMENTED:
+          GNUNET_STATISTICS_update (plugin->env->stats,
+                                    "# UDP, total, bytes, sent, timeout",
+                                    udpw->msg_size, GNUNET_NO);
+          GNUNET_STATISTICS_update (plugin->env->stats,
+                                    "# UDP, total, messages, sent, timeout",
+                                    1, GNUNET_NO);
           /* Not fragmented message */
           LOG (GNUNET_ERROR_TYPE_DEBUG,
                "Message for peer `%s' with size %u timed out\n",
                GNUNET_i2s(&udpw->session->target), udpw->payload_size);
+          call_continuation (udpw, GNUNET_SYSERR);
           /* Remove message */
           dequeue (plugin, udpw);
           GNUNET_free (udpw);
           break;
         case MSG_FRAGMENTED:
           /* Fragmented message */
+          GNUNET_STATISTICS_update (plugin->env->stats,
+                                    "# UDP, total, bytes, sent, timeout",
+                                    udpw->frag_ctx->on_wire_size, GNUNET_NO);
+          GNUNET_STATISTICS_update (plugin->env->stats,
+                                    "# UDP, total, messages, sent, timeout",
+                                    1, GNUNET_NO);
           call_continuation (udpw, GNUNET_SYSERR);
           LOG (GNUNET_ERROR_TYPE_DEBUG,
                "Fragment for message for peer `%s' with size %u timed out\n",
@@ -2224,9 +2223,16 @@ remove_timeout_messages_and_select (struct UDP_MessageWrapper *head,
           fragmented_message_done (udpw->frag_ctx, GNUNET_SYSERR);
           break;
         case MSG_ACK:
+          GNUNET_STATISTICS_update (plugin->env->stats,
+                                    "# UDP, total, bytes, sent, timeout",
+                                    udpw->msg_size, GNUNET_NO);
+          GNUNET_STATISTICS_update (plugin->env->stats,
+                                    "# UDP, total, messages, sent, timeout",
+                                    1, GNUNET_NO);
           LOG (GNUNET_ERROR_TYPE_DEBUG,
                "ACK Message for peer `%s' with size %u timed out\n",
                GNUNET_i2s(&udpw->session->target), udpw->payload_size);
+          call_continuation (udpw, GNUNET_SYSERR);
           dequeue (plugin, udpw);
           GNUNET_free (udpw);
           break;
index 05309d53cedb636efd19019f86a4852930e14681..3b2ad6f943a4f2814daf8e27614f04b0d05bbab5 100644 (file)
@@ -37,7 +37,7 @@ PORT = 12002
 UNIXPATH = /tmp/gnunet-p1-service-peerinfo.sock
 
 [transport]
-#PREFIX = valgrind --leak-check=full
+PREFIX = valgrind --leak-check=full
 PORT = 12001
 #DEBUG = YES
 UNIXPATH = /tmp/gnunet-p1-service-transport.sock
index 210ee51c50707bbe36928a7ad84fd2f64d91fcd1..017266d099881ea64aeb3f9e1a17a0e9ddf96dba 100644 (file)
@@ -38,7 +38,7 @@ UNIXPATH = /tmp/gnunet-p2-service-peerinfo.sock
 TRUST = $SERVICEHOME/data/credit/
 
 [transport]
-#PREFIX = valgrind --leak-check=full
+PREFIX = valgrind --leak-check=full
 PORT = 12010
 UNIXPATH = /tmp/gnunet-p2-service-transport.sock