gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r24343 - gnunet/src/transport


From: gnunet
Subject: [GNUnet-SVN] r24343 - gnunet/src/transport
Date: Tue, 16 Oct 2012 16:43:59 +0200

Author: wachs
Date: 2012-10-16 16:43:59 +0200 (Tue, 16 Oct 2012)
New Revision: 24343

Modified:
   gnunet/src/transport/plugin_transport_udp.c
   gnunet/src/transport/transport_api.c
Log:
changes

Modified: gnunet/src/transport/plugin_transport_udp.c
===================================================================
--- gnunet/src/transport/plugin_transport_udp.c 2012-10-16 14:30:22 UTC (rev 
24342)
+++ gnunet/src/transport/plugin_transport_udp.c 2012-10-16 14:43:59 UTC (rev 
24343)
@@ -706,6 +706,10 @@
                                   "# bytes overhead transmitted via UDP",
                                   udpw->msg_size - udpw->payload_size, 
GNUNET_NO);
         }
+        GNUNET_STATISTICS_update (plugin->env->stats,
+                              "# bytes payload transmitted via UDP",
+                              udpw->payload_size, GNUNET_NO);
+
         udpw->cont (udpw->cont_cls, &udpw->session->target, result,
                     udpw->payload_size, udpw->msg_size);
     }
@@ -1782,18 +1786,24 @@
     }
   }
 
+  GNUNET_STATISTICS_update (plugin->env->stats,
+                        "# bytes payload transmitted via UDP",
+                        s->frag_ctx->payload_size, GNUNET_NO);
+
+  if (s->frag_ctx->on_wire_size >= s->frag_ctx->payload_size)
+  {
+      GNUNET_STATISTICS_update (plugin->env->stats,
+                            "# bytes overhead transmitted via UDP",
+                            s->frag_ctx->on_wire_size - 
s->frag_ctx->payload_size, GNUNET_NO);
+  }
+
+
   if (s->frag_ctx->cont != NULL)
   {
     LOG (GNUNET_ERROR_TYPE_DEBUG,
         "Calling continuation for fragmented message to `%s' with result %s\n",
         GNUNET_i2s (&s->target), "OK");
 
-    if (s->frag_ctx->on_wire_size >= s->frag_ctx->payload_size)
-    {
-        GNUNET_STATISTICS_update (plugin->env->stats,
-                              "# bytes overhead transmitted via UDP",
-                              s->frag_ctx->on_wire_size - 
s->frag_ctx->payload_size, GNUNET_NO);
-    }
     s->frag_ctx->cont (s->frag_ctx->cont_cls, &udp_ack->sender, GNUNET_OK,
                        s->frag_ctx->payload_size, s->frag_ctx->on_wire_size);
   }

Modified: gnunet/src/transport/transport_api.c
===================================================================
--- gnunet/src/transport/transport_api.c        2012-10-16 14:30:22 UTC (rev 
24342)
+++ gnunet/src/transport/transport_api.c        2012-10-16 14:43:59 UTC (rev 
24343)
@@ -525,12 +525,11 @@
     if (n == NULL)
       break;
 
-    GNUNET_assert (0 == n->traffic_overhead);
     if (bytes_physical >= bytes_msg)
     {
         LOG (GNUNET_ERROR_TYPE_DEBUG, "Overhead for %u byte message: %u \n",
             bytes_msg, bytes_physical - bytes_msg);
-      n->traffic_overhead = bytes_physical - bytes_msg;
+      n->traffic_overhead += bytes_physical - bytes_msg;
     }
     GNUNET_break (GNUNET_NO == n->is_ready);
     n->is_ready = GNUNET_YES;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]