gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r25915 - gnunet/src/dht


From: gnunet
Subject: [GNUnet-SVN] r25915 - gnunet/src/dht
Date: Fri, 25 Jan 2013 18:42:22 +0100

Author: bartpolot
Date: 2013-01-25 18:42:22 +0100 (Fri, 25 Jan 2013)
New Revision: 25915

Modified:
   gnunet/src/dht/dht_api.c
Log:
- fixed crash in case of DHT_disconnect called from a DHT_get iterator

Modified: gnunet/src/dht/dht_api.c
===================================================================
--- gnunet/src/dht/dht_api.c    2013-01-25 17:19:05 UTC (rev 25914)
+++ gnunet/src/dht/dht_api.c    2013-01-25 17:42:22 UTC (rev 25915)
@@ -900,6 +900,8 @@
     do_disconnect (handle);
     return;
   }
+  GNUNET_CLIENT_receive (handle->client, &service_message_handler, handle,
+                         GNUNET_TIME_UNIT_FOREVER_REL);
   ret = GNUNET_SYSERR;
   msize = ntohs (msg->size);
   switch (ntohs (msg->type))
@@ -941,13 +943,15 @@
       GNUNET_break (0);
       break;
     }
-    ret = GNUNET_OK;
     dht_msg = (const struct GNUNET_DHT_ClientResultMessage *) msg;
-    LOG (GNUNET_ERROR_TYPE_DEBUG, "Received reply for `%s' from DHT service 
%p\n",
-        GNUNET_h2s (&dht_msg->key), handle);
+    LOG (GNUNET_ERROR_TYPE_DEBUG,
+         "Received reply for `%s' from DHT service %p\n",
+         GNUNET_h2s (&dht_msg->key), handle);
     GNUNET_CONTAINER_multihashmap_get_multiple (handle->active_requests,
-                                               &dht_msg->key, &process_reply,
-                                               (void *) dht_msg);
+                                                      &dht_msg->key,
+                                                      &process_reply,
+                                                      (void *) dht_msg);
+    ret = GNUNET_OK;
     break;
   case GNUNET_MESSAGE_TYPE_DHT_CLIENT_PUT_OK:
     if (ntohs (msg->size) != sizeof (struct 
GNUNET_DHT_ClientPutConfirmationMessage))
@@ -971,8 +975,6 @@
     do_disconnect (handle);
     return;
   }
-  GNUNET_CLIENT_receive (handle->client, &service_message_handler, handle,
-                         GNUNET_TIME_UNIT_FOREVER_REL);
 }
 
 




reply via email to

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