diff options
author | Bart Polot <bart@net.in.tum.de> | 2013-01-25 17:42:22 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2013-01-25 17:42:22 +0000 |
commit | 6847027093bb23f1fb7d8f28bd1fff2914d7f4ea (patch) | |
tree | 33f194369ffa1cedbef1bd813a9280fbe0a09ac6 /src/dht | |
parent | 06d7fc57df9e5d90c50b00337493bebcbee6e6c0 (diff) | |
download | gnunet-6847027093bb23f1fb7d8f28bd1fff2914d7f4ea.tar.gz gnunet-6847027093bb23f1fb7d8f28bd1fff2914d7f4ea.zip |
- fixed crash in case of DHT_disconnect called from a DHT_get iterator
Diffstat (limited to 'src/dht')
-rw-r--r-- | src/dht/dht_api.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/dht/dht_api.c b/src/dht/dht_api.c index e40e702ee..96ca6abfb 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) | |||
900 | do_disconnect (handle); | 900 | do_disconnect (handle); |
901 | return; | 901 | return; |
902 | } | 902 | } |
903 | GNUNET_CLIENT_receive (handle->client, &service_message_handler, handle, | ||
904 | GNUNET_TIME_UNIT_FOREVER_REL); | ||
903 | ret = GNUNET_SYSERR; | 905 | ret = GNUNET_SYSERR; |
904 | msize = ntohs (msg->size); | 906 | msize = ntohs (msg->size); |
905 | switch (ntohs (msg->type)) | 907 | switch (ntohs (msg->type)) |
@@ -941,13 +943,15 @@ service_message_handler (void *cls, const struct GNUNET_MessageHeader *msg) | |||
941 | GNUNET_break (0); | 943 | GNUNET_break (0); |
942 | break; | 944 | break; |
943 | } | 945 | } |
944 | ret = GNUNET_OK; | ||
945 | dht_msg = (const struct GNUNET_DHT_ClientResultMessage *) msg; | 946 | dht_msg = (const struct GNUNET_DHT_ClientResultMessage *) msg; |
946 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Received reply for `%s' from DHT service %p\n", | 947 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
947 | GNUNET_h2s (&dht_msg->key), handle); | 948 | "Received reply for `%s' from DHT service %p\n", |
949 | GNUNET_h2s (&dht_msg->key), handle); | ||
948 | GNUNET_CONTAINER_multihashmap_get_multiple (handle->active_requests, | 950 | GNUNET_CONTAINER_multihashmap_get_multiple (handle->active_requests, |
949 | &dht_msg->key, &process_reply, | 951 | &dht_msg->key, |
950 | (void *) dht_msg); | 952 | &process_reply, |
953 | (void *) dht_msg); | ||
954 | ret = GNUNET_OK; | ||
951 | break; | 955 | break; |
952 | case GNUNET_MESSAGE_TYPE_DHT_CLIENT_PUT_OK: | 956 | case GNUNET_MESSAGE_TYPE_DHT_CLIENT_PUT_OK: |
953 | if (ntohs (msg->size) != sizeof (struct GNUNET_DHT_ClientPutConfirmationMessage)) | 957 | if (ntohs (msg->size) != sizeof (struct GNUNET_DHT_ClientPutConfirmationMessage)) |
@@ -971,8 +975,6 @@ service_message_handler (void *cls, const struct GNUNET_MessageHeader *msg) | |||
971 | do_disconnect (handle); | 975 | do_disconnect (handle); |
972 | return; | 976 | return; |
973 | } | 977 | } |
974 | GNUNET_CLIENT_receive (handle->client, &service_message_handler, handle, | ||
975 | GNUNET_TIME_UNIT_FOREVER_REL); | ||
976 | } | 978 | } |
977 | 979 | ||
978 | 980 | ||