gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r13677 - gnunet/src/core


From: gnunet
Subject: [GNUnet-SVN] r13677 - gnunet/src/core
Date: Sun, 14 Nov 2010 14:31:59 +0100

Author: grothoff
Date: 2010-11-14 14:31:59 +0100 (Sun, 14 Nov 2010)
New Revision: 13677

Modified:
   gnunet/src/core/core_api.c
   gnunet/src/core/test_core_api.c
Log:
more checks

Modified: gnunet/src/core/core_api.c
===================================================================
--- gnunet/src/core/core_api.c  2010-11-14 13:26:50 UTC (rev 13676)
+++ gnunet/src/core/core_api.c  2010-11-14 13:31:59 UTC (rev 13677)
@@ -819,10 +819,6 @@
       m = (const struct InitReplyMessage *) msg;
       GNUNET_break (0 == ntohl (m->reserved));
       /* start our message processing loop */
-#if DEBUG_CORE
-      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                 "Successfully connected to core service, starting processing 
loop.\n");
-#endif
       if (GNUNET_YES == h->currently_down)
        {
          h->currently_down = GNUNET_NO;
@@ -837,8 +833,20 @@
                              sizeof (struct
                                      GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded),
                              &h->me.hashPubKey);
+#if DEBUG_CORE
+         GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                     "Connected to core service of peer `%s'.\n",
+                     GNUNET_i2s (&h->me));
+#endif
          init (h->cls, h, &h->me, &m->publicKey);
        }
+      else
+       {
+#if DEBUG_CORE
+         GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                     "Successfully reconnected to core service.\n");
+#endif
+       }
       break;
     case GNUNET_MESSAGE_TYPE_CORE_NOTIFY_CONNECT:
       if (msize != sizeof (struct ConnectNotifyMessage))

Modified: gnunet/src/core/test_core_api.c
===================================================================
--- gnunet/src/core/test_core_api.c     2010-11-14 13:26:50 UTC (rev 13676)
+++ gnunet/src/core/test_core_api.c     2010-11-14 13:31:59 UTC (rev 13677)
@@ -34,7 +34,7 @@
 #include "gnunet_scheduler_lib.h"
 #include "gnunet_transport_service.h"
 
-#define VERBOSE GNUNET_NO
+#define VERBOSE GNUNET_YES
 
 #define START_ARM GNUNET_YES
 
@@ -123,25 +123,29 @@
                const struct GNUNET_TRANSPORT_ATS_Information *atsi)
 {
   struct PeerContext *pc = cls;
+
   GNUNET_assert (pc->connect_status == 0);
   pc->connect_status = 1;
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Encrypted connection established to peer `%4s'\n",
-              GNUNET_i2s (peer));
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-             "Asking core (1) for transmission to peer `%4s'\n",
-             GNUNET_i2s (&p2.id));
-  if (NULL == GNUNET_CORE_notify_transmit_ready (p1.ch,
-                                                0,
-                                                GNUNET_TIME_relative_multiply 
(GNUNET_TIME_UNIT_SECONDS, 45),
-                                                &p2.id,
-                                                sizeof (struct 
GNUNET_MessageHeader),
-                                                &transmit_ready, &p1))
+  if (pc == &p1)
     {
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                 "RECEIVED NULL when asking core (1) for transmission to peer 
`%4s'\n",
+                 "Encrypted connection established to peer `%4s'\n",
+                 GNUNET_i2s (peer));
+      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                 "Asking core (1) for transmission to peer `%4s'\n",
                  GNUNET_i2s (&p2.id));
-    }  
+      if (NULL == GNUNET_CORE_notify_transmit_ready (p1.ch,
+                                                    0,
+                                                    
GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 45),
+                                                    &p2.id,
+                                                    sizeof (struct 
GNUNET_MessageHeader),
+                                                    &transmit_ready, &p1))
+       {
+         GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                     "RECEIVED NULL when asking core (1) for transmission to 
peer `%4s'\n",
+                     GNUNET_i2s (&p2.id));
+       }  
+    }
 }
 
 
@@ -150,6 +154,7 @@
                    const struct GNUNET_PeerIdentity *peer)
 {
   struct PeerContext *pc = cls;
+
   pc->connect_status = 0;
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Encrypted connection to `%4s' cut\n", GNUNET_i2s (peer));




reply via email to

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