gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r31069 - gnunet/src/dv


From: gnunet
Subject: [GNUnet-SVN] r31069 - gnunet/src/dv
Date: Thu, 5 Dec 2013 14:01:41 +0100

Author: wachs
Date: 2013-12-05 14:01:41 +0100 (Thu, 05 Dec 2013)
New Revision: 31069

Modified:
   gnunet/src/dv/plugin_transport_dv.c
Log:
fix ats information on session start


Modified: gnunet/src/dv/plugin_transport_dv.c
===================================================================
--- gnunet/src/dv/plugin_transport_dv.c 2013-12-05 13:00:06 UTC (rev 31068)
+++ gnunet/src/dv/plugin_transport_dv.c 2013-12-05 13:01:41 UTC (rev 31069)
@@ -311,21 +311,26 @@
       notify_distance_change (session);
     return; /* nothing to do */
   }
+
   session = GNUNET_new (struct Session);
   session->sender = *peer;
   session->distance = distance;
   session->network = network;
-  GNUNET_assert (GNUNET_YES ==
-                GNUNET_CONTAINER_multipeermap_put (plugin->sessions,
-                                                   &session->sender,
-                                                   session,
-                                                   
GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY));
+  GNUNET_assert(
+      GNUNET_YES == GNUNET_CONTAINER_multipeermap_put (plugin->sessions,
+          &session->sender, session,
+          GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY));
 
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+      "Creating new session %p for peer `%s'\n",
+      session,
+      GNUNET_i2s (peer));
+
   /* Notify transport and ats about new connection */
   ats[0].type = htonl (GNUNET_ATS_QUALITY_NET_DISTANCE);
   ats[0].value = htonl (distance);
-  ats[0].type = htonl (GNUNET_ATS_NETWORK_TYPE);
-  ats[0].value = htonl (network);
+  ats[1].type = htonl (GNUNET_ATS_NETWORK_TYPE);
+  ats[1].value = htonl (network);
   plugin->env->session_start (plugin->env->cls, peer, PLUGIN_NAME, NULL, 0,
       session, ats, 2);
 }
@@ -380,6 +385,12 @@
                 GNUNET_CONTAINER_multipeermap_remove (plugin->sessions,
                                                       &session->sender,
                                                       session));
+
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+      "Freeing session %p for peer `%s'\n",
+      session,
+      GNUNET_i2s (&session->sender));
+
   if (GNUNET_YES == session->active)
     plugin->env->session_end (plugin->env->cls,
                              &session->sender,




reply via email to

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