aboutsummaryrefslogtreecommitdiff
path: root/src/dht/gnunet-service-dht_routing.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-01-15 18:46:17 +0100
committerChristian Grothoff <christian@grothoff.org>2017-01-15 18:46:17 +0100
commit5b32752cd7b02adcb8e6fec7798637638c6f63a0 (patch)
tree2756224d5fff5c1427ab08454c2ee29a0f620c4e /src/dht/gnunet-service-dht_routing.c
parent16fd15965ca4a9a2986f60a7301e86ecb06eb6e3 (diff)
downloadgnunet-5b32752cd7b02adcb8e6fec7798637638c6f63a0.tar.gz
gnunet-5b32752cd7b02adcb8e6fec7798637638c6f63a0.zip
indentation fixes
Diffstat (limited to 'src/dht/gnunet-service-dht_routing.c')
-rw-r--r--src/dht/gnunet-service-dht_routing.c36
1 files changed, 24 insertions, 12 deletions
diff --git a/src/dht/gnunet-service-dht_routing.c b/src/dht/gnunet-service-dht_routing.c
index 38e5fc1c7..978c46d73 100644
--- a/src/dht/gnunet-service-dht_routing.c
+++ b/src/dht/gnunet-service-dht_routing.c
@@ -160,7 +160,9 @@ struct ProcessContext
160 * #GNUNET_SYSERR if the result is malformed or type unsupported 160 * #GNUNET_SYSERR if the result is malformed or type unsupported
161 */ 161 */
162static int 162static int
163process (void *cls, const struct GNUNET_HashCode * key, void *value) 163process (void *cls,
164 const struct GNUNET_HashCode *key,
165 void *value)
164{ 166{
165 struct ProcessContext *pc = cls; 167 struct ProcessContext *pc = cls;
166 struct RecentRequest *rr = value; 168 struct RecentRequest *rr = value;
@@ -170,7 +172,8 @@ process (void *cls, const struct GNUNET_HashCode * key, void *value)
170 struct GNUNET_HashCode hc; 172 struct GNUNET_HashCode hc;
171 const struct GNUNET_HashCode *eval_key; 173 const struct GNUNET_HashCode *eval_key;
172 174
173 if ((rr->type != GNUNET_BLOCK_TYPE_ANY) && (rr->type != pc->type)) 175 if ( (rr->type != GNUNET_BLOCK_TYPE_ANY) &&
176 (rr->type != pc->type) )
174 return GNUNET_OK; /* type missmatch */ 177 return GNUNET_OK; /* type missmatch */
175 178
176 if (0 != (rr->options & GNUNET_DHT_RO_RECORD_ROUTE)) 179 if (0 != (rr->options & GNUNET_DHT_RO_RECORD_ROUTE))
@@ -192,7 +195,8 @@ process (void *cls, const struct GNUNET_HashCode * key, void *value)
192 * we fake it by changing the key to the actual PID ... */ 195 * we fake it by changing the key to the actual PID ... */
193 GNUNET_BLOCK_get_key (GDS_block_context, 196 GNUNET_BLOCK_get_key (GDS_block_context,
194 GNUNET_BLOCK_TYPE_DHT_HELLO, 197 GNUNET_BLOCK_TYPE_DHT_HELLO,
195 pc->data, pc->data_size, 198 pc->data,
199 pc->data_size,
196 &hc); 200 &hc);
197 eval_key = &hc; 201 eval_key = &hc;
198 } 202 }
@@ -200,8 +204,8 @@ process (void *cls, const struct GNUNET_HashCode * key, void *value)
200 { 204 {
201 eval_key = key; 205 eval_key = key;
202 } 206 }
203 eval = 207 eval
204 GNUNET_BLOCK_evaluate (GDS_block_context, 208 = GNUNET_BLOCK_evaluate (GDS_block_context,
205 pc->type, 209 pc->type,
206 GNUNET_BLOCK_EO_NONE, 210 GNUNET_BLOCK_EO_NONE,
207 eval_key, 211 eval_key,
@@ -310,7 +314,10 @@ GDS_ROUTING_process (void *cls,
310 pc.data_size = 0; 314 pc.data_size = 0;
311 pc.data = ""; /* something not null */ 315 pc.data = ""; /* something not null */
312 } 316 }
313 GNUNET_CONTAINER_multihashmap_get_multiple (recent_map, key, &process, &pc); 317 GNUNET_CONTAINER_multihashmap_get_multiple (recent_map,
318 key,
319 &process,
320 &pc);
314} 321}
315 322
316 323
@@ -347,11 +354,13 @@ expire_oldest_entry ()
347 * @param cls the new 'struct RecentRequest' (to discard upon successful combination) 354 * @param cls the new 'struct RecentRequest' (to discard upon successful combination)
348 * @param key the query 355 * @param key the query
349 * @param value the existing 'struct RecentRequest' (to update upon successful combination) 356 * @param value the existing 'struct RecentRequest' (to update upon successful combination)
350 * @return GNUNET_OK (continue to iterate), 357 * @return #GNUNET_OK (continue to iterate),
351 * GNUNET_SYSERR if the request was successfully combined 358 * #GNUNET_SYSERR if the request was successfully combined
352 */ 359 */
353static int 360static int
354try_combine_recent (void *cls, const struct GNUNET_HashCode * key, void *value) 361try_combine_recent (void *cls,
362 const struct GNUNET_HashCode *key,
363 void *value)
355{ 364{
356 struct RecentRequest *in = cls; 365 struct RecentRequest *in = cls;
357 struct RecentRequest *rr = value; 366 struct RecentRequest *rr = value;
@@ -398,7 +407,8 @@ void
398GDS_ROUTING_add (const struct GNUNET_PeerIdentity *sender, 407GDS_ROUTING_add (const struct GNUNET_PeerIdentity *sender,
399 enum GNUNET_BLOCK_Type type, 408 enum GNUNET_BLOCK_Type type,
400 enum GNUNET_DHT_RouteOption options, 409 enum GNUNET_DHT_RouteOption options,
401 const struct GNUNET_HashCode * key, const void *xquery, 410 const struct GNUNET_HashCode *key,
411 const void *xquery,
402 size_t xquery_size, 412 size_t xquery_size,
403 const struct GNUNET_CONTAINER_BloomFilter *reply_bf, 413 const struct GNUNET_CONTAINER_BloomFilter *reply_bf,
404 uint32_t reply_bf_mutator) 414 uint32_t reply_bf_mutator)
@@ -421,8 +431,10 @@ GDS_ROUTING_add (const struct GNUNET_PeerIdentity *sender,
421 recent_req->xquery_size = xquery_size; 431 recent_req->xquery_size = xquery_size;
422 recent_req->reply_bf_mutator = reply_bf_mutator; 432 recent_req->reply_bf_mutator = reply_bf_mutator;
423 if (GNUNET_SYSERR == 433 if (GNUNET_SYSERR ==
424 GNUNET_CONTAINER_multihashmap_get_multiple (recent_map, key, 434 GNUNET_CONTAINER_multihashmap_get_multiple (recent_map,
425 &try_combine_recent, recent_req)) 435 key,
436 &try_combine_recent,
437 recent_req))
426 { 438 {
427 GNUNET_STATISTICS_update (GDS_stats, 439 GNUNET_STATISTICS_update (GDS_stats,
428 gettext_noop 440 gettext_noop