aboutsummaryrefslogtreecommitdiff
path: root/src/rps/gnunet-rps.c
diff options
context:
space:
mode:
authorJulius Bünger <buenger@mytum.de>2018-10-14 13:35:23 +0200
committerJulius Bünger <buenger@mytum.de>2018-10-14 13:35:23 +0200
commit6048d2a10a95822d06b5d7be640adc89a895b01a (patch)
treee53b7a7efcebe282b49dff4b258f26dcbb71442a /src/rps/gnunet-rps.c
parent10a1964c7c8fc9d2f9eab2942fa71fa00318a1b4 (diff)
downloadgnunet-6048d2a10a95822d06b5d7be640adc89a895b01a.tar.gz
gnunet-6048d2a10a95822d06b5d7be640adc89a895b01a.zip
RPS API: Remove numer of peers from stream request
Diffstat (limited to 'src/rps/gnunet-rps.c')
-rw-r--r--src/rps/gnunet-rps.c31
1 files changed, 2 insertions, 29 deletions
diff --git a/src/rps/gnunet-rps.c b/src/rps/gnunet-rps.c
index d0f905f51..49189481f 100644
--- a/src/rps/gnunet-rps.c
+++ b/src/rps/gnunet-rps.c
@@ -58,11 +58,6 @@ static int stream_input;
58 */ 58 */
59static uint64_t num_view_updates; 59static uint64_t num_view_updates;
60 60
61/**
62 * @brief Number of peers we want to receive from stream
63 */
64static uint64_t num_stream_peers;
65
66 61
67/** 62/**
68 * Task run when user presses CTRL-C to abort. 63 * Task run when user presses CTRL-C to abort.
@@ -162,24 +157,13 @@ stream_input_handle (void *cls,
162 157
163 if (0 == num_peers) 158 if (0 == num_peers)
164 { 159 {
165 FPRINTF (stdout, "Empty view\n"); 160 FPRINTF (stdout, "No peer was returned\n");
166 } 161 }
167 req_handle = NULL; 162 req_handle = NULL;
168 for (i = 0; i < num_peers; i++) 163 for (i = 0; i < num_peers; i++)
169 { 164 {
170 FPRINTF (stdout, "%s\n", 165 FPRINTF (stdout, "%s\n",
171 GNUNET_i2s_full (&recv_peers[i])); 166 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 } 167 }
184} 168}
185 169
@@ -243,18 +227,7 @@ run (void *cls,
243 } else if (stream_input) 227 } else if (stream_input)
244 { 228 {
245 /* Get updates of view */ 229 /* Get updates of view */
246 if (NULL == args[0] || 230 GNUNET_RPS_stream_request (rps_handle, stream_input_handle, NULL);
247 0 == sscanf (args[0], "%lu", &num_stream_peers))
248 {
249 num_stream_peers = 0;
250 }
251 GNUNET_RPS_stream_request (rps_handle, num_stream_peers, stream_input_handle, NULL);
252 if (0 != num_stream_peers)
253 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
254 "Requesting %" PRIu64 " peers from biased stream\n", num_stream_peers);
255 else
256 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
257 "Requesting continuous peers from biased stream\n");
258 GNUNET_SCHEDULER_add_shutdown (&do_shutdown, NULL); 231 GNUNET_SCHEDULER_add_shutdown (&do_shutdown, NULL);
259 } 232 }
260 else 233 else