diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2014-07-17 14:43:53 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2014-07-17 14:43:53 +0000 |
commit | dcbebc79956475875118e6d5f43068068fad2107 (patch) | |
tree | 845c89ed968fab344ac87a889e494fece21ea430 /src/ats-tool | |
parent | 51587c720c8265adefd30fd0949a7bb30cafa1f3 (diff) | |
download | gnunet-dcbebc79956475875118e6d5f43068068fad2107.tar.gz gnunet-dcbebc79956475875118e6d5f43068068fad2107.zip |
fixing assertion in gnunet-ats.c:250: hashmap did not copy peer ids -> crash
Diffstat (limited to 'src/ats-tool')
-rw-r--r-- | src/ats-tool/gnunet-ats.c | 33 |
1 files changed, 12 insertions, 21 deletions
diff --git a/src/ats-tool/gnunet-ats.c b/src/ats-tool/gnunet-ats.c index 0e27ee6f8..54ee170eb 100644 --- a/src/ats-tool/gnunet-ats.c +++ b/src/ats-tool/gnunet-ats.c | |||
@@ -242,10 +242,9 @@ free_addr_it (void *cls, | |||
242 | { | 242 | { |
243 | struct ATSAddress *a = value; | 243 | struct ATSAddress *a = value; |
244 | 244 | ||
245 | GNUNET_break (GNUNET_OK == | 245 | fprintf (stderr, "FREEING %s %p\n", GNUNET_i2s(key), value); |
246 | GNUNET_CONTAINER_multipeermap_remove (addresses, | 246 | |
247 | key, | 247 | GNUNET_assert (GNUNET_OK == GNUNET_CONTAINER_multipeermap_remove (addresses, key, value)); |
248 | a)); | ||
249 | GNUNET_HELLO_address_free (a->address); | 248 | GNUNET_HELLO_address_free (a->address); |
250 | GNUNET_free (a); | 249 | GNUNET_free (a); |
251 | return GNUNET_OK; | 250 | return GNUNET_OK; |
@@ -535,19 +534,15 @@ ats_perf_mon_cb (void *cls, | |||
535 | 534 | ||
536 | actx.src = address; | 535 | actx.src = address; |
537 | actx.res = NULL; | 536 | actx.res = NULL; |
538 | GNUNET_CONTAINER_multipeermap_get_multiple (addresses, | 537 | GNUNET_CONTAINER_multipeermap_get_multiple (addresses, &address->peer, |
539 | &address->peer, | 538 | &find_address_it, &actx); |
540 | &find_address_it, | ||
541 | &actx); | ||
542 | if (NULL == actx.res) | 539 | if (NULL == actx.res) |
543 | { | 540 | { |
544 | GNUNET_break (0); | 541 | GNUNET_break (0); |
545 | return; | 542 | return; |
546 | } | 543 | } |
547 | GNUNET_break (GNUNET_OK == | 544 | GNUNET_break( |
548 | GNUNET_CONTAINER_multipeermap_remove (addresses, | 545 | GNUNET_OK == GNUNET_CONTAINER_multipeermap_remove (addresses, &address->peer, actx.res)); |
549 | &address->peer, | ||
550 | actx.res)); | ||
551 | FPRINTF (stderr, | 546 | FPRINTF (stderr, |
552 | _("Removed address of peer `%s' with plugin `%s'\n"), | 547 | _("Removed address of peer `%s' with plugin `%s'\n"), |
553 | GNUNET_i2s (&address->peer), | 548 | GNUNET_i2s (&address->peer), |
@@ -564,10 +559,8 @@ ats_perf_mon_cb (void *cls, | |||
564 | 559 | ||
565 | actx.src = address; | 560 | actx.src = address; |
566 | actx.res = NULL; | 561 | actx.res = NULL; |
567 | GNUNET_CONTAINER_multipeermap_get_multiple (addresses, | 562 | GNUNET_CONTAINER_multipeermap_get_multiple (addresses, &address->peer, |
568 | &address->peer, | 563 | &find_address_it, &actx); |
569 | &find_address_it, | ||
570 | &actx); | ||
571 | if ((NULL != actx.res)) | 564 | if ((NULL != actx.res)) |
572 | { | 565 | { |
573 | if ((bandwidth_in.value__ == actx.res->bandwidth_in.value__) && | 566 | if ((bandwidth_in.value__ == actx.res->bandwidth_in.value__) && |
@@ -590,10 +583,8 @@ ats_perf_mon_cb (void *cls, | |||
590 | a->bandwidth_in = bandwidth_in; | 583 | a->bandwidth_in = bandwidth_in; |
591 | a->bandwidth_out = bandwidth_out; | 584 | a->bandwidth_out = bandwidth_out; |
592 | a->active = active; | 585 | a->active = active; |
593 | GNUNET_CONTAINER_multipeermap_put (addresses, | 586 | GNUNET_CONTAINER_multipeermap_put (addresses, &address->peer, a, |
594 | &address->peer, | 587 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE); |
595 | a, | ||
596 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE); | ||
597 | } | 588 | } |
598 | } | 589 | } |
599 | 590 | ||
@@ -783,7 +774,7 @@ testservice_ats (void *cls, | |||
783 | unsigned int c; | 774 | unsigned int c; |
784 | unsigned int type; | 775 | unsigned int type; |
785 | 776 | ||
786 | addresses = GNUNET_CONTAINER_multipeermap_create (10, GNUNET_YES); | 777 | addresses = GNUNET_CONTAINER_multipeermap_create (10, GNUNET_NO); |
787 | 778 | ||
788 | if (GNUNET_YES != result) | 779 | if (GNUNET_YES != result) |
789 | { | 780 | { |