aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ats-tests/ats-testing-experiment.c3
-rw-r--r--src/secretsharing/gnunet-service-secretsharing.c3
-rw-r--r--src/transport/gnunet-service-transport.c15
-rw-r--r--src/transport/gnunet-transport-profiler.c88
-rw-r--r--src/transport/plugin_transport_http_server.c2
5 files changed, 71 insertions, 40 deletions
diff --git a/src/ats-tests/ats-testing-experiment.c b/src/ats-tests/ats-testing-experiment.c
index 110a48043..9b11caec3 100644
--- a/src/ats-tests/ats-testing-experiment.c
+++ b/src/ats-tests/ats-testing-experiment.c
@@ -196,7 +196,8 @@ load_episode (struct Experiment *e,
196 GNUNET_asprintf(&op_name, "op-%u-type", op_counter); 196 GNUNET_asprintf(&op_name, "op-%u-type", op_counter);
197 if ( (GNUNET_SYSERR != GNUNET_CONFIGURATION_get_value_string(cfg, 197 if ( (GNUNET_SYSERR != GNUNET_CONFIGURATION_get_value_string(cfg,
198 sec_name, op_name, &type)) && 198 sec_name, op_name, &type)) &&
199 ((STOP_SEND != o->type) || (STOP_PREFERENCE != o->type))) 199 (STOP_SEND != o->type) &&
200 (STOP_PREFERENCE != o->type) )
200 { 201 {
201 /* Load arguments for set_rate, start_send, set_preference */ 202 /* Load arguments for set_rate, start_send, set_preference */
202 if (0 == strcmp (type, "constant")) 203 if (0 == strcmp (type, "constant"))
diff --git a/src/secretsharing/gnunet-service-secretsharing.c b/src/secretsharing/gnunet-service-secretsharing.c
index 660db3b6c..b97b6f62a 100644
--- a/src/secretsharing/gnunet-service-secretsharing.c
+++ b/src/secretsharing/gnunet-service-secretsharing.c
@@ -605,6 +605,7 @@ decrypt_session_destroy (struct DecryptSession *ds)
605 GNUNET_free (ds); 605 GNUNET_free (ds);
606} 606}
607 607
608
608static void 609static void
609keygen_info_destroy (struct KeygenPeerInfo *info) 610keygen_info_destroy (struct KeygenPeerInfo *info)
610{ 611{
@@ -621,7 +622,7 @@ keygen_info_destroy (struct KeygenPeerInfo *info)
621 if (NULL != info->preshare_commitment) 622 if (NULL != info->preshare_commitment)
622 { 623 {
623 gcry_mpi_release (info->preshare_commitment); 624 gcry_mpi_release (info->preshare_commitment);
624 info->presecret_commitment = NULL; 625 info->preshare_commitment = NULL;
625 } 626 }
626} 627}
627 628
diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c
index 14eefdfb3..5a764f91f 100644
--- a/src/transport/gnunet-service-transport.c
+++ b/src/transport/gnunet-service-transport.c
@@ -859,7 +859,6 @@ run (void *cls,
859 } 859 }
860 860
861 max_fd_rlimit = 0; 861 max_fd_rlimit = 0;
862 max_fd_cfg = 0;
863#if HAVE_GETRLIMIT 862#if HAVE_GETRLIMIT
864 struct rlimit r_file; 863 struct rlimit r_file;
865 if (0 == getrlimit (RLIMIT_NOFILE, &r_file)) 864 if (0 == getrlimit (RLIMIT_NOFILE, &r_file))
@@ -872,10 +871,12 @@ run (void *cls,
872 } 871 }
873 max_fd_rlimit = (9 * max_fd_rlimit) / 10; /* Keep 10% for rest of transport */ 872 max_fd_rlimit = (9 * max_fd_rlimit) / 10; /* Keep 10% for rest of transport */
874#endif 873#endif
875 GNUNET_CONFIGURATION_get_value_number (GST_cfg, 874 if (GNUNET_OK !=
876 "transport", 875 GNUNET_CONFIGURATION_get_value_number (GST_cfg,
877 "MAX_FD", 876 "transport",
878 &max_fd_cfg); 877 "MAX_FD",
878 &max_fd_cfg))
879 max_fd_cfg = max_fd_rlimit;
879 880
880 if (max_fd_cfg > max_fd_rlimit) 881 if (max_fd_cfg > max_fd_rlimit)
881 max_fd = max_fd_cfg; 882 max_fd = max_fd_cfg;
@@ -886,7 +887,9 @@ run (void *cls,
886 887
887 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 888 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
888 "Limiting number of sockets to %u: validation %u, neighbors: %u\n", 889 "Limiting number of sockets to %u: validation %u, neighbors: %u\n",
889 max_fd, (max_fd / 3), (max_fd / 3) * 2); 890 max_fd,
891 (max_fd / 3),
892 (max_fd / 3) * 2);
890 893
891 friend_only = GNUNET_CONFIGURATION_get_value_yesno (GST_cfg, 894 friend_only = GNUNET_CONFIGURATION_get_value_yesno (GST_cfg,
892 "topology", 895 "topology",
diff --git a/src/transport/gnunet-transport-profiler.c b/src/transport/gnunet-transport-profiler.c
index af47c5c56..99284990b 100644
--- a/src/transport/gnunet-transport-profiler.c
+++ b/src/transport/gnunet-transport-profiler.c
@@ -225,9 +225,10 @@ shutdown_task (void *cls)
225 225
226 avg_duration += icur->dur.rel_value_us / (1000); 226 avg_duration += icur->dur.rel_value_us / (1000);
227 avg_rate += icur->rate; 227 avg_rate += icur->rate;
228 iterations ++; 228 iterations++;
229 } 229 }
230 230 if (0 == iterations)
231 iterations = 1; /* avoid division by zero */
231 /* Calculate average rate */ 232 /* Calculate average rate */
232 avg_rate /= iterations; 233 avg_rate /= iterations;
233 /* Calculate average duration */ 234 /* Calculate average duration */
@@ -254,17 +255,27 @@ shutdown_task (void *cls)
254 stddev_duration = sqrtf(stddev_duration); 255 stddev_duration = sqrtf(stddev_duration);
255 256
256 /* Output */ 257 /* Output */
257 FPRINTF (stdout, _("%u;%u;%llu;%llu;%.2f;%.2f"),benchmark_count, benchmark_size, 258 FPRINTF (stdout,
258 avg_duration, (unsigned long long) stddev_duration, avg_rate, stddev_rate); 259 "%u;%u;%llu;%llu;%.2f;%.2f",
260 benchmark_count,
261 benchmark_size,
262 avg_duration,
263 (unsigned long long) stddev_duration,
264 avg_rate,
265 stddev_rate);
259 266
260 inext = ihead; 267 inext = ihead;
261 while (NULL != (icur = inext)) 268 while (NULL != (icur = inext))
262 { 269 {
263 inext = icur->next; 270 inext = icur->next;
264 GNUNET_CONTAINER_DLL_remove (ihead, itail, icur); 271 GNUNET_CONTAINER_DLL_remove (ihead,
272 itail,
273 icur);
265 274
266 FPRINTF (stdout, _(";%llu;%.2f"), 275 FPRINTF (stdout,
267 (long long unsigned int) (icur->dur.rel_value_us / 1000), icur->rate); 276 ";%llu;%.2f",
277 (long long unsigned int) (icur->dur.rel_value_us / 1000),
278 icur->rate);
268 279
269 GNUNET_free (icur); 280 GNUNET_free (icur);
270 } 281 }
@@ -274,13 +285,13 @@ shutdown_task (void *cls)
274 { 285 {
275 duration = GNUNET_TIME_absolute_get_duration (start_time); 286 duration = GNUNET_TIME_absolute_get_duration (start_time);
276 FPRINTF (stdout, 287 FPRINTF (stdout,
277 _("Received %llu bytes/s (%llu bytes in %s)\n"), 288 "Received %llu bytes/s (%llu bytes in %s)\n",
278 1000LL * 1000LL * traffic_received / (1 + duration.rel_value_us), 289 1000LL * 1000LL * traffic_received / (1 + duration.rel_value_us),
279 traffic_received, 290 traffic_received,
280 GNUNET_STRINGS_relative_time_to_string (duration, GNUNET_YES)); 291 GNUNET_STRINGS_relative_time_to_string (duration, GNUNET_YES));
281 } 292 }
282#endif 293#endif
283 FPRINTF (stdout, _("\n")); 294 FPRINTF (stdout, "\n");
284} 295}
285 296
286static void 297static void
@@ -333,7 +344,7 @@ transmit_data (void *cls,
333 } 344 }
334 if (verbosity > 0) 345 if (verbosity > 0)
335 if (itail->msgs_sent % 10 == 0 ) 346 if (itail->msgs_sent % 10 == 0 )
336 FPRINTF (stdout, _(".")); 347 FPRINTF (stdout, ".");
337 return size; 348 return size;
338} 349}
339 350
@@ -353,8 +364,10 @@ iteration_start ()
353 364
354 if (verbosity > 0) 365 if (verbosity > 0)
355 FPRINTF (stdout, 366 FPRINTF (stdout,
356 _("\nStarting benchmark to `%s', starting to send %u messages in %u byte blocks\n"), 367 "\nStarting benchmark to `%s', starting to send %u messages in %u byte blocks\n",
357 GNUNET_i2s (&pid), benchmark_count, benchmark_size); 368 GNUNET_i2s (&pid),
369 benchmark_count,
370 benchmark_size);
358 if (NULL == th) 371 if (NULL == th)
359 th = GNUNET_TRANSPORT_notify_transmit_ready (handle, &pid, benchmark_size, 372 th = GNUNET_TRANSPORT_notify_transmit_ready (handle, &pid, benchmark_size,
360 GNUNET_TIME_UNIT_FOREVER_REL, &transmit_data, NULL ); 373 GNUNET_TIME_UNIT_FOREVER_REL, &transmit_data, NULL );
@@ -401,15 +414,15 @@ notify_connect (void *cls,
401 sizeof(struct GNUNET_PeerIdentity))) 414 sizeof(struct GNUNET_PeerIdentity)))
402 { 415 {
403 FPRINTF (stdout, 416 FPRINTF (stdout,
404 _("Connected to different peer `%s'\n"), 417 "Connected to different peer `%s'\n",
405 GNUNET_i2s (&pid)); 418 GNUNET_i2s (&pid));
406 return; 419 return;
407 } 420 }
408 421
409 if (verbosity > 0) 422 if (verbosity > 0)
410 FPRINTF (stdout, 423 FPRINTF (stdout,
411 _("Successfully connected to `%s'\n"), 424 "Successfully connected to `%s'\n",
412 GNUNET_i2s (&pid)); 425 GNUNET_i2s (&pid));
413 iteration_start (); 426 iteration_start ();
414} 427}
415 428
@@ -429,7 +442,8 @@ notify_disconnect (void *cls,
429 return; 442 return;
430 if (GNUNET_YES == benchmark_running) 443 if (GNUNET_YES == benchmark_running)
431 { 444 {
432 FPRINTF (stdout, _("Disconnected from peer `%s' while benchmarking\n"), 445 FPRINTF (stdout,
446 "Disconnected from peer `%s' while benchmarking\n",
433 GNUNET_i2s (&pid)); 447 GNUNET_i2s (&pid));
434 return; 448 return;
435 } 449 }
@@ -454,7 +468,7 @@ notify_receive (void *cls,
454 return; 468 return;
455 if (verbosity > 0) 469 if (verbosity > 0)
456 FPRINTF (stdout, 470 FPRINTF (stdout,
457 _("Received %u bytes from %s\n"), 471 "Received %u bytes from %s\n",
458 (unsigned int) ntohs (message->size), 472 (unsigned int) ntohs (message->size),
459 GNUNET_i2s (peer)); 473 GNUNET_i2s (peer));
460 return; 474 return;
@@ -470,7 +484,7 @@ blacklist_cb (void *cls,
470 { 484 {
471 if (verbosity > 0) 485 if (verbosity > 0)
472 FPRINTF (stdout, 486 FPRINTF (stdout,
473 _("Denying connection to `%s'\n"), 487 "Denying connection to `%s'\n",
474 GNUNET_i2s (peer)); 488 GNUNET_i2s (peer));
475 return GNUNET_SYSERR; 489 return GNUNET_SYSERR;
476 } 490 }
@@ -494,26 +508,31 @@ testservice_task (void *cls, int result)
494 508
495 if (GNUNET_YES != result) 509 if (GNUNET_YES != result)
496 { 510 {
497 FPRINTF (stderr, _("Service `%s' is not running\n"), "transport"); 511 FPRINTF (stderr,
512 "TRANSPORT service is not running\n");
498 return; 513 return;
499 } 514 }
500 515
501 if (GNUNET_SERVER_MAX_MESSAGE_SIZE <= benchmark_size) 516 if (GNUNET_SERVER_MAX_MESSAGE_SIZE <= benchmark_size)
502 { 517 {
503 FPRINTF (stderr, _("Message size too big!\n")); 518 FPRINTF (stderr,
519 "Message size too big!\n");
504 return; 520 return;
505 } 521 }
506 522
507 if (NULL == cpid) 523 if (NULL == cpid)
508 { 524 {
509 FPRINTF (stderr, _("No peer identity given\n")); 525 FPRINTF (stderr,
526 "No peer identity given\n");
510 return; 527 return;
511 } 528 }
512 if ((GNUNET_OK != 529 if ((GNUNET_OK !=
513 GNUNET_CRYPTO_eddsa_public_key_from_string (cpid, strlen (cpid), 530 GNUNET_CRYPTO_eddsa_public_key_from_string (cpid, strlen (cpid),
514 &pid.public_key))) 531 &pid.public_key)))
515 { 532 {
516 FPRINTF (stderr, _("Failed to parse peer identity `%s'\n"), cpid); 533 FPRINTF (stderr,
534 "Failed to parse peer identity `%s'\n",
535 cpid);
517 return; 536 return;
518 } 537 }
519 538
@@ -521,25 +540,28 @@ testservice_task (void *cls, int result)
521 { 540 {
522 if (verbosity > 0) 541 if (verbosity > 0)
523 FPRINTF (stderr, 542 FPRINTF (stderr,
524 _("Trying to send %u messages with size %u to peer `%s'\n"), 543 "Trying to send %u messages with size %u to peer `%s'\n",
525 benchmark_count, benchmark_size, GNUNET_i2s (&pid)); 544 benchmark_count, benchmark_size,
545 GNUNET_i2s (&pid));
526 } 546 }
527 else if (1 == benchmark_receive) 547 else if (1 == benchmark_receive)
528 { 548 {
529 FPRINTF (stderr, 549 FPRINTF (stderr,
530 _("Trying to receive messages from peer `%s'\n"), 550 "Trying to receive messages from peer `%s'\n",
531 GNUNET_i2s (&pid)); 551 GNUNET_i2s (&pid));
532 } 552 }
533 else 553 else
534 { 554 {
535 FPRINTF (stderr, _("No operation given\n")); 555 FPRINTF (stderr,
556 "No operation given\n");
536 return; 557 return;
537 } 558 }
538 559
539 ats = GNUNET_ATS_connectivity_init (cfg); 560 ats = GNUNET_ATS_connectivity_init (cfg);
540 if (NULL == ats) 561 if (NULL == ats)
541 { 562 {
542 FPRINTF (stderr, "%s", _("Failed to connect to ATS service\n")); 563 FPRINTF (stderr,
564 "Failed to connect to ATS service\n");
543 ret = 1; 565 ret = 1;
544 return; 566 return;
545 } 567 }
@@ -550,7 +572,8 @@ testservice_task (void *cls, int result)
550 &notify_disconnect); 572 &notify_disconnect);
551 if (NULL == handle) 573 if (NULL == handle)
552 { 574 {
553 FPRINTF (stderr, "%s", _("Failed to connect to transport service\n")); 575 FPRINTF (stderr,
576 "Failed to connect to transport service\n");
554 GNUNET_ATS_connectivity_done (ats); 577 GNUNET_ATS_connectivity_done (ats);
555 ats = NULL; 578 ats = NULL;
556 ret = 1; 579 ret = 1;
@@ -583,8 +606,11 @@ run (void *cls,
583 const struct GNUNET_CONFIGURATION_Handle *mycfg) 606 const struct GNUNET_CONFIGURATION_Handle *mycfg)
584{ 607{
585 cfg = (struct GNUNET_CONFIGURATION_Handle *) mycfg; 608 cfg = (struct GNUNET_CONFIGURATION_Handle *) mycfg;
586 GNUNET_CLIENT_service_test ("transport", cfg, GNUNET_TIME_UNIT_SECONDS, 609 GNUNET_CLIENT_service_test ("transport",
587 &testservice_task, (void *) cfg); 610 cfg,
611 GNUNET_TIME_UNIT_SECONDS,
612 &testservice_task,
613 (void *) cfg);
588} 614}
589 615
590 616
diff --git a/src/transport/plugin_transport_http_server.c b/src/transport/plugin_transport_http_server.c
index c43124c2e..2baff35bf 100644
--- a/src/transport/plugin_transport_http_server.c
+++ b/src/transport/plugin_transport_http_server.c
@@ -3059,7 +3059,7 @@ server_configure_plugin (struct HTTP_Server_Plugin *plugin)
3059 "%s:%u/%s", 3059 "%s:%u/%s",
3060 tmp, 3060 tmp,
3061 (uint16_t) port, 3061 (uint16_t) port,
3062 (NULL == pos_url) ? "" : pos_url); 3062 pos_url);
3063 } 3063 }
3064 else 3064 else
3065 GNUNET_asprintf (&plugin->external_hostname, 3065 GNUNET_asprintf (&plugin->external_hostname,