diff options
Diffstat (limited to 'src/ats/ats_api_performance.c')
-rw-r--r-- | src/ats/ats_api_performance.c | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/src/ats/ats_api_performance.c b/src/ats/ats_api_performance.c index 66cfda88e..49e0df595 100644 --- a/src/ats/ats_api_performance.c +++ b/src/ats/ats_api_performance.c | |||
@@ -122,6 +122,21 @@ struct GNUNET_ATS_AddressListHandle | |||
122 | struct GNUNET_ATS_AddressListHandle *prev; | 122 | struct GNUNET_ATS_AddressListHandle *prev; |
123 | 123 | ||
124 | /** | 124 | /** |
125 | * Performance handle | ||
126 | */ | ||
127 | struct GNUNET_ATS_PerformanceHandle *ph; | ||
128 | |||
129 | /** | ||
130 | * Callback | ||
131 | */ | ||
132 | GNUNET_ATS_PeerInformationCallback cb; | ||
133 | |||
134 | /** | ||
135 | * Callback closure | ||
136 | */ | ||
137 | void *cb_cls; | ||
138 | |||
139 | /** | ||
125 | * Target peer. | 140 | * Target peer. |
126 | */ | 141 | */ |
127 | struct GNUNET_PeerIdentity peer; | 142 | struct GNUNET_PeerIdentity peer; |
@@ -519,12 +534,19 @@ GNUNET_ATS_performance_done (struct GNUNET_ATS_PerformanceHandle *ph) | |||
519 | { | 534 | { |
520 | struct PendingMessage *p; | 535 | struct PendingMessage *p; |
521 | struct GNUNET_ATS_ReservationContext *rc; | 536 | struct GNUNET_ATS_ReservationContext *rc; |
537 | struct GNUNET_ATS_AddressListHandle *alh; | ||
522 | 538 | ||
523 | while (NULL != (p = ph->pending_head)) | 539 | while (NULL != (p = ph->pending_head)) |
524 | { | 540 | { |
525 | GNUNET_CONTAINER_DLL_remove (ph->pending_head, ph->pending_tail, p); | 541 | GNUNET_CONTAINER_DLL_remove (ph->pending_head, ph->pending_tail, p); |
526 | GNUNET_free (p); | 542 | GNUNET_free (p); |
527 | } | 543 | } |
544 | while (NULL != (alh = ph->addresslist_head)) | ||
545 | { | ||
546 | GNUNET_CONTAINER_DLL_remove (ph->addresslist_head, ph->addresslist_tail, | ||
547 | alh); | ||
548 | GNUNET_free (alh); | ||
549 | } | ||
528 | while (NULL != (rc = ph->reservation_head)) | 550 | while (NULL != (rc = ph->reservation_head)) |
529 | { | 551 | { |
530 | GNUNET_CONTAINER_DLL_remove (ph->reservation_head, ph->reservation_tail, | 552 | GNUNET_CONTAINER_DLL_remove (ph->reservation_head, ph->reservation_tail, |
@@ -630,6 +652,9 @@ GNUNET_ATS_performance_list_addresses (struct GNUNET_ATS_PerformanceHandle *hand | |||
630 | GNUNET_assert (NULL != handle); | 652 | GNUNET_assert (NULL != handle); |
631 | 653 | ||
632 | alh = GNUNET_malloc (sizeof (struct GNUNET_ATS_AddressListHandle)); | 654 | alh = GNUNET_malloc (sizeof (struct GNUNET_ATS_AddressListHandle)); |
655 | alh->cb = infocb; | ||
656 | alh->cb_cls = infocb_cls; | ||
657 | alh->ph = handle; | ||
633 | alh->all_addresses = all; | 658 | alh->all_addresses = all; |
634 | if (NULL == peer) | 659 | if (NULL == peer) |
635 | alh->all_peers = GNUNET_YES; | 660 | alh->all_peers = GNUNET_YES; |
@@ -642,6 +667,7 @@ GNUNET_ATS_performance_list_addresses (struct GNUNET_ATS_PerformanceHandle *hand | |||
642 | GNUNET_CONTAINER_DLL_insert (handle->addresslist_head, handle->addresslist_tail, alh); | 667 | GNUNET_CONTAINER_DLL_insert (handle->addresslist_head, handle->addresslist_tail, alh); |
643 | 668 | ||
644 | /* TODO */ | 669 | /* TODO */ |
670 | FPRINTF (stderr, "TBD"); | ||
645 | 671 | ||
646 | return alh; | 672 | return alh; |
647 | } | 673 | } |
@@ -655,8 +681,10 @@ GNUNET_ATS_performance_list_addresses (struct GNUNET_ATS_PerformanceHandle *hand | |||
655 | void | 681 | void |
656 | GNUNET_ATS_performance_list_addresses_cancel (struct GNUNET_ATS_AddressListHandle *handle) | 682 | GNUNET_ATS_performance_list_addresses_cancel (struct GNUNET_ATS_AddressListHandle *handle) |
657 | { | 683 | { |
684 | GNUNET_assert (NULL != handle); | ||
658 | 685 | ||
659 | 686 | GNUNET_CONTAINER_DLL_remove (handle->ph->addresslist_head, handle->ph->addresslist_tail, handle); | |
687 | GNUNET_free (handle); | ||
660 | } | 688 | } |
661 | 689 | ||
662 | 690 | ||