diff options
-rw-r--r-- | src/rps/gnunet-service-rps.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c index 591b39756..325abb7a2 100644 --- a/src/rps/gnunet-service-rps.c +++ b/src/rps/gnunet-service-rps.c | |||
@@ -689,18 +689,21 @@ get_channel (struct GNUNET_CONTAINER_MultiPeerMap *peer_map, | |||
689 | get_mq (struct GNUNET_CONTAINER_MultiPeerMap *peer_map, | 689 | get_mq (struct GNUNET_CONTAINER_MultiPeerMap *peer_map, |
690 | const struct GNUNET_PeerIdentity *peer_id) | 690 | const struct GNUNET_PeerIdentity *peer_id) |
691 | { | 691 | { |
692 | struct PeerContext *ctx; | 692 | struct PeerContext *peer_ctx; |
693 | |||
694 | peer_ctx = get_peer_ctx (peer_map, peer_id); | ||
695 | |||
696 | GNUNET_assert (NULL == peer_ctx->is_live_task); | ||
693 | 697 | ||
694 | ctx = get_peer_ctx (peer_map, peer_id); | 698 | if (NULL == peer_ctx->mq) |
695 | if (NULL == ctx->mq) | ||
696 | { | 699 | { |
697 | (void) get_channel (peer_map, peer_id); | 700 | (void) get_channel (peer_map, peer_id); |
698 | ctx->mq = GNUNET_CADET_mq_create (ctx->send_channel); | 701 | peer_ctx->mq = GNUNET_CADET_mq_create (peer_ctx->send_channel); |
699 | //do I have to explicitly put it in the peer_map? | 702 | //do I have to explicitly put it in the peer_map? |
700 | (void) GNUNET_CONTAINER_multipeermap_put (peer_map, peer_id, ctx, | 703 | (void) GNUNET_CONTAINER_multipeermap_put (peer_map, peer_id, peer_ctx, |
701 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_REPLACE); | 704 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_REPLACE); |
702 | } | 705 | } |
703 | return ctx->mq; | 706 | return peer_ctx->mq; |
704 | } | 707 | } |
705 | 708 | ||
706 | 709 | ||
@@ -1225,8 +1228,8 @@ handle_peer_pull_reply (void *cls, | |||
1225 | for ( i = 0 ; i < ntohl (in_msg->num_peers) ; i++ ) | 1228 | for ( i = 0 ; i < ntohl (in_msg->num_peers) ; i++ ) |
1226 | { | 1229 | { |
1227 | peer_ctx = get_peer_ctx (peer_map, &peers[i]); | 1230 | peer_ctx = get_peer_ctx (peer_map, &peers[i]); |
1228 | if ((0 != (peer_ctx->peer_flags && LIVING)) || | 1231 | if (NULL != peer_ctx->send_channel |
1229 | NULL != peer_ctx->recv_channel) | 1232 | || NULL != peer_ctx->recv_channel) |
1230 | { | 1233 | { |
1231 | if (GNUNET_NO == in_arr (pull_list, pull_list_size, &peers[i])) | 1234 | if (GNUNET_NO == in_arr (pull_list, pull_list_size, &peers[i])) |
1232 | GNUNET_array_append (pull_list, pull_list_size, peers[i]); | 1235 | GNUNET_array_append (pull_list, pull_list_size, peers[i]); |