gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r11511 - gnunet/src/transport


From: gnunet
Subject: [GNUnet-SVN] r11511 - gnunet/src/transport
Date: Tue, 25 May 2010 18:22:59 +0200

Author: grothoff
Date: 2010-05-25 18:22:59 +0200 (Tue, 25 May 2010)
New Revision: 11511

Modified:
   gnunet/src/transport/gnunet-service-transport.c
Log:
better clean up

Modified: gnunet/src/transport/gnunet-service-transport.c
===================================================================
--- gnunet/src/transport/gnunet-service-transport.c     2010-05-25 16:04:21 UTC 
(rev 11510)
+++ gnunet/src/transport/gnunet-service-transport.c     2010-05-25 16:22:59 UTC 
(rev 11511)
@@ -2410,6 +2410,7 @@
                                       va->chvc);
          GNUNET_free (va->chvc);
        }
+      va->chvc = NULL;
     }
   GNUNET_free (va);
   return GNUNET_YES;
@@ -3476,12 +3477,19 @@
   uint16_t hello_size;
   size_t tsize;
   char * message_buf;
+  struct GNUNET_PeerIdentity id;
 
+  GNUNET_CRYPTO_hash (&va->publicKey,
+                     sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded),
+                     &id.hashPubKey);
   if (neighbour == NULL)
     {
       /* FIXME: stats... */
-      GNUNET_free (va->transport_name);
-      GNUNET_free (va);
+      GNUNET_break (GNUNET_OK ==
+                   GNUNET_CONTAINER_multihashmap_remove (validation_map,
+                                                         &id.hashPubKey,
+                                                         va));
+      abort_validation (NULL, NULL, va);
       return;
     }
   neighbour->publicKey = va->publicKey;
@@ -3496,8 +3504,11 @@
                   "Failed to add peer `%4s' for plugin `%s'\n",
                   GNUNET_i2s (&neighbour->id), 
                  va->transport_name);
-      GNUNET_free (va->transport_name);
-      GNUNET_free (va);
+      GNUNET_break (GNUNET_OK ==
+                   GNUNET_CONTAINER_multihashmap_remove (validation_map,
+                                                         &id.hashPubKey,
+                                                         va));
+      abort_validation (NULL, NULL, va);
       return;
     }
   hello_size = GNUNET_HELLO_size(our_hello);
@@ -3693,6 +3704,7 @@
   if (peer == NULL)
     {
       chvc->piter = NULL;
+      chvc->ve_count++;
       if (GNUNET_NO == chvc->hello_known)
        {
          /* notify PEERINFO about the peer now, so that we at least
@@ -3728,6 +3740,7 @@
                                    1,
                                    GNUNET_NO);      
        }
+      chvc->ve_count--;
       if (chvc->ve_count == 0)
        {
          GNUNET_CONTAINER_DLL_remove (chvc_head,




reply via email to

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