gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r4954 - GNUnet/src/applications/advertising


From: gnunet
Subject: [GNUnet-SVN] r4954 - GNUnet/src/applications/advertising
Date: Fri, 8 Jun 2007 13:11:38 -0600 (MDT)

Author: grothoff
Date: 2007-06-08 13:11:37 -0600 (Fri, 08 Jun 2007)
New Revision: 4954

Modified:
   GNUnet/src/applications/advertising/advertising.c
Log:
undo -- otherwise HELLO verification for non-NAT is meaningless -- argh

Modified: GNUnet/src/applications/advertising/advertising.c
===================================================================
--- GNUnet/src/applications/advertising/advertising.c   2007-06-08 18:58:51 UTC 
(rev 4953)
+++ GNUnet/src/applications/advertising/advertising.c   2007-06-08 19:11:37 UTC 
(rev 4954)
@@ -145,8 +145,8 @@
  */
 static int
 receivedhello(const PeerIdentity * sender,
-             const MESSAGE_HEADER * message,
-             TSession * tsession) {
+             const MESSAGE_HEADER * message) {
+  TSession * tsession;
   P2P_hello_MESSAGE * copy;
   PeerIdentity foreignId;
   const P2P_hello_MESSAGE * msg;
@@ -155,7 +155,6 @@
   int helloEnd;
   int mtu;
   int res;
-  int disconnect;
   cron_t now;
 
   /* first verify that it is actually a valid hello */
@@ -324,12 +323,8 @@
 
 
   /* Establish session as advertised in the hello */
-  disconnect = NO;
+  tsession = transport->connect(msg);
   if (tsession == NULL) {
-    tsession = transport->connect(msg);
-    disconnect = YES;
-  }
-  if (tsession == NULL) {
     if (stats != NULL)
       stats->change(stat_hello_no_transport, 1);
     return SYSERR; /* could not connect */
@@ -358,8 +353,7 @@
     GE_LOG(ectx,
           GE_INFO | GE_REQUEST | GE_USER,
           _("Could not send HELLO+PING, ping buffer full.\n"));
-    if (disconnect == YES)
-      transport->disconnect(tsession);
+    transport->disconnect(tsession);
     if (stats != NULL)
       stats->change(stat_hello_ping_busy, 1);
     return SYSERR;
@@ -380,8 +374,7 @@
     FREE(buffer);
     if (stats != NULL)
       stats->change(stat_hello_noselfad, 1);
-    if (disconnect == YES)
-      transport->disconnect(tsession);
+    transport->disconnect(tsession);
     return SYSERR;
   }
   res = OK;
@@ -406,8 +399,7 @@
       stats->change(stat_plaintextPingSent, 1);
   }
   FREE(buffer);
-  if ( (disconnect == YES) &&
-       (SYSERR == transport->disconnect(tsession)) )
+  if (SYSERR == transport->disconnect(tsession))
     res = SYSERR;
   return res;
 }
@@ -721,8 +713,7 @@
 ehelloHandler(const PeerIdentity * sender,
              const MESSAGE_HEADER * message) {
   if (OK == receivedhello(sender,
-                         message,
-                         NULL)) {
+                         message)) {
     /* if the hello was ok, update traffic preference
        for the peer (depending on how much we like
        to learn about other peers) */
@@ -740,8 +731,7 @@
              const MESSAGE_HEADER * message,
              TSession * session) {
   receivedhello(sender,
-               message,
-               session);
+               message);
   return OK;
 }
 





reply via email to

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