gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r4868 - in GNUnet: . contrib src/applications/advertising s


From: gnunet
Subject: [GNUnet-SVN] r4868 - in GNUnet: . contrib src/applications/advertising src/server src/transports src/util/network
Date: Tue, 29 May 2007 23:17:12 -0600 (MDT)

Author: grothoff
Date: 2007-05-29 23:17:12 -0600 (Tue, 29 May 2007)
New Revision: 4868

Modified:
   GNUnet/ChangeLog
   GNUnet/contrib/config-daemon.scm
   GNUnet/src/applications/advertising/advertising_test.c
   GNUnet/src/server/connection.c
   GNUnet/src/transports/tcp.c
   GNUnet/src/transports/tcp6.c
   GNUnet/src/util/network/select.c
   GNUnet/todo
Log:
fixing peer discovery/advertising/connection management issues

Modified: GNUnet/ChangeLog
===================================================================
--- GNUnet/ChangeLog    2007-05-30 03:41:11 UTC (rev 4867)
+++ GNUnet/ChangeLog    2007-05-30 05:17:12 UTC (rev 4868)
@@ -1,3 +1,11 @@
+Tue May 29 23:15:27 MDT 2007
+       Fixed a major bug which resulted in peers without
+       traffic between them disconnecting (even if that
+       session was their only connection).  
+       Fixed another major bug where nodes would not
+       properly forward HELLOs from other peers (given
+       certain common/default configuration options).
+
 Sun May 27 22:39:48 MDT 2007
        Added new API gnunet_testing_lib.h to make it
        easier to write testcases that need to start 

Modified: GNUnet/contrib/config-daemon.scm
===================================================================
--- GNUnet/contrib/config-daemon.scm    2007-05-30 03:41:11 UTC (rev 4867)
+++ GNUnet/contrib/config-daemon.scm    2007-05-30 05:17:12 UTC (rev 4868)
@@ -427,7 +427,7 @@
  "NETWORK"
  "HELLOEXCHANGE"
  (_ "Disable advertising of other peers by this peer")
- (nohelp)
+ (_ "This option maybe useful during testing, but turning it off is dangerous! 
If in any doubt, set it to YES (which is the default).")
  '()
  #t
  #f

Modified: GNUnet/src/applications/advertising/advertising_test.c
===================================================================
--- GNUnet/src/applications/advertising/advertising_test.c      2007-05-30 
03:41:11 UTC (rev 4867)
+++ GNUnet/src/applications/advertising/advertising_test.c      2007-05-30 
05:17:12 UTC (rev 4868)
@@ -40,7 +40,7 @@
 
 #define NUM_PEERS 12
 
-#define NUM_ROUNDS 10
+#define NUM_ROUNDS 100
 
 static int countConnections(const char * name,
                            unsigned long long value,
@@ -54,8 +54,6 @@
   return OK;
 }
 
-#define CHECK(a) do { if (!(a)) { ret = 1; GE_BREAK(ectx, 0); goto FAILURE; } 
} while(0)
-
 /**
  * Testcase to test advertising
  * @return 0: ok, -1: error

Modified: GNUnet/src/server/connection.c
===================================================================
--- GNUnet/src/server/connection.c      2007-05-30 03:41:11 UTC (rev 4867)
+++ GNUnet/src/server/connection.c      2007-05-30 05:17:12 UTC (rev 4868)
@@ -87,7 +87,8 @@
 
 /**
  * If an established connection is inactive for 5 minutes,
- * drop.
+ * drop.  Needs to be smaller than timeouts in the
+ * transports.
  */
 #define SECONDS_INACTIVE_DROP 300
 
@@ -1551,9 +1552,19 @@
   }
   GE_ASSERT(ectx,
            totalMessageSize > sizeof(P2P_PACKET_HEADER));
-  if (YES != transport->testWouldTry(be->session.tsession,                     
        
-                                    totalMessageSize,
-                                    (priority >= EXTREME_PRIORITY) ? YES : 
NO)) {
+  ret = transport->testWouldTry(be->session.tsession,                          
+                               totalMessageSize,
+                               (priority >= EXTREME_PRIORITY) ? YES : NO);
+  /* ret: YES: ok to send, NO: not ready yet, SYSERR: session down 
+          or serious internal error */
+  if (ret == SYSERR) {
+    /* transport session is gone! re-establish! */
+    transport->disconnect(be->session.tsession);
+    be->session.tsession = NULL;
+    if (OK == ensureTransportConnected(be)) 
+      ret = YES;
+  } 
+  if (YES != ret) {
     /* transport's buffer full -- no point in
        creating the actual message! */
     expireSendBufferEntries(be);

Modified: GNUnet/src/transports/tcp.c
===================================================================
--- GNUnet/src/transports/tcp.c 2007-05-30 03:41:11 UTC (rev 4867)
+++ GNUnet/src/transports/tcp.c 2007-05-30 05:17:12 UTC (rev 4868)
@@ -37,8 +37,11 @@
 /**
  * after how much time of the core not being associated with a tcp
  * connection anymore do we close it?
+ * 
+ * Needs to be larger than SECONDS_INACTIVE_DROP in
+ * core's connection.s
  */
-#define TCP_TIMEOUT (30 * cronSECONDS)
+#define TCP_TIMEOUT (600 * cronSECONDS)
 
 #define TARGET_BUFFER_SIZE 4092
 

Modified: GNUnet/src/transports/tcp6.c
===================================================================
--- GNUnet/src/transports/tcp6.c        2007-05-30 03:41:11 UTC (rev 4867)
+++ GNUnet/src/transports/tcp6.c        2007-05-30 05:17:12 UTC (rev 4868)
@@ -36,8 +36,11 @@
 /**
  * after how much time of the core not being associated with a tcp6
  * connection anymore do we close it?
+ * 
+ * Needs to be larger than SECONDS_INACTIVE_DROP in
+ * core's connection.s
  */
-#define TCP6_TIMEOUT 30 * cronSECONDS
+#define TCP6_TIMEOUT 600 * cronSECONDS
 
 #define TARGET_BUFFER_SIZE 4092
 

Modified: GNUnet/src/util/network/select.c
===================================================================
--- GNUnet/src/util/network/select.c    2007-05-30 03:41:11 UTC (rev 4867)
+++ GNUnet/src/util/network/select.c    2007-05-30 05:17:12 UTC (rev 4868)
@@ -395,6 +395,14 @@
        /* free compaction! */
        session->wspos = 0;
        session->wapos = 0;
+       if (session->wsize > sh->memory_quota) {
+         /* if we went over quota before because of
+            force, use this opportunity to shrink
+            back to size! */
+         GROW(session->wbuff,
+              session->wsize,
+              sh->memory_quota);
+       }
       }
       break;
     }
@@ -962,7 +970,8 @@
   }
   GE_ASSERT(NULL, session->wapos >= session->wspos);
   if ( (sh->memory_quota > 0) &&
-       (session->wapos - session->wspos + len > sh->memory_quota) ) {
+       (session->wapos - session->wspos + len > sh->memory_quota) &&
+       (force == NO) ) {
     /* not enough free space, not allowed to grow that much */
     MUTEX_UNLOCK(sh->lock);
     return NO;
@@ -985,7 +994,8 @@
       while (newBufferSize < len + session->wapos - session->wspos)
        newBufferSize *= 2;
       if ( (sh->memory_quota > 0) &&
-          (newBufferSize > sh->memory_quota) )
+          (newBufferSize > sh->memory_quota) &&
+          (force == NO) )
        newBufferSize = sh->memory_quota;
       GE_ASSERT(NULL, 
                newBufferSize >= len + session->wapos - session->wspos);
@@ -1045,7 +1055,8 @@
   }
   GE_ASSERT(NULL, session->wapos >= session->wspos);
   if ( (sh->memory_quota > 0) &&
-       (session->wapos - session->wspos + size > sh->memory_quota) ) {
+       (session->wapos - session->wspos + size > sh->memory_quota) &&
+       (force == NO) ) {
     /* not enough free space, not allowed to grow that much */
     MUTEX_UNLOCK(sh->lock);
     return NO;

Modified: GNUnet/todo
===================================================================
--- GNUnet/todo 2007-05-30 03:41:11 UTC (rev 4867)
+++ GNUnet/todo 2007-05-30 05:17:12 UTC (rev 4868)
@@ -12,6 +12,11 @@
 
 
 0.7.2 [5'07]:
+- bugs: 
+  * transport needs a way to signal core persistent
+    transport errors (i.e., tcp connection closed)
+  * TCP connections are lost after 30 due to time out!
+    => connection timeout should be LONGER than timeout in core!
 - new features:
   * XFS -- TEST more! [RC] 
   * HTTP transport (libcurl, libmicrohttpd)





reply via email to

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