diff options
author | Nathan S. Evans <evans@in.tum.de> | 2011-03-08 15:24:09 +0000 |
---|---|---|
committer | Nathan S. Evans <evans@in.tum.de> | 2011-03-08 15:24:09 +0000 |
commit | b2e82d34bc2a189f37c1c90ac2c7c93b1bc00e92 (patch) | |
tree | 325db698ec51e32353253041b05489b5cd90e0fd /src/dht | |
parent | c7302b83749bbb3093c8202b42de2e0bc0434ac3 (diff) | |
download | gnunet-b2e82d34bc2a189f37c1c90ac2c7c93b1bc00e92.tar.gz gnunet-b2e82d34bc2a189f37c1c90ac2c7c93b1bc00e92.zip |
api change for malicious peer bug when running distributed tests, stop arm from repeatedly trying to bind to blank unixpath
Diffstat (limited to 'src/dht')
-rw-r--r-- | src/dht/dht_api.c | 26 | ||||
-rw-r--r-- | src/dht/gnunet-dht-driver.c | 12 | ||||
-rw-r--r-- | src/dht/gnunet-service-dht.c | 1 |
3 files changed, 24 insertions, 15 deletions
diff --git a/src/dht/dht_api.c b/src/dht/dht_api.c index 820bf35c8..5d3a83d4b 100644 --- a/src/dht/dht_api.c +++ b/src/dht/dht_api.c | |||
@@ -238,8 +238,10 @@ try_connect (struct GNUNET_DHT_Handle *handle) | |||
238 | _("Failed to connect to the DHT service!\n")); | 238 | _("Failed to connect to the DHT service!\n")); |
239 | return GNUNET_NO; | 239 | return GNUNET_NO; |
240 | } | 240 | } |
241 | #if DEBUG_DHT | ||
241 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 242 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
242 | "Starting to process replies from DHT\n"); | 243 | "Starting to process replies from DHT\n"); |
244 | #endif | ||
243 | GNUNET_CLIENT_receive (handle->client, | 245 | GNUNET_CLIENT_receive (handle->client, |
244 | &service_message_handler, | 246 | &service_message_handler, |
245 | handle, | 247 | handle, |
@@ -871,10 +873,13 @@ GNUNET_DHT_find_peers (struct GNUNET_DHT_Handle *handle, | |||
871 | * | 873 | * |
872 | * @param handle handle to the DHT service | 874 | * @param handle handle to the DHT service |
873 | * @param frequency delay between sending malicious messages | 875 | * @param frequency delay between sending malicious messages |
876 | * @param cont continuation to call when done (transmitting request to service) | ||
877 | * @param cont_cls closure for cont | ||
874 | */ | 878 | */ |
875 | void | 879 | void |
876 | GNUNET_DHT_set_malicious_getter (struct GNUNET_DHT_Handle *handle, | 880 | GNUNET_DHT_set_malicious_getter (struct GNUNET_DHT_Handle *handle, |
877 | struct GNUNET_TIME_Relative frequency) | 881 | struct GNUNET_TIME_Relative frequency, GNUNET_SCHEDULER_Task cont, |
882 | void *cont_cls) | ||
878 | { | 883 | { |
879 | if (frequency.rel_value > UINT16_MAX) | 884 | if (frequency.rel_value > UINT16_MAX) |
880 | { | 885 | { |
@@ -883,7 +888,7 @@ GNUNET_DHT_set_malicious_getter (struct GNUNET_DHT_Handle *handle, | |||
883 | } | 888 | } |
884 | send_control_message (handle, | 889 | send_control_message (handle, |
885 | GNUNET_MESSAGE_TYPE_DHT_MALICIOUS_GET, frequency.rel_value, | 890 | GNUNET_MESSAGE_TYPE_DHT_MALICIOUS_GET, frequency.rel_value, |
886 | NULL, NULL); | 891 | cont, cont_cls); |
887 | } | 892 | } |
888 | 893 | ||
889 | /** | 894 | /** |
@@ -892,10 +897,13 @@ GNUNET_DHT_set_malicious_getter (struct GNUNET_DHT_Handle *handle, | |||
892 | * | 897 | * |
893 | * @param handle handle to the DHT service | 898 | * @param handle handle to the DHT service |
894 | * @param frequency delay between sending malicious messages | 899 | * @param frequency delay between sending malicious messages |
900 | * @param cont continuation to call when done (transmitting request to service) | ||
901 | * @param cont_cls closure for cont | ||
895 | */ | 902 | */ |
896 | void | 903 | void |
897 | GNUNET_DHT_set_malicious_putter (struct GNUNET_DHT_Handle *handle, | 904 | GNUNET_DHT_set_malicious_putter (struct GNUNET_DHT_Handle *handle, |
898 | struct GNUNET_TIME_Relative frequency) | 905 | struct GNUNET_TIME_Relative frequency, GNUNET_SCHEDULER_Task cont, |
906 | void *cont_cls) | ||
899 | { | 907 | { |
900 | if (frequency.rel_value > UINT16_MAX) | 908 | if (frequency.rel_value > UINT16_MAX) |
901 | { | 909 | { |
@@ -905,7 +913,7 @@ GNUNET_DHT_set_malicious_putter (struct GNUNET_DHT_Handle *handle, | |||
905 | 913 | ||
906 | send_control_message (handle, | 914 | send_control_message (handle, |
907 | GNUNET_MESSAGE_TYPE_DHT_MALICIOUS_PUT, frequency.rel_value, | 915 | GNUNET_MESSAGE_TYPE_DHT_MALICIOUS_PUT, frequency.rel_value, |
908 | NULL, NULL); | 916 | cont, cont_cls); |
909 | } | 917 | } |
910 | 918 | ||
911 | 919 | ||
@@ -914,13 +922,17 @@ GNUNET_DHT_set_malicious_putter (struct GNUNET_DHT_Handle *handle, | |||
914 | * all requests received. | 922 | * all requests received. |
915 | * | 923 | * |
916 | * @param handle handle to the DHT service | 924 | * @param handle handle to the DHT service |
925 | * @param cont continuation to call when done (transmitting request to service) | ||
926 | * @param cont_cls closure for cont | ||
927 | * | ||
917 | */ | 928 | */ |
918 | void | 929 | void |
919 | GNUNET_DHT_set_malicious_dropper (struct GNUNET_DHT_Handle *handle) | 930 | GNUNET_DHT_set_malicious_dropper (struct GNUNET_DHT_Handle *handle, GNUNET_SCHEDULER_Task cont, |
931 | void *cont_cls) | ||
920 | { | 932 | { |
921 | send_control_message (handle, | 933 | send_control_message (handle, |
922 | GNUNET_MESSAGE_TYPE_DHT_MALICIOUS_DROP, 0, | 934 | GNUNET_MESSAGE_TYPE_DHT_MALICIOUS_DROP, 0, |
923 | NULL, NULL); | 935 | cont, cont_cls); |
924 | } | 936 | } |
925 | 937 | ||
926 | #endif | 938 | #endif |
diff --git a/src/dht/gnunet-dht-driver.c b/src/dht/gnunet-dht-driver.c index c73bf115b..7a1606219 100644 --- a/src/dht/gnunet-dht-driver.c +++ b/src/dht/gnunet-dht-driver.c | |||
@@ -2690,7 +2690,7 @@ continue_puts_and_gets(void *cls, | |||
2690 | */ | 2690 | */ |
2691 | static void | 2691 | static void |
2692 | malicious_disconnect_task(void *cls, | 2692 | malicious_disconnect_task(void *cls, |
2693 | const struct GNUNET_SCHEDULER_TaskContext * tc) | 2693 | const struct GNUNET_SCHEDULER_TaskContext * tc) |
2694 | { | 2694 | { |
2695 | struct MaliciousContext *ctx = cls; | 2695 | struct MaliciousContext *ctx = cls; |
2696 | outstanding_malicious--; | 2696 | outstanding_malicious--; |
@@ -2705,7 +2705,6 @@ malicious_disconnect_task(void *cls, | |||
2705 | { | 2705 | { |
2706 | fprintf (stderr, "Finished setting all malicious peers up!\n"); | 2706 | fprintf (stderr, "Finished setting all malicious peers up!\n"); |
2707 | } | 2707 | } |
2708 | |||
2709 | } | 2708 | } |
2710 | 2709 | ||
2711 | /** | 2710 | /** |
@@ -2753,16 +2752,13 @@ set_malicious(void *cls, const struct GNUNET_SCHEDULER_TaskContext * tc) | |||
2753 | switch (ctx->malicious_type) | 2752 | switch (ctx->malicious_type) |
2754 | { | 2753 | { |
2755 | case GNUNET_MESSAGE_TYPE_DHT_MALICIOUS_GET: | 2754 | case GNUNET_MESSAGE_TYPE_DHT_MALICIOUS_GET: |
2756 | GNUNET_DHT_set_malicious_getter (ctx->dht_handle, malicious_get_frequency); | 2755 | GNUNET_DHT_set_malicious_getter (ctx->dht_handle, malicious_get_frequency, &malicious_done_task, ctx); |
2757 | GNUNET_SCHEDULER_add_now (&malicious_done_task, ctx); | ||
2758 | break; | 2756 | break; |
2759 | case GNUNET_MESSAGE_TYPE_DHT_MALICIOUS_PUT: | 2757 | case GNUNET_MESSAGE_TYPE_DHT_MALICIOUS_PUT: |
2760 | GNUNET_DHT_set_malicious_putter (ctx->dht_handle, malicious_put_frequency); | 2758 | GNUNET_DHT_set_malicious_putter (ctx->dht_handle, malicious_put_frequency, &malicious_done_task, ctx); |
2761 | GNUNET_SCHEDULER_add_now (&malicious_done_task, ctx); | ||
2762 | break; | 2759 | break; |
2763 | case GNUNET_MESSAGE_TYPE_DHT_MALICIOUS_DROP: | 2760 | case GNUNET_MESSAGE_TYPE_DHT_MALICIOUS_DROP: |
2764 | GNUNET_DHT_set_malicious_dropper (ctx->dht_handle); | 2761 | GNUNET_DHT_set_malicious_dropper (ctx->dht_handle, &malicious_done_task, ctx); |
2765 | GNUNET_SCHEDULER_add_now (&malicious_done_task, ctx); | ||
2766 | break; | 2762 | break; |
2767 | default: | 2763 | default: |
2768 | break; | 2764 | break; |
diff --git a/src/dht/gnunet-service-dht.c b/src/dht/gnunet-service-dht.c index f205abbae..c5eded564 100644 --- a/src/dht/gnunet-service-dht.c +++ b/src/dht/gnunet-service-dht.c | |||
@@ -4691,6 +4691,7 @@ handle_dht_control_message (void *cls, struct GNUNET_SERVER_Client *client, | |||
4691 | { | 4691 | { |
4692 | const struct GNUNET_DHT_ControlMessage *dht_control_msg = | 4692 | const struct GNUNET_DHT_ControlMessage *dht_control_msg = |
4693 | (const struct GNUNET_DHT_ControlMessage *) message; | 4693 | (const struct GNUNET_DHT_ControlMessage *) message; |
4694 | |||
4694 | #if DEBUG_DHT | 4695 | #if DEBUG_DHT |
4695 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 4696 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
4696 | "`%s:%s': Received `%s' request from client, command %d\n", | 4697 | "`%s:%s': Received `%s' request from client, command %d\n", |