gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r23300 - gnunet/src/mesh


From: gnunet
Subject: [GNUnet-SVN] r23300 - gnunet/src/mesh
Date: Sat, 18 Aug 2012 13:34:30 +0200

Author: bartpolot
Date: 2012-08-18 13:34:30 +0200 (Sat, 18 Aug 2012)
New Revision: 23300

Modified:
   gnunet/src/mesh/gnunet-service-mesh.c
   gnunet/src/mesh/mesh.h
   gnunet/src/mesh/mesh_api.c
Log:
- use window size client<->server, x4 faster

Modified: gnunet/src/mesh/gnunet-service-mesh.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh.c       2012-08-18 11:00:23 UTC (rev 
23299)
+++ gnunet/src/mesh/gnunet-service-mesh.c       2012-08-18 11:34:30 UTC (rev 
23300)
@@ -5002,7 +5002,7 @@
   GNUNET_CONTAINER_multihashmap_iterate (t->children_fc,
                                          &tunnel_add_skip,
                                          &neighbor);
-  if (GMC_is_pid_bigger (pid, cinfo->fwd_ack))
+  if (GNUNET_YES == GMC_is_pid_bigger (pid, cinfo->fwd_ack))
   {
     GNUNET_STATISTICS_update (stats, "# unsolicited unicast", 1, GNUNET_NO);
     GNUNET_break_op (0);

Modified: gnunet/src/mesh/mesh.h
===================================================================
--- gnunet/src/mesh/mesh.h      2012-08-18 11:00:23 UTC (rev 23299)
+++ gnunet/src/mesh/mesh.h      2012-08-18 11:34:30 UTC (rev 23300)
@@ -29,7 +29,7 @@
 
 #define MESH_DEBUG              GNUNET_YES
 
-#define INITIAL_WINDOW_SIZE     2
+#define INITIAL_WINDOW_SIZE     8
 #define ACK_THRESHOLD           INITIAL_WINDOW_SIZE / 2
 
 #include "platform.h"

Modified: gnunet/src/mesh/mesh_api.c
===================================================================
--- gnunet/src/mesh/mesh_api.c  2012-08-18 11:00:23 UTC (rev 23299)
+++ gnunet/src/mesh/mesh_api.c  2012-08-18 11:34:30 UTC (rev 23300)
@@ -698,11 +698,11 @@
 
   LOG (GNUNET_ERROR_TYPE_DEBUG,
        "Sending ACK on tunnel %X: %u\n",
-       t->tid, t->last_recv_pid + 1);
+       t->tid, t->last_recv_pid + INITIAL_WINDOW_SIZE);
   msg.header.type = htons (GNUNET_MESSAGE_TYPE_MESH_LOCAL_ACK);
   msg.header.size = htons (sizeof (msg));
   msg.tunnel_id = htonl (t->tid);
-  msg.max_pid = htonl (t->last_recv_pid + 1);
+  msg.max_pid = htonl (t->last_recv_pid + INITIAL_WINDOW_SIZE);
 
   send_packet (h, &msg.header, t);
   return;
@@ -1128,7 +1128,8 @@
     LOG (GNUNET_ERROR_TYPE_DEBUG, "  ignored!\n");
     return GNUNET_YES;
   }
-  if (GMC_is_pid_bigger(pid, t->last_recv_pid + 1))
+    if (GNUNET_YES ==
+        GMC_is_pid_bigger(pid, t->last_recv_pid + INITIAL_WINDOW_SIZE))
   {
     GNUNET_break (0);
     LOG (GNUNET_ERROR_TYPE_WARNING, "  unauthorized message!\n");
@@ -1194,7 +1195,7 @@
   }
   ack = ntohl (msg->max_pid);
   LOG (GNUNET_ERROR_TYPE_DEBUG, "  on tunnel %X, ack %u!\n", t->tid, ack);
-  if (ack > t->max_send_pid || PID_OVERFLOW (t->max_send_pid, ack))
+  if (GNUNET_YES == GMC_is_pid_bigger(ack, t->max_send_pid))
     t->max_send_pid = ack;
   else
     return;




reply via email to

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