aboutsummaryrefslogtreecommitdiff
path: root/src/dht/dht_api.c
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2013-01-25 17:42:22 +0000
committerBart Polot <bart@net.in.tum.de>2013-01-25 17:42:22 +0000
commit6847027093bb23f1fb7d8f28bd1fff2914d7f4ea (patch)
tree33f194369ffa1cedbef1bd813a9280fbe0a09ac6 /src/dht/dht_api.c
parent06d7fc57df9e5d90c50b00337493bebcbee6e6c0 (diff)
- fixed crash in case of DHT_disconnect called from a DHT_get iterator
Diffstat (limited to 'src/dht/dht_api.c')
-rw-r--r--src/dht/dht_api.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/dht/dht_api.c b/src/dht/dht_api.c
index e40e702ee3..96ca6abfb6 100644
--- a/src/dht/dht_api.c
+++ b/src/dht/dht_api.c
@@ -900,6 +900,8 @@ service_message_handler (void *cls, const struct GNUNET_MessageHeader *msg)
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 @@ service_message_handler (void *cls, const struct GNUNET_MessageHeader *msg)
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 @@ service_message_handler (void *cls, const struct GNUNET_MessageHeader *msg)
do_disconnect (handle);
return;
}
- GNUNET_CLIENT_receive (handle->client, &service_message_handler, handle,
- GNUNET_TIME_UNIT_FOREVER_REL);
}