diff options
author | Christian Grothoff <christian@grothoff.org> | 2019-01-27 04:21:27 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2019-01-27 04:21:27 +0100 |
commit | f0b35049f6d9e743d2bc5fcf11664633d130d6fc (patch) | |
tree | bee27beb5d8a25ca043e483a40400fef783056c9 /src/cadet/gnunet-cadet.c | |
parent | d3f013aba71486c121800d279cd1d3af4425c412 (diff) | |
download | gnunet-f0b35049f6d9e743d2bc5fcf11664633d130d6fc.tar.gz gnunet-f0b35049f6d9e743d2bc5fcf11664633d130d6fc.zip |
more work towards fixing #5385
Diffstat (limited to 'src/cadet/gnunet-cadet.c')
-rw-r--r-- | src/cadet/gnunet-cadet.c | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/src/cadet/gnunet-cadet.c b/src/cadet/gnunet-cadet.c index 3386f7464..9e2d105b3 100644 --- a/src/cadet/gnunet-cadet.c +++ b/src/cadet/gnunet-cadet.c | |||
@@ -109,7 +109,12 @@ static struct GNUNET_CADET_GetPath *gpo; | |||
109 | /** | 109 | /** |
110 | * Active peer listing operation. | 110 | * Active peer listing operation. |
111 | */ | 111 | */ |
112 | struct GNUNET_CADET_PeersLister *plo; | 112 | static struct GNUNET_CADET_PeersLister *plo; |
113 | |||
114 | /** | ||
115 | * Active tunnel listing operation. | ||
116 | */ | ||
117 | static struct GNUNET_CADET_ListTunnels *tio; | ||
113 | 118 | ||
114 | /** | 119 | /** |
115 | * Channel handle. | 120 | * Channel handle. |
@@ -231,6 +236,11 @@ shutdown_task (void *cls) | |||
231 | GNUNET_CADET_list_peers_cancel (plo); | 236 | GNUNET_CADET_list_peers_cancel (plo); |
232 | plo = NULL; | 237 | plo = NULL; |
233 | } | 238 | } |
239 | if (NULL != tio) | ||
240 | { | ||
241 | GNUNET_CADET_list_tunnels_cancel (tio); | ||
242 | tio = NULL; | ||
243 | } | ||
234 | if (NULL != mh) | 244 | if (NULL != mh) |
235 | { | 245 | { |
236 | GNUNET_CADET_disconnect (mh); | 246 | GNUNET_CADET_disconnect (mh); |
@@ -569,32 +579,25 @@ path_callback (void *cls, | |||
569 | * Method called to retrieve information about all tunnels in CADET. | 579 | * Method called to retrieve information about all tunnels in CADET. |
570 | * | 580 | * |
571 | * @param cls Closure. | 581 | * @param cls Closure. |
572 | * @param peer Destination peer. | 582 | * @param td tunnel details |
573 | * @param channels Number of channels. | ||
574 | * @param connections Number of connections. | ||
575 | * @param estate Encryption state. | ||
576 | * @param cstate Connectivity state. | ||
577 | */ | 583 | */ |
578 | static void | 584 | static void |
579 | tunnels_callback (void *cls, | 585 | tunnels_callback (void *cls, |
580 | const struct GNUNET_PeerIdentity *peer, | 586 | const struct GNUNET_CADET_TunnelDetails *td) |
581 | unsigned int channels, | ||
582 | unsigned int connections, | ||
583 | uint16_t estate, | ||
584 | uint16_t cstate) | ||
585 | { | 587 | { |
586 | if (NULL == peer) | 588 | if (NULL == td) |
587 | { | 589 | { |
590 | tio = NULL; | ||
588 | GNUNET_SCHEDULER_shutdown(); | 591 | GNUNET_SCHEDULER_shutdown(); |
589 | return; | 592 | return; |
590 | } | 593 | } |
591 | FPRINTF (stdout, | 594 | FPRINTF (stdout, |
592 | "%s [ENC: %s, CON: %s] CHs: %u, CONNs: %u\n", | 595 | "%s [ENC: %s, CON: %s] CHs: %u, CONNs: %u\n", |
593 | GNUNET_i2s_full (peer), | 596 | GNUNET_i2s_full (&td->peer), |
594 | enc_2s (estate), | 597 | enc_2s (td->estate), |
595 | conn_2s (cstate), | 598 | conn_2s (td->cstate), |
596 | channels, | 599 | td->channels, |
597 | connections); | 600 | td->connections); |
598 | } | 601 | } |
599 | 602 | ||
600 | 603 | ||
@@ -692,11 +695,9 @@ static void | |||
692 | get_tunnels (void *cls) | 695 | get_tunnels (void *cls) |
693 | { | 696 | { |
694 | job = NULL; | 697 | job = NULL; |
695 | #if FIXME5385 | 698 | tio = GNUNET_CADET_list_tunnels (my_cfg, |
696 | GNUNET_CADET_list_tunnels (my_cfg, | 699 | &tunnels_callback, |
697 | &tunnels_callback, | 700 | NULL); |
698 | NULL); | ||
699 | #endif | ||
700 | } | 701 | } |
701 | 702 | ||
702 | 703 | ||