diff options
author | Julius Bünger <buenger@mytum.de> | 2018-09-18 13:59:37 +0200 |
---|---|---|
committer | Julius Bünger <buenger@mytum.de> | 2018-09-18 17:20:26 +0200 |
commit | bd6822783a5daa6d03f1af13e0b4f05ba56df42a (patch) | |
tree | efb66dd0dbae17a66783c751d3e16ef226a84363 /src/rps/gnunet-rps.c | |
parent | 2db3016405377f2d600f6029616eb1b5b391b685 (diff) | |
download | gnunet-bd6822783a5daa6d03f1af13e0b4f05ba56df42a.tar.gz gnunet-bd6822783a5daa6d03f1af13e0b4f05ba56df42a.zip |
Add possibility to send multiple peers to client
Diffstat (limited to 'src/rps/gnunet-rps.c')
-rw-r--r-- | src/rps/gnunet-rps.c | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/src/rps/gnunet-rps.c b/src/rps/gnunet-rps.c index d2c497fd4..d0f905f51 100644 --- a/src/rps/gnunet-rps.c +++ b/src/rps/gnunet-rps.c | |||
@@ -59,7 +59,7 @@ static int stream_input; | |||
59 | static uint64_t num_view_updates; | 59 | static uint64_t num_view_updates; |
60 | 60 | ||
61 | /** | 61 | /** |
62 | * @brief Number of updates we want to receive | 62 | * @brief Number of peers we want to receive from stream |
63 | */ | 63 | */ |
64 | static uint64_t num_stream_peers; | 64 | static uint64_t num_stream_peers; |
65 | 65 | ||
@@ -154,11 +154,33 @@ view_update_handle (void *cls, | |||
154 | */ | 154 | */ |
155 | static void | 155 | static void |
156 | stream_input_handle (void *cls, | 156 | stream_input_handle (void *cls, |
157 | const struct GNUNET_PeerIdentity *recv_peer) | 157 | uint64_t num_peers, |
158 | const struct GNUNET_PeerIdentity *recv_peers) | ||
158 | { | 159 | { |
159 | // TODO when source of peer is sent, also print source | 160 | uint64_t i; |
160 | FPRINTF (stdout, "%s\n", | 161 | (void) cls; |
161 | GNUNET_i2s_full (recv_peer)); | 162 | |
163 | if (0 == num_peers) | ||
164 | { | ||
165 | FPRINTF (stdout, "Empty view\n"); | ||
166 | } | ||
167 | req_handle = NULL; | ||
168 | for (i = 0; i < num_peers; i++) | ||
169 | { | ||
170 | FPRINTF (stdout, "%s\n", | ||
171 | GNUNET_i2s_full (&recv_peers[i])); | ||
172 | |||
173 | if (1 == num_stream_peers) | ||
174 | { | ||
175 | ret = 0; | ||
176 | GNUNET_SCHEDULER_shutdown (); | ||
177 | break; | ||
178 | } | ||
179 | else if (1 < num_stream_peers) | ||
180 | { | ||
181 | num_stream_peers--; | ||
182 | } | ||
183 | } | ||
162 | } | 184 | } |
163 | 185 | ||
164 | 186 | ||