[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r26268 - gnunet/src/core
From: |
gnunet |
Subject: |
[GNUnet-SVN] r26268 - gnunet/src/core |
Date: |
Sun, 3 Mar 2013 09:14:37 +0100 |
Author: grothoff
Date: 2013-03-03 09:14:37 +0100 (Sun, 03 Mar 2013)
New Revision: 26268
Modified:
gnunet/src/core/gnunet-service-core_kx.c
gnunet/src/core/gnunet-service-core_sessions.c
gnunet/src/core/gnunet-service-core_typemap.c
Log:
reduce messages in initial KX
Modified: gnunet/src/core/gnunet-service-core_kx.c
===================================================================
--- gnunet/src/core/gnunet-service-core_kx.c 2013-03-03 01:58:11 UTC (rev
26267)
+++ gnunet/src/core/gnunet-service-core_kx.c 2013-03-03 08:14:37 UTC (rev
26268)
@@ -671,8 +671,15 @@
GNUNET_CONTAINER_DLL_insert (kx_head,
kx_tail,
kx);
- kx->status = KX_STATE_KEY_SENT;
- send_key (kx);
+ if (0 < GNUNET_CRYPTO_hash_cmp (&pid->hashPubKey,
+ &GSC_my_identity.hashPubKey))
+ {
+ /* 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);
+ }
return kx;
}
Modified: gnunet/src/core/gnunet-service-core_sessions.c
===================================================================
--- gnunet/src/core/gnunet-service-core_sessions.c 2013-03-03 01:58:11 UTC
(rev 26267)
+++ gnunet/src/core/gnunet-service-core_sessions.c 2013-03-03 08:14:37 UTC
(rev 26268)
@@ -37,7 +37,12 @@
*/
#define TYPEMAP_FREQUENCY GNUNET_TIME_relative_multiply
(GNUNET_TIME_UNIT_MINUTES, 5)
+/**
+ * How often do we transmit our typemap on first attempt?
+ */
+#define TYPEMAP_FREQUENCY_FIRST GNUNET_TIME_relative_multiply
(GNUNET_TIME_UNIT_SECONDS, 5)
+
/**
* Message ready for encryption. This struct is followed by the
* actual content of the message.
@@ -227,7 +232,7 @@
if (0 == session->first_typemap)
{
- delay = GNUNET_TIME_UNIT_ZERO;
+ delay = TYPEMAP_FREQUENCY_FIRST;
session->first_typemap = 1;
}
else
Modified: gnunet/src/core/gnunet-service-core_typemap.c
===================================================================
--- gnunet/src/core/gnunet-service-core_typemap.c 2013-03-03 01:58:11 UTC
(rev 26267)
+++ gnunet/src/core/gnunet-service-core_typemap.c 2013-03-03 08:14:37 UTC
(rev 26268)
@@ -146,6 +146,8 @@
{
struct GNUNET_MessageHeader *hdr;
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "broadcasting typemap\n");
hdr = GSC_TYPEMAP_compute_type_map_message ();
GNUNET_STATISTICS_update (GSC_stats,
gettext_noop ("# updates to my type map"), 1,
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r26268 - gnunet/src/core,
gnunet <=