aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/core_api.c4
-rw-r--r--src/core/gnunet-service-core.c6
-rw-r--r--src/dht/test_dht_multipeer.c5
-rw-r--r--src/dht/test_dht_twopeer.c1
-rw-r--r--src/dht/test_dht_twopeer_path_tracking.c5
-rw-r--r--src/dht/test_dht_twopeer_put_get.c1
-rw-r--r--src/dv/test_transport_api_dv.c5
-rw-r--r--src/fs/fs_test_lib.c1
-rw-r--r--src/include/gnunet_testing_lib.h5
-rw-r--r--src/testing/test_testing_group.c5
-rw-r--r--src/testing/test_testing_group_remote.c5
-rw-r--r--src/testing/test_testing_large_topology.c1
-rw-r--r--src/testing/test_testing_topology.c1
-rw-r--r--src/testing/test_testing_topology_blacklist.c2
-rw-r--r--src/testing/test_testing_topology_churn.c4
-rw-r--r--src/topology/test_gnunet_daemon_topology.c1
-rw-r--r--src/transport/plugin_transport_unix.c64
17 files changed, 99 insertions, 17 deletions
diff --git a/src/core/core_api.c b/src/core/core_api.c
index a2e0dae09..f4a197909 100644
--- a/src/core/core_api.c
+++ b/src/core/core_api.c
@@ -1728,6 +1728,10 @@ GNUNET_CORE_peer_request_connect (struct GNUNET_CORE_Handle *h,
1728 struct GNUNET_CORE_PeerRequestHandle *ret; 1728 struct GNUNET_CORE_PeerRequestHandle *ret;
1729 struct ControlMessage *cm; 1729 struct ControlMessage *cm;
1730 struct ConnectMessage *msg; 1730 struct ConnectMessage *msg;
1731
1732 if (NULL != GNUNET_CONTAINER_multihashmap_get (h->peers,
1733 &peer->hashPubKey))
1734 GNUNET_log_from (GNUNET_ERROR_TYPE_WARNING, "core_api", "Received CONNECT requests for already connected peer!\n");
1731 1735
1732 cm = GNUNET_malloc (sizeof (struct ControlMessage) + 1736 cm = GNUNET_malloc (sizeof (struct ControlMessage) +
1733 sizeof (struct ConnectMessage)); 1737 sizeof (struct ConnectMessage));
diff --git a/src/core/gnunet-service-core.c b/src/core/gnunet-service-core.c
index 410d65b93..4519991b3 100644
--- a/src/core/gnunet-service-core.c
+++ b/src/core/gnunet-service-core.c
@@ -3336,9 +3336,9 @@ process_hello_retry_handle_set_key (void *cls,
3336 3336
3337 if (err_msg != NULL) 3337 if (err_msg != NULL)
3338 { 3338 {
3339 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 3339 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
3340 _("Error in communication with PEERINFO service\n")); 3340 _("Error in communication with PEERINFO service\n"));
3341 /* return; */ 3341 /* return; */
3342 } 3342 }
3343 3343
3344 if (peer == NULL) 3344 if (peer == NULL)
diff --git a/src/dht/test_dht_multipeer.c b/src/dht/test_dht_multipeer.c
index 626c1bc30..593e96527 100644
--- a/src/dht/test_dht_multipeer.c
+++ b/src/dht/test_dht_multipeer.c
@@ -876,8 +876,9 @@ run (void *cls,
876 &end_badly, "didn't generate all hostkeys within a reasonable amount of time!!!"); 876 &end_badly, "didn't generate all hostkeys within a reasonable amount of time!!!");
877 877
878 pg = GNUNET_TESTING_daemons_start (cfg, 878 pg = GNUNET_TESTING_daemons_start (cfg,
879 peers_left, 879 peers_left, /* Total number of peers */
880 peers_left, 880 peers_left, /* Number of outstanding connections */
881 peers_left, /* Number of parallel ssh connections, or peers being started at once */
881 GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, SECONDS_PER_PEER_START * num_peers), 882 GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, SECONDS_PER_PEER_START * num_peers),
882 &hostkey_callback, 883 &hostkey_callback,
883 NULL, 884 NULL,
diff --git a/src/dht/test_dht_twopeer.c b/src/dht/test_dht_twopeer.c
index e85c6101b..8c373d365 100644
--- a/src/dht/test_dht_twopeer.c
+++ b/src/dht/test_dht_twopeer.c
@@ -415,6 +415,7 @@ run (void *cls,
415 pg = GNUNET_TESTING_daemons_start (cfg, 415 pg = GNUNET_TESTING_daemons_start (cfg,
416 num_peers, 416 num_peers,
417 10, 417 10,
418 num_peers,
418 TIMEOUT, 419 TIMEOUT,
419 NULL, NULL, 420 NULL, NULL,
420 &peers_started_callback, 421 &peers_started_callback,
diff --git a/src/dht/test_dht_twopeer_path_tracking.c b/src/dht/test_dht_twopeer_path_tracking.c
index f8ce26da6..d4e5a1332 100644
--- a/src/dht/test_dht_twopeer_path_tracking.c
+++ b/src/dht/test_dht_twopeer_path_tracking.c
@@ -461,8 +461,9 @@ run (void *cls,
461 /* Start num_peers peers, call peers_started_callback on peer start, topology_callback on peer connect */ 461 /* Start num_peers peers, call peers_started_callback on peer start, topology_callback on peer connect */
462 /* Read the API documentation for other parameters! */ 462 /* Read the API documentation for other parameters! */
463 pg = GNUNET_TESTING_daemons_start (cfg, 463 pg = GNUNET_TESTING_daemons_start (cfg,
464 num_peers, 464 peers_left, /* Total number of peers */
465 num_peers, 465 peers_left, /* Number of outstanding connections */
466 peers_left, /* Number of parallel ssh connections, or peers being started at once */
466 TIMEOUT, 467 TIMEOUT,
467 NULL, 468 NULL,
468 NULL, 469 NULL,
diff --git a/src/dht/test_dht_twopeer_put_get.c b/src/dht/test_dht_twopeer_put_get.c
index 057f9ebfe..40a165236 100644
--- a/src/dht/test_dht_twopeer_put_get.c
+++ b/src/dht/test_dht_twopeer_put_get.c
@@ -540,6 +540,7 @@ run (void *cls,
540 pg = GNUNET_TESTING_daemons_start (cfg, 540 pg = GNUNET_TESTING_daemons_start (cfg,
541 num_peers, 541 num_peers,
542 2, 542 2,
543 2,
543 TIMEOUT, 544 TIMEOUT,
544 NULL, 545 NULL,
545 NULL, 546 NULL,
diff --git a/src/dv/test_transport_api_dv.c b/src/dv/test_transport_api_dv.c
index 8a2e54142..e6caa43ca 100644
--- a/src/dv/test_transport_api_dv.c
+++ b/src/dv/test_transport_api_dv.c
@@ -1138,8 +1138,9 @@ run (void *cls,
1138 1138
1139 peer_daemon_hash = GNUNET_CONTAINER_multihashmap_create(peers_left); 1139 peer_daemon_hash = GNUNET_CONTAINER_multihashmap_create(peers_left);
1140 pg = GNUNET_TESTING_daemons_start (cfg, 1140 pg = GNUNET_TESTING_daemons_start (cfg,
1141 peers_left, 1141 peers_left, /* Total number of peers */
1142 peers_left, 1142 peers_left, /* Number of outstanding connections */
1143 peers_left, /* Number of parallel ssh connections, or peers being started at once */
1143 TIMEOUT, 1144 TIMEOUT,
1144 &hostkey_callback, 1145 &hostkey_callback,
1145 NULL, 1146 NULL,
diff --git a/src/fs/fs_test_lib.c b/src/fs/fs_test_lib.c
index 287c0eb1c..a3f33a522 100644
--- a/src/fs/fs_test_lib.c
+++ b/src/fs/fs_test_lib.c
@@ -395,6 +395,7 @@ GNUNET_FS_TEST_daemons_start (const char *template_cfg_file,
395 sctx->group = GNUNET_TESTING_daemons_start (sctx->cfg, 395 sctx->group = GNUNET_TESTING_daemons_start (sctx->cfg,
396 total, 396 total,
397 total, /* Outstanding connections */ 397 total, /* Outstanding connections */
398 total, /* Outstanding ssh connections */
398 timeout, 399 timeout,
399 NULL, 400 NULL,
400 NULL, 401 NULL,
diff --git a/src/include/gnunet_testing_lib.h b/src/include/gnunet_testing_lib.h
index b0c43c44b..6ddc4ea74 100644
--- a/src/include/gnunet_testing_lib.h
+++ b/src/include/gnunet_testing_lib.h
@@ -567,7 +567,9 @@ void GNUNET_TESTING_daemons_connect (struct GNUNET_TESTING_Daemon *d1,
567 * @param cfg configuration template to use 567 * @param cfg configuration template to use
568 * @param total number of daemons to start 568 * @param total number of daemons to start
569 * @param max_concurrent_connections for testing, how many peers can 569 * @param max_concurrent_connections for testing, how many peers can
570 * we connect to simultaneously 570* we connect to simultaneously
571 * @param max_concurrent_ssh when starting with ssh, how many ssh
572 * connections will we allow at once (based on remote hosts allowed!)
571 * @param timeout total time allowed for peers to start 573 * @param timeout total time allowed for peers to start
572 * @param hostkey_callback function to call on each peers hostkey generation 574 * @param hostkey_callback function to call on each peers hostkey generation
573 * if NULL, peers will be started by this call, if non-null, 575 * if NULL, peers will be started by this call, if non-null,
@@ -587,6 +589,7 @@ struct GNUNET_TESTING_PeerGroup *
587GNUNET_TESTING_daemons_start (const struct GNUNET_CONFIGURATION_Handle *cfg, 589GNUNET_TESTING_daemons_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
588 unsigned int total, 590 unsigned int total,
589 unsigned int max_concurrent_connections, 591 unsigned int max_concurrent_connections,
592 unsigned int max_concurrent_ssh,
590 struct GNUNET_TIME_Relative timeout, 593 struct GNUNET_TIME_Relative timeout,
591 GNUNET_TESTING_NotifyHostkeyCreated 594 GNUNET_TESTING_NotifyHostkeyCreated
592 hostkey_callback, void *hostkey_cls, 595 hostkey_callback, void *hostkey_cls,
diff --git a/src/testing/test_testing_group.c b/src/testing/test_testing_group.c
index 1facaa63f..0056588bc 100644
--- a/src/testing/test_testing_group.c
+++ b/src/testing/test_testing_group.c
@@ -116,8 +116,9 @@ run (void *cls,
116#endif 116#endif
117 peers_left = NUM_PEERS; 117 peers_left = NUM_PEERS;
118 pg = GNUNET_TESTING_daemons_start (cfg, 118 pg = GNUNET_TESTING_daemons_start (cfg,
119 peers_left, 119 peers_left, /* Total number of peers */
120 NUM_PEERS, 120 peers_left, /* Number of outstanding connections */
121 peers_left, /* Number of parallel ssh connections, or peers being started at once */
121 TIMEOUT, 122 TIMEOUT,
122 NULL, NULL, 123 NULL, NULL,
123 &my_cb, NULL, NULL, NULL, NULL); 124 &my_cb, NULL, NULL, NULL, NULL);
diff --git a/src/testing/test_testing_group_remote.c b/src/testing/test_testing_group_remote.c
index 02f76f826..6a4d0cc1e 100644
--- a/src/testing/test_testing_group_remote.c
+++ b/src/testing/test_testing_group_remote.c
@@ -202,8 +202,9 @@ run (void *cls,
202 202
203 peers_left = num_peers; 203 peers_left = num_peers;
204 pg = GNUNET_TESTING_daemons_start (cfg, 204 pg = GNUNET_TESTING_daemons_start (cfg,
205 peers_left, 205 peers_left, /* Total number of peers */
206 peers_left, 206 peers_left, /* Number of outstanding connections */
207 peers_left, /* Number of parallel ssh connections, or peers being started at once */
207 TIMEOUT, 208 TIMEOUT,
208 NULL, 209 NULL,
209 NULL, &my_cb, NULL, NULL, NULL, hosts); 210 NULL, &my_cb, NULL, NULL, NULL, hosts);
diff --git a/src/testing/test_testing_large_topology.c b/src/testing/test_testing_large_topology.c
index 46626618a..9f6b27059 100644
--- a/src/testing/test_testing_large_topology.c
+++ b/src/testing/test_testing_large_topology.c
@@ -1131,6 +1131,7 @@ run (void *cls,
1131 pg = GNUNET_TESTING_daemons_start (cfg, 1131 pg = GNUNET_TESTING_daemons_start (cfg,
1132 peers_left, 1132 peers_left,
1133 peers_left / 2, 1133 peers_left / 2,
1134 peers_left,
1134 timeout, 1135 timeout,
1135 &hostkey_callback, NULL, 1136 &hostkey_callback, NULL,
1136 &peers_started_callback, NULL, 1137 &peers_started_callback, NULL,
diff --git a/src/testing/test_testing_topology.c b/src/testing/test_testing_topology.c
index 66540c078..5af3e9ed2 100644
--- a/src/testing/test_testing_topology.c
+++ b/src/testing/test_testing_topology.c
@@ -1181,6 +1181,7 @@ run (void *cls,
1181 pg = GNUNET_TESTING_daemons_start (cfg, 1181 pg = GNUNET_TESTING_daemons_start (cfg,
1182 peers_left, 1182 peers_left,
1183 peers_left / 2, 1183 peers_left / 2,
1184 peers_left,
1184 GNUNET_TIME_relative_multiply 1185 GNUNET_TIME_relative_multiply
1185 (GNUNET_TIME_UNIT_SECONDS, 1186 (GNUNET_TIME_UNIT_SECONDS,
1186 SECONDS_PER_PEER_START * num_peers), 1187 SECONDS_PER_PEER_START * num_peers),
diff --git a/src/testing/test_testing_topology_blacklist.c b/src/testing/test_testing_topology_blacklist.c
index 2c1a8b31c..ea32e339d 100644
--- a/src/testing/test_testing_topology_blacklist.c
+++ b/src/testing/test_testing_topology_blacklist.c
@@ -535,7 +535,7 @@ run (void *cls,
535 "didn't start all daemons in reasonable amount of time!!!"); 535 "didn't start all daemons in reasonable amount of time!!!");
536 536
537 pg = GNUNET_TESTING_daemons_start (cfg, 537 pg = GNUNET_TESTING_daemons_start (cfg,
538 peers_left, peers_left, 538 peers_left, peers_left, peers_left,
539 TIMEOUT, &hostkey_callback, 539 TIMEOUT, &hostkey_callback,
540 NULL, &peers_started_callback, NULL, 540 NULL, &peers_started_callback, NULL,
541 &topology_callback, NULL, NULL); 541 &topology_callback, NULL, NULL);
diff --git a/src/testing/test_testing_topology_churn.c b/src/testing/test_testing_topology_churn.c
index 33f3a0737..f1d93fa46 100644
--- a/src/testing/test_testing_topology_churn.c
+++ b/src/testing/test_testing_topology_churn.c
@@ -281,7 +281,9 @@ run (void *cls,
281 281
282 pg = GNUNET_TESTING_daemons_start (cfg, 282 pg = GNUNET_TESTING_daemons_start (cfg,
283 peers_left, 283 peers_left,
284 peers_left, TIMEOUT, NULL, NULL, 284 peers_left,
285 peers_left,
286 TIMEOUT, NULL, NULL,
285 &peers_started_callback, NULL, NULL, 287 &peers_started_callback, NULL, NULL,
286 NULL, NULL); 288 NULL, NULL);
287 289
diff --git a/src/topology/test_gnunet_daemon_topology.c b/src/topology/test_gnunet_daemon_topology.c
index ae96b071c..dc6cb7375 100644
--- a/src/topology/test_gnunet_daemon_topology.c
+++ b/src/topology/test_gnunet_daemon_topology.c
@@ -155,6 +155,7 @@ run (void *cls,
155 pg = GNUNET_TESTING_daemons_start (cfg, 155 pg = GNUNET_TESTING_daemons_start (cfg,
156 peers_left, 156 peers_left,
157 peers_left, 157 peers_left,
158 peers_left,
158 TIMEOUT, 159 TIMEOUT,
159 NULL, NULL, 160 NULL, NULL,
160 &my_cb, NULL, NULL, NULL, NULL); 161 &my_cb, NULL, NULL, NULL, NULL);
diff --git a/src/transport/plugin_transport_unix.c b/src/transport/plugin_transport_unix.c
index 790e4451f..0163a8e5b 100644
--- a/src/transport/plugin_transport_unix.c
+++ b/src/transport/plugin_transport_unix.c
@@ -80,6 +80,24 @@ struct UNIXMessage
80 80
81}; 81};
82 82
83struct RetryList
84{
85 /**
86 * Pointer to next element.
87 */
88 struct RetryList *next;
89
90 /**
91 * Pointer to previous element.
92 */
93 struct RetryList *prev;
94
95 /**
96 * The actual retry context.
97 */
98 struct RetrySendContext *retry_ctx;
99};
100
83/** 101/**
84 * Network format for IPv4 addresses. 102 * Network format for IPv4 addresses.
85 */ 103 */
@@ -191,6 +209,11 @@ struct RetrySendContext
191 * The priority of the message. 209 * The priority of the message.
192 */ 210 */
193 unsigned int priority; 211 unsigned int priority;
212
213 /**
214 * Entry in the DLL of retry items.
215 */
216 struct RetryList *retry_list_entry;
194}; 217};
195 218
196/** 219/**
@@ -342,6 +365,16 @@ struct Plugin
342 365
343}; 366};
344 367
368/**
369 * Head of retry DLL.
370 */
371static struct RetryList *retry_list_head;
372
373/**
374 * Tail of retry DLL.
375 */
376static struct RetryList *retry_list_tail;
377
345 378
346/** 379/**
347 * Disconnect from a remote node. Clean up session if we have one for this peer 380 * Disconnect from a remote node. Clean up session if we have one for this peer
@@ -370,6 +403,22 @@ static int
370unix_transport_server_stop (void *cls) 403unix_transport_server_stop (void *cls)
371{ 404{
372 struct Plugin *plugin = cls; 405 struct Plugin *plugin = cls;
406 struct RetryList *pos;
407
408 pos = retry_list_head;
409
410 while(NULL != (pos = retry_list_head))
411 {
412 GNUNET_CONTAINER_DLL_remove(retry_list_head, retry_list_tail, pos);
413 if (GNUNET_SCHEDULER_NO_TASK != pos->retry_ctx->retry_task)
414 {
415 GNUNET_SCHEDULER_cancel(pos->retry_ctx->retry_task);
416 }
417 GNUNET_free(pos->retry_ctx->msg);
418 GNUNET_free(pos->retry_ctx->addr);
419 GNUNET_free(pos->retry_ctx);
420 GNUNET_free(pos);
421 }
373 422
374 if (plugin->select_task != GNUNET_SCHEDULER_NO_TASK) 423 if (plugin->select_task != GNUNET_SCHEDULER_NO_TASK)
375 { 424 {
@@ -428,7 +477,13 @@ void retry_send_message (void *cls,
428 struct RetrySendContext *retry_ctx = cls; 477 struct RetrySendContext *retry_ctx = cls;
429 478
430 if (tc->reason == GNUNET_SCHEDULER_REASON_SHUTDOWN) 479 if (tc->reason == GNUNET_SCHEDULER_REASON_SHUTDOWN)
431 return; 480 {
481 GNUNET_free(retry_ctx->msg);
482 GNUNET_free(retry_ctx->addr);
483 GNUNET_free(retry_ctx);
484 return;
485 }
486
432 unix_real_send (retry_ctx->plugin, 487 unix_real_send (retry_ctx->plugin,
433 retry_ctx, 488 retry_ctx,
434 retry_ctx->send_handle, 489 retry_ctx->send_handle,
@@ -489,6 +544,7 @@ unix_real_send (void *cls,
489 size_t sbs; 544 size_t sbs;
490 struct sockaddr_un un; 545 struct sockaddr_un un;
491 size_t slen; 546 size_t slen;
547 struct RetryList *retry_list_entry;
492 548
493 if (send_handle == NULL) 549 if (send_handle == NULL)
494 { 550 {
@@ -542,6 +598,7 @@ unix_real_send (void *cls,
542 { 598 {
543 if (incoming_retry_context == NULL) 599 if (incoming_retry_context == NULL)
544 { 600 {
601 retry_list_entry = GNUNET_malloc(sizeof(struct RetryList));
545 retry_ctx = GNUNET_malloc(sizeof(struct RetrySendContext)); 602 retry_ctx = GNUNET_malloc(sizeof(struct RetrySendContext));
546 retry_ctx->addr = GNUNET_malloc(addrlen); 603 retry_ctx->addr = GNUNET_malloc(addrlen);
547 retry_ctx->msg = GNUNET_malloc(msgbuf_size); 604 retry_ctx->msg = GNUNET_malloc(msgbuf_size);
@@ -557,6 +614,9 @@ unix_real_send (void *cls,
557 retry_ctx->timeout = GNUNET_TIME_relative_to_absolute(timeout); 614 retry_ctx->timeout = GNUNET_TIME_relative_to_absolute(timeout);
558 memcpy(&retry_ctx->target, target, sizeof(struct GNUNET_PeerIdentity)); 615 memcpy(&retry_ctx->target, target, sizeof(struct GNUNET_PeerIdentity));
559 retry_ctx->delay = GNUNET_TIME_UNIT_MILLISECONDS; 616 retry_ctx->delay = GNUNET_TIME_UNIT_MILLISECONDS;
617 retry_ctx->retry_list_entry = retry_list_entry;
618 retry_list_entry->retry_ctx = retry_ctx;
619 GNUNET_CONTAINER_DLL_insert(retry_list_head, retry_list_tail, retry_list_entry);
560 } 620 }
561 else 621 else
562 { 622 {
@@ -597,6 +657,8 @@ unix_real_send (void *cls,
597 657
598 if (incoming_retry_context != NULL) 658 if (incoming_retry_context != NULL)
599 { 659 {
660 GNUNET_CONTAINER_DLL_remove(retry_list_head, retry_list_tail, incoming_retry_context->retry_list_entry);
661 GNUNET_free(incoming_retry_context->retry_list_entry);
600 GNUNET_free(incoming_retry_context->msg); 662 GNUNET_free(incoming_retry_context->msg);
601 GNUNET_free(incoming_retry_context->addr); 663 GNUNET_free(incoming_retry_context->addr);
602 GNUNET_free(incoming_retry_context); 664 GNUNET_free(incoming_retry_context);