gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r31309 - gnunet/src/core
Date: Thu, 12 Dec 2013 16:01:43 +0100

Author: wachs
Date: 2013-12-12 16:01:43 +0100 (Thu, 12 Dec 2013)
New Revision: 31309

Modified:
   gnunet/src/core/gnunet-service-core_kx.c
Log:
fix for core key exchange


Modified: gnunet/src/core/gnunet-service-core_kx.c
===================================================================
--- gnunet/src/core/gnunet-service-core_kx.c    2013-12-12 14:27:18 UTC (rev 
31308)
+++ gnunet/src/core/gnunet-service-core_kx.c    2013-12-12 15:01:43 UTC (rev 
31309)
@@ -676,15 +676,22 @@
   GNUNET_CRYPTO_hash (pid, sizeof (struct GNUNET_PeerIdentity), &h1);
   GNUNET_CRYPTO_hash (&GSC_my_identity, sizeof (struct GNUNET_PeerIdentity), 
&h2);
 
+  kx->status = KX_STATE_KEY_SENT;
   if (0 < GNUNET_CRYPTO_hash_cmp (&h1,
                                  &h2))
   {
     /* peer with "lower" identity starts KX, otherwise we typically end up
        with both peers starting the exchange and transmit the 'set key'
        message twice */
-    kx->status = KX_STATE_KEY_SENT;
     send_key (kx);
   }
+  else
+  {
+    /* peer with "higher" identity starts a delayed  KX, if the "lower" peer
+     * does not start a KX since he sees no reasons to do so  */
+    kx->retry_set_key_task = GNUNET_SCHEDULER_add_delayed 
(GNUNET_TIME_UNIT_SECONDS,
+          &set_key_retry_task, kx);
+  }
   return kx;
 }
 




reply via email to

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