[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r14614 - in gnunet/src: arm dht include
From: |
gnunet |
Subject: |
[GNUnet-SVN] r14614 - in gnunet/src: arm dht include |
Date: |
Tue, 8 Mar 2011 16:24:09 +0100 |
Author: nevans
Date: 2011-03-08 16:24:09 +0100 (Tue, 08 Mar 2011)
New Revision: 14614
Modified:
gnunet/src/arm/gnunet-service-arm_interceptor.c
gnunet/src/dht/dht_api.c
gnunet/src/dht/gnunet-dht-driver.c
gnunet/src/dht/gnunet-service-dht.c
gnunet/src/include/gnunet_dht_service.h
Log:
api change for malicious peer bug when running distributed tests, stop arm from
repeatedly trying to bind to blank unixpath
Modified: gnunet/src/arm/gnunet-service-arm_interceptor.c
===================================================================
--- gnunet/src/arm/gnunet-service-arm_interceptor.c 2011-03-08 14:56:50 UTC
(rev 14613)
+++ gnunet/src/arm/gnunet-service-arm_interceptor.c 2011-03-08 15:24:09 UTC
(rev 14614)
@@ -1094,6 +1094,8 @@
sock = GNUNET_NETWORK_socket_create (PF_INET6, SOCK_STREAM, 0);
break;
case AF_UNIX:
+ if (strcmp(GNUNET_a2s (sa, addr_len), "@") == 0) /* Do not bind to blank
UNIX path! */
+ return;
sock = GNUNET_NETWORK_socket_create (PF_UNIX, SOCK_STREAM, 0);
break;
default:
Modified: gnunet/src/dht/dht_api.c
===================================================================
--- gnunet/src/dht/dht_api.c 2011-03-08 14:56:50 UTC (rev 14613)
+++ gnunet/src/dht/dht_api.c 2011-03-08 15:24:09 UTC (rev 14614)
@@ -238,8 +238,10 @@
_("Failed to connect to the DHT service!\n"));
return GNUNET_NO;
}
+#if DEBUG_DHT
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Starting to process replies from DHT\n");
+#endif
GNUNET_CLIENT_receive (handle->client,
&service_message_handler,
handle,
@@ -871,10 +873,13 @@
*
* @param handle handle to the DHT service
* @param frequency delay between sending malicious messages
+ * @param cont continuation to call when done (transmitting request to service)
+ * @param cont_cls closure for cont
*/
void
GNUNET_DHT_set_malicious_getter (struct GNUNET_DHT_Handle *handle,
- struct GNUNET_TIME_Relative frequency)
+ struct GNUNET_TIME_Relative frequency,
GNUNET_SCHEDULER_Task cont,
+ void *cont_cls)
{
if (frequency.rel_value > UINT16_MAX)
{
@@ -883,7 +888,7 @@
}
send_control_message (handle,
GNUNET_MESSAGE_TYPE_DHT_MALICIOUS_GET,
frequency.rel_value,
- NULL, NULL);
+ cont, cont_cls);
}
/**
@@ -892,10 +897,13 @@
*
* @param handle handle to the DHT service
* @param frequency delay between sending malicious messages
+ * @param cont continuation to call when done (transmitting request to service)
+ * @param cont_cls closure for cont
*/
void
GNUNET_DHT_set_malicious_putter (struct GNUNET_DHT_Handle *handle,
- struct GNUNET_TIME_Relative frequency)
+ struct GNUNET_TIME_Relative frequency,
GNUNET_SCHEDULER_Task cont,
+ void *cont_cls)
{
if (frequency.rel_value > UINT16_MAX)
{
@@ -905,7 +913,7 @@
send_control_message (handle,
GNUNET_MESSAGE_TYPE_DHT_MALICIOUS_PUT,
frequency.rel_value,
- NULL, NULL);
+ cont, cont_cls);
}
@@ -914,13 +922,17 @@
* all requests received.
*
* @param handle handle to the DHT service
+ * @param cont continuation to call when done (transmitting request to service)
+ * @param cont_cls closure for cont
+ *
*/
void
-GNUNET_DHT_set_malicious_dropper (struct GNUNET_DHT_Handle *handle)
+GNUNET_DHT_set_malicious_dropper (struct GNUNET_DHT_Handle *handle,
GNUNET_SCHEDULER_Task cont,
+ void *cont_cls)
{
send_control_message (handle,
- GNUNET_MESSAGE_TYPE_DHT_MALICIOUS_DROP, 0,
- NULL, NULL);
+ GNUNET_MESSAGE_TYPE_DHT_MALICIOUS_DROP, 0,
+ cont, cont_cls);
}
#endif
Modified: gnunet/src/dht/gnunet-dht-driver.c
===================================================================
--- gnunet/src/dht/gnunet-dht-driver.c 2011-03-08 14:56:50 UTC (rev 14613)
+++ gnunet/src/dht/gnunet-dht-driver.c 2011-03-08 15:24:09 UTC (rev 14614)
@@ -2690,7 +2690,7 @@
*/
static void
malicious_disconnect_task(void *cls,
- const struct GNUNET_SCHEDULER_TaskContext * tc)
+ const struct GNUNET_SCHEDULER_TaskContext * tc)
{
struct MaliciousContext *ctx = cls;
outstanding_malicious--;
@@ -2705,7 +2705,6 @@
{
fprintf (stderr, "Finished setting all malicious peers up!\n");
}
-
}
/**
@@ -2753,16 +2752,13 @@
switch (ctx->malicious_type)
{
case GNUNET_MESSAGE_TYPE_DHT_MALICIOUS_GET:
- GNUNET_DHT_set_malicious_getter (ctx->dht_handle, malicious_get_frequency);
- GNUNET_SCHEDULER_add_now (&malicious_done_task, ctx);
+ GNUNET_DHT_set_malicious_getter (ctx->dht_handle, malicious_get_frequency,
&malicious_done_task, ctx);
break;
case GNUNET_MESSAGE_TYPE_DHT_MALICIOUS_PUT:
- GNUNET_DHT_set_malicious_putter (ctx->dht_handle, malicious_put_frequency);
- GNUNET_SCHEDULER_add_now (&malicious_done_task, ctx);
+ GNUNET_DHT_set_malicious_putter (ctx->dht_handle, malicious_put_frequency,
&malicious_done_task, ctx);
break;
case GNUNET_MESSAGE_TYPE_DHT_MALICIOUS_DROP:
- GNUNET_DHT_set_malicious_dropper (ctx->dht_handle);
- GNUNET_SCHEDULER_add_now (&malicious_done_task, ctx);
+ GNUNET_DHT_set_malicious_dropper (ctx->dht_handle, &malicious_done_task,
ctx);
break;
default:
break;
Modified: gnunet/src/dht/gnunet-service-dht.c
===================================================================
--- gnunet/src/dht/gnunet-service-dht.c 2011-03-08 14:56:50 UTC (rev 14613)
+++ gnunet/src/dht/gnunet-service-dht.c 2011-03-08 15:24:09 UTC (rev 14614)
@@ -4691,6 +4691,7 @@
{
const struct GNUNET_DHT_ControlMessage *dht_control_msg =
(const struct GNUNET_DHT_ControlMessage *) message;
+
#if DEBUG_DHT
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"`%s:%s': Received `%s' request from client, command %d\n",
Modified: gnunet/src/include/gnunet_dht_service.h
===================================================================
--- gnunet/src/include/gnunet_dht_service.h 2011-03-08 14:56:50 UTC (rev
14613)
+++ gnunet/src/include/gnunet_dht_service.h 2011-03-08 15:24:09 UTC (rev
14614)
@@ -384,9 +384,13 @@
* all requests received.
*
* @param handle handle to the DHT service
+ * @param cont continuation to call when done (transmitting request to service)
+ * @param cont_cls closure for cont
+ *
*/
void
-GNUNET_DHT_set_malicious_dropper (struct GNUNET_DHT_Handle *handle);
+GNUNET_DHT_set_malicious_dropper (struct GNUNET_DHT_Handle *handle,
GNUNET_SCHEDULER_Task cont,
+ void *cont_cls);
/**
@@ -394,11 +398,14 @@
* requests every 'frequency' milliseconds.
*
* @param handle handle to the DHT service
- * @param frequency delay (in milliseconds) between sending malicious messages
+ * @param frequency delay between sending malicious messages
+ * @param cont continuation to call when done (transmitting request to service)
+ * @param cont_cls closure for cont
*/
void
GNUNET_DHT_set_malicious_putter (struct GNUNET_DHT_Handle *handle,
- struct GNUNET_TIME_Relative frequency);
+ struct GNUNET_TIME_Relative frequency, GNUNET_SCHEDULER_Task cont,
+ void *cont_cls);
/**
@@ -407,10 +414,13 @@
*
* @param handle handle to the DHT service
* @param frequency delay between sending malicious messages
+ * @param cont continuation to call when done (transmitting request to service)
+ * @param cont_cls closure for cont
*/
-void
-GNUNET_DHT_set_malicious_getter (struct GNUNET_DHT_Handle *handle,
- struct GNUNET_TIME_Relative frequency);
+void
+GNUNET_DHT_set_malicious_getter (struct GNUNET_DHT_Handle *handle,
+ struct GNUNET_TIME_Relative frequency, GNUNET_SCHEDULER_Task cont,
+ void *cont_cls);
#endif
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r14614 - in gnunet/src: arm dht include,
gnunet <=