diff options
author | Christian Grothoff <christian@grothoff.org> | 2017-01-16 18:13:09 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2017-01-16 18:13:25 +0100 |
commit | d55c8698825605630770157c786e064af0c20467 (patch) | |
tree | 3378ff4d011a9553939a01cb6afdd9cd2f70a679 /src/cadet/gnunet-service-cadet-new.c | |
parent | 73a48a626764013ab9f332810b5f7715c60105b4 (diff) | |
download | gnunet-d55c8698825605630770157c786e064af0c20467.tar.gz gnunet-d55c8698825605630770157c786e064af0c20467.zip |
more work on peers, paths and tunnels
Diffstat (limited to 'src/cadet/gnunet-service-cadet-new.c')
-rw-r--r-- | src/cadet/gnunet-service-cadet-new.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/cadet/gnunet-service-cadet-new.c b/src/cadet/gnunet-service-cadet-new.c index f367c4c73..74296a27e 100644 --- a/src/cadet/gnunet-service-cadet-new.c +++ b/src/cadet/gnunet-service-cadet-new.c | |||
@@ -271,8 +271,7 @@ GSC_bind (struct CadetClient *c, | |||
271 | msg->channel_id = lid; | 271 | msg->channel_id = lid; |
272 | msg->port = *port; | 272 | msg->port = *port; |
273 | msg->opt = htonl (options); | 273 | msg->opt = htonl (options); |
274 | GCP_id (dest, | 274 | msg->peer = *GCP_get_id (dest); |
275 | &msg->peer); | ||
276 | GSC_send_to_client (c, | 275 | GSC_send_to_client (c, |
277 | env); | 276 | env); |
278 | return lid; | 277 | return lid; |
@@ -732,15 +731,15 @@ handle_get_peers (void *cls, | |||
732 | * Message contains blocks of peers, first not included. | 731 | * Message contains blocks of peers, first not included. |
733 | * | 732 | * |
734 | * @param cls message queue for transmission | 733 | * @param cls message queue for transmission |
735 | * @param peer Peer this path is towards. | ||
736 | * @param path Path itself | 734 | * @param path Path itself |
735 | * @param off offset of the peer on @a path | ||
737 | * @return #GNUNET_YES if should keep iterating. | 736 | * @return #GNUNET_YES if should keep iterating. |
738 | * #GNUNET_NO otherwise. | 737 | * #GNUNET_NO otherwise. |
739 | */ | 738 | */ |
740 | static int | 739 | static int |
741 | path_info_iterator (void *cls, | 740 | path_info_iterator (void *cls, |
742 | struct CadetPeer *peer, | 741 | struct CadetPeerPath *path, |
743 | struct CadetPeerPath *path) | 742 | unsigned int off) |
744 | { | 743 | { |
745 | struct GNUNET_MQ_Handle *mq = cls; | 744 | struct GNUNET_MQ_Handle *mq = cls; |
746 | struct GNUNET_MQ_Envelope *env; | 745 | struct GNUNET_MQ_Envelope *env; |
@@ -767,10 +766,9 @@ path_info_iterator (void *cls, | |||
767 | /* Don't copy first peer. First peer is always the local one. Last | 766 | /* Don't copy first peer. First peer is always the local one. Last |
768 | * peer is always the destination (leave as 0, EOL). | 767 | * peer is always the destination (leave as 0, EOL). |
769 | */ | 768 | */ |
770 | for (i = 0; i < path_length - 1; i++) | 769 | for (i = 0; i < off; i++) |
771 | GCPP_get_pid_at_offset (path, | 770 | id[i] = *GCP_get_id (GCPP_get_peer_at_offset (path, |
772 | i + 1, | 771 | i + 1)); |
773 | &id[i]); | ||
774 | GNUNET_MQ_send (mq, | 772 | GNUNET_MQ_send (mq, |
775 | env); | 773 | env); |
776 | return GNUNET_YES; | 774 | return GNUNET_YES; |