diff options
author | Bart Polot <bart@net.in.tum.de> | 2016-07-20 17:13:26 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2016-07-20 17:13:26 +0000 |
commit | 90c70e8315c4a366996da379f839dc84d21d5f38 (patch) | |
tree | 0bfd73d2da8b8efb8de888c09ea4dd5bfc4cdb0f /src/rps | |
parent | 3aab63d5c50db0eb784d3b65b2bd989d3458c960 (diff) | |
download | gnunet-90c70e8315c4a366996da379f839dc84d21d5f38.tar.gz gnunet-90c70e8315c4a366996da379f839dc84d21d5f38.zip |
- fix CADET-using services
Diffstat (limited to 'src/rps')
-rw-r--r-- | src/rps/gnunet-service-rps.c | 9 | ||||
-rw-r--r-- | src/rps/gnunet-service-rps_peers.c | 14 | ||||
-rw-r--r-- | src/rps/gnunet-service-rps_peers.h | 6 |
3 files changed, 15 insertions, 14 deletions
diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c index bb2bd0881..00c541d1f 100644 --- a/src/rps/gnunet-service-rps.c +++ b/src/rps/gnunet-service-rps.c | |||
@@ -2334,13 +2334,14 @@ run (void *cls, | |||
2334 | {&handle_peer_pull_reply , GNUNET_MESSAGE_TYPE_RPS_PP_PULL_REPLY , 0}, | 2334 | {&handle_peer_pull_reply , GNUNET_MESSAGE_TYPE_RPS_PP_PULL_REPLY , 0}, |
2335 | {NULL, 0, 0} | 2335 | {NULL, 0, 0} |
2336 | }; | 2336 | }; |
2337 | const uint32_t ports[] = {GNUNET_RPS_CADET_PORT, 0}; // _PORT specified in src/rps/rps.h | ||
2338 | cadet_handle = GNUNET_CADET_connect (cfg, | 2337 | cadet_handle = GNUNET_CADET_connect (cfg, |
2339 | cls, | 2338 | cls, |
2340 | &Peers_handle_inbound_channel, | ||
2341 | &cleanup_destroyed_channel, | 2339 | &cleanup_destroyed_channel, |
2342 | cadet_handlers, | 2340 | cadet_handlers); |
2343 | ports); | 2341 | GNUNET_assert (NULL != cadet_handle); |
2342 | GNUNET_CADET_open_port (cadet_handle, GC_u2h (GNUNET_RPS_CADET_PORT), | ||
2343 | &Peers_handle_inbound_channel, cls); | ||
2344 | |||
2344 | 2345 | ||
2345 | peerinfo_handle = GNUNET_PEERINFO_connect (cfg); | 2346 | peerinfo_handle = GNUNET_PEERINFO_connect (cfg); |
2346 | Peers_initialise (fn_valid_peers, cadet_handle, &own_identity); | 2347 | Peers_initialise (fn_valid_peers, cadet_handle, &own_identity); |
diff --git a/src/rps/gnunet-service-rps_peers.c b/src/rps/gnunet-service-rps_peers.c index 2b5f39857..7c9f5ecd9 100644 --- a/src/rps/gnunet-service-rps_peers.c +++ b/src/rps/gnunet-service-rps_peers.c | |||
@@ -174,7 +174,7 @@ struct PeerContext | |||
174 | * Identity of the peer | 174 | * Identity of the peer |
175 | */ | 175 | */ |
176 | struct GNUNET_PeerIdentity peer_id; | 176 | struct GNUNET_PeerIdentity peer_id; |
177 | 177 | ||
178 | /** | 178 | /** |
179 | * Flags indicating status of peer | 179 | * Flags indicating status of peer |
180 | */ | 180 | */ |
@@ -506,7 +506,7 @@ get_channel (const struct GNUNET_PeerIdentity *peer) | |||
506 | GNUNET_CADET_channel_create (cadet_handle, | 506 | GNUNET_CADET_channel_create (cadet_handle, |
507 | peer_ctx->send_channel_flags, /* context */ | 507 | peer_ctx->send_channel_flags, /* context */ |
508 | peer, | 508 | peer, |
509 | GNUNET_RPS_CADET_PORT, | 509 | GC_u2h (GNUNET_RPS_CADET_PORT), |
510 | GNUNET_CADET_OPTION_RELIABLE); | 510 | GNUNET_CADET_OPTION_RELIABLE); |
511 | } | 511 | } |
512 | GNUNET_assert (NULL != peer_ctx->send_channel); | 512 | GNUNET_assert (NULL != peer_ctx->send_channel); |
@@ -518,7 +518,7 @@ get_channel (const struct GNUNET_PeerIdentity *peer) | |||
518 | * | 518 | * |
519 | * If we already have a message queue open to this client, | 519 | * If we already have a message queue open to this client, |
520 | * simply return it, otherways create one. | 520 | * simply return it, otherways create one. |
521 | * | 521 | * |
522 | * @param peer the peer to get the mq to | 522 | * @param peer the peer to get the mq to |
523 | * @return the #GNUNET_MQ_Handle | 523 | * @return the #GNUNET_MQ_Handle |
524 | */ | 524 | */ |
@@ -1086,7 +1086,7 @@ Peers_clean_peer (const struct GNUNET_PeerIdentity *peer) | |||
1086 | 1086 | ||
1087 | // TODO actually remove unnecessary data | 1087 | // TODO actually remove unnecessary data |
1088 | 1088 | ||
1089 | if (GNUNET_NO == GNUNET_CONTAINER_multipeermap_contains (peer_map, peer)) | 1089 | if (GNUNET_NO == GNUNET_CONTAINER_multipeermap_contains (peer_map, peer)) |
1090 | { | 1090 | { |
1091 | return GNUNET_NO; | 1091 | return GNUNET_NO; |
1092 | } | 1092 | } |
@@ -1104,7 +1104,7 @@ Peers_clean_peer (const struct GNUNET_PeerIdentity *peer) | |||
1104 | 1104 | ||
1105 | /** | 1105 | /** |
1106 | * @brief Remove peer | 1106 | * @brief Remove peer |
1107 | * | 1107 | * |
1108 | * @param peer the peer to clean | 1108 | * @param peer the peer to clean |
1109 | * @return #GNUNET_YES if peer was removed | 1109 | * @return #GNUNET_YES if peer was removed |
1110 | * #GNUNET_NO otherwise | 1110 | * #GNUNET_NO otherwise |
@@ -1114,7 +1114,7 @@ Peers_remove_peer (const struct GNUNET_PeerIdentity *peer) | |||
1114 | { | 1114 | { |
1115 | struct PeerContext *peer_ctx; | 1115 | struct PeerContext *peer_ctx; |
1116 | 1116 | ||
1117 | if (GNUNET_NO == GNUNET_CONTAINER_multipeermap_contains (peer_map, peer)) | 1117 | if (GNUNET_NO == GNUNET_CONTAINER_multipeermap_contains (peer_map, peer)) |
1118 | { | 1118 | { |
1119 | return GNUNET_NO; | 1119 | return GNUNET_NO; |
1120 | } | 1120 | } |
@@ -1350,7 +1350,7 @@ void * | |||
1350 | Peers_handle_inbound_channel (void *cls, | 1350 | Peers_handle_inbound_channel (void *cls, |
1351 | struct GNUNET_CADET_Channel *channel, | 1351 | struct GNUNET_CADET_Channel *channel, |
1352 | const struct GNUNET_PeerIdentity *initiator, | 1352 | const struct GNUNET_PeerIdentity *initiator, |
1353 | uint32_t port, | 1353 | const struct GNUNET_HashCode *port, |
1354 | enum GNUNET_CADET_ChannelOption options) | 1354 | enum GNUNET_CADET_ChannelOption options) |
1355 | { | 1355 | { |
1356 | struct PeerContext *peer_ctx; | 1356 | struct PeerContext *peer_ctx; |
diff --git a/src/rps/gnunet-service-rps_peers.h b/src/rps/gnunet-service-rps_peers.h index abb5d831a..c7b9ed265 100644 --- a/src/rps/gnunet-service-rps_peers.h +++ b/src/rps/gnunet-service-rps_peers.h | |||
@@ -173,7 +173,7 @@ Peers_issue_peer_liveliness_check (const struct GNUNET_PeerIdentity *peer); | |||
173 | 173 | ||
174 | /** | 174 | /** |
175 | * @brief Remove unecessary data | 175 | * @brief Remove unecessary data |
176 | * | 176 | * |
177 | * If the other peer is not intending to send messages, we have messages pending | 177 | * If the other peer is not intending to send messages, we have messages pending |
178 | * to be sent to this peer and we are not waiting for a reply, remove the | 178 | * to be sent to this peer and we are not waiting for a reply, remove the |
179 | * information about it (its #PeerContext). | 179 | * information about it (its #PeerContext). |
@@ -187,7 +187,7 @@ Peers_clean_peer (const struct GNUNET_PeerIdentity *peer); | |||
187 | 187 | ||
188 | /** | 188 | /** |
189 | * @brief Remove peer | 189 | * @brief Remove peer |
190 | * | 190 | * |
191 | * @param peer the peer to clean | 191 | * @param peer the peer to clean |
192 | * @return #GNUNET_YES if peer was removed | 192 | * @return #GNUNET_YES if peer was removed |
193 | * #GNUNET_NO otherwise | 193 | * #GNUNET_NO otherwise |
@@ -320,7 +320,7 @@ void * | |||
320 | Peers_handle_inbound_channel (void *cls, | 320 | Peers_handle_inbound_channel (void *cls, |
321 | struct GNUNET_CADET_Channel *channel, | 321 | struct GNUNET_CADET_Channel *channel, |
322 | const struct GNUNET_PeerIdentity *initiator, | 322 | const struct GNUNET_PeerIdentity *initiator, |
323 | uint32_t port, | 323 | const struct GNUNET_HashCode *port, |
324 | enum GNUNET_CADET_ChannelOption options); | 324 | enum GNUNET_CADET_ChannelOption options); |
325 | 325 | ||
326 | /** | 326 | /** |