diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-08-15 21:54:06 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-08-15 21:54:06 +0000 |
commit | 5746309cb4be2073d550ad7a6885e918631dbc38 (patch) | |
tree | 89455bc4aadf977816b38df13f990372cd81d71a /src/fs/gnunet-service-fs_lc.c | |
parent | 6fd3e715cae09fa6e657c96f1c6f9711ee51f42f (diff) | |
download | gnunet-5746309cb4be2073d550ad7a6885e918631dbc38.tar.gz gnunet-5746309cb4be2073d550ad7a6885e918631dbc38.zip |
indentation
Diffstat (limited to 'src/fs/gnunet-service-fs_lc.c')
-rw-r--r-- | src/fs/gnunet-service-fs_lc.c | 54 |
1 files changed, 26 insertions, 28 deletions
diff --git a/src/fs/gnunet-service-fs_lc.c b/src/fs/gnunet-service-fs_lc.c index aa6569387..6460d4f13 100644 --- a/src/fs/gnunet-service-fs_lc.c +++ b/src/fs/gnunet-service-fs_lc.c | |||
@@ -199,8 +199,8 @@ client_request_destroy (void *cls, | |||
199 | GNUNET_CONTAINER_DLL_remove (lc->cr_head, lc->cr_tail, cr); | 199 | GNUNET_CONTAINER_DLL_remove (lc->cr_head, lc->cr_tail, cr); |
200 | GSF_pending_request_cancel_ (cr->pr, GNUNET_NO); | 200 | GSF_pending_request_cancel_ (cr->pr, GNUNET_NO); |
201 | GNUNET_STATISTICS_update (GSF_stats, | 201 | GNUNET_STATISTICS_update (GSF_stats, |
202 | gettext_noop ("# client searches active"), | 202 | gettext_noop ("# client searches active"), -1, |
203 | -1, GNUNET_NO); | 203 | GNUNET_NO); |
204 | GNUNET_free (cr); | 204 | GNUNET_free (cr); |
205 | } | 205 | } |
206 | 206 | ||
@@ -223,13 +223,12 @@ client_request_destroy (void *cls, | |||
223 | * @param data_len number of bytes in data | 223 | * @param data_len number of bytes in data |
224 | */ | 224 | */ |
225 | static void | 225 | static void |
226 | client_response_handler (void *cls, | 226 | client_response_handler (void *cls, enum GNUNET_BLOCK_EvaluationResult eval, |
227 | enum GNUNET_BLOCK_EvaluationResult eval, | ||
228 | struct GSF_PendingRequest *pr, | 227 | struct GSF_PendingRequest *pr, |
229 | uint32_t reply_anonymity_level, | 228 | uint32_t reply_anonymity_level, |
230 | struct GNUNET_TIME_Absolute expiration, | 229 | struct GNUNET_TIME_Absolute expiration, |
231 | enum GNUNET_BLOCK_Type type, | 230 | enum GNUNET_BLOCK_Type type, const void *data, |
232 | const void *data, size_t data_len) | 231 | size_t data_len) |
233 | { | 232 | { |
234 | struct ClientRequest *cr = cls; | 233 | struct ClientRequest *cr = cls; |
235 | struct GSF_LocalClient *lc; | 234 | struct GSF_LocalClient *lc; |
@@ -310,8 +309,8 @@ GSF_local_client_start_search_handler_ (struct GNUNET_SERVER_Client *client, | |||
310 | return NULL; | 309 | return NULL; |
311 | } | 310 | } |
312 | GNUNET_STATISTICS_update (GSF_stats, | 311 | GNUNET_STATISTICS_update (GSF_stats, |
313 | gettext_noop ("# client searches received"), | 312 | gettext_noop ("# client searches received"), 1, |
314 | 1, GNUNET_NO); | 313 | GNUNET_NO); |
315 | sc = (msize - sizeof (struct SearchMessage)) / sizeof (GNUNET_HashCode); | 314 | sc = (msize - sizeof (struct SearchMessage)) / sizeof (GNUNET_HashCode); |
316 | sm = (const struct SearchMessage *) message; | 315 | sm = (const struct SearchMessage *) message; |
317 | type = ntohl (sm->type); | 316 | type = ntohl (sm->type); |
@@ -334,9 +333,8 @@ GSF_local_client_start_search_handler_ (struct GNUNET_SERVER_Client *client, | |||
334 | while (cr != NULL) | 333 | while (cr != NULL) |
335 | { | 334 | { |
336 | prd = GSF_pending_request_get_data_ (cr->pr); | 335 | prd = GSF_pending_request_get_data_ (cr->pr); |
337 | if ((0 != memcmp (&prd->query, | 336 | if ((0 != memcmp (&prd->query, &sm->query, sizeof (GNUNET_HashCode))) && |
338 | &sm->query, | 337 | (prd->type == type)) |
339 | sizeof (GNUNET_HashCode))) && (prd->type == type)) | ||
340 | break; | 338 | break; |
341 | cr = cr->next; | 339 | cr = cr->next; |
342 | } | 340 | } |
@@ -346,8 +344,8 @@ GSF_local_client_start_search_handler_ (struct GNUNET_SERVER_Client *client, | |||
346 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 344 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
347 | "Have existing request, merging content-seen lists.\n"); | 345 | "Have existing request, merging content-seen lists.\n"); |
348 | #endif | 346 | #endif |
349 | GSF_pending_request_update_ (cr->pr, | 347 | GSF_pending_request_update_ (cr->pr, (const GNUNET_HashCode *) &sm[1], |
350 | (const GNUNET_HashCode *) &sm[1], sc); | 348 | sc); |
351 | GNUNET_STATISTICS_update (GSF_stats, | 349 | GNUNET_STATISTICS_update (GSF_stats, |
352 | gettext_noop | 350 | gettext_noop |
353 | ("# client searches updated (merged content seen list)"), | 351 | ("# client searches updated (merged content seen list)"), |
@@ -358,8 +356,8 @@ GSF_local_client_start_search_handler_ (struct GNUNET_SERVER_Client *client, | |||
358 | } | 356 | } |
359 | 357 | ||
360 | GNUNET_STATISTICS_update (GSF_stats, | 358 | GNUNET_STATISTICS_update (GSF_stats, |
361 | gettext_noop ("# client searches active"), | 359 | gettext_noop ("# client searches active"), 1, |
362 | 1, GNUNET_NO); | 360 | GNUNET_NO); |
363 | cr = GNUNET_malloc (sizeof (struct ClientRequest)); | 361 | cr = GNUNET_malloc (sizeof (struct ClientRequest)); |
364 | cr->lc = lc; | 362 | cr->lc = lc; |
365 | GNUNET_CONTAINER_DLL_insert (lc->cr_head, lc->cr_tail, cr); | 363 | GNUNET_CONTAINER_DLL_insert (lc->cr_head, lc->cr_tail, cr); |
@@ -368,9 +366,9 @@ GSF_local_client_start_search_handler_ (struct GNUNET_SERVER_Client *client, | |||
368 | options |= GSF_PRO_LOCAL_ONLY; | 366 | options |= GSF_PRO_LOCAL_ONLY; |
369 | cr->pr = GSF_pending_request_create_ (options, type, &sm->query, (type == GNUNET_BLOCK_TYPE_FS_SBLOCK) ? &sm->target /* namespace */ | 367 | cr->pr = GSF_pending_request_create_ (options, type, &sm->query, (type == GNUNET_BLOCK_TYPE_FS_SBLOCK) ? &sm->target /* namespace */ |
370 | : NULL, | 368 | : NULL, |
371 | (0 != memcmp (&sm->target, | 369 | (0 != |
372 | &all_zeros, | 370 | memcmp (&sm->target, &all_zeros, |
373 | sizeof (GNUNET_HashCode))) | 371 | sizeof (GNUNET_HashCode))) |
374 | ? (const struct GNUNET_PeerIdentity *) | 372 | ? (const struct GNUNET_PeerIdentity *) |
375 | &sm->target : NULL, NULL, 0, | 373 | &sm->target : NULL, NULL, 0, |
376 | 0 /* bf */ , | 374 | 0 /* bf */ , |
@@ -418,10 +416,10 @@ transmit_to_client (void *cls, size_t size, void *buf) | |||
418 | GNUNET_free (res); | 416 | GNUNET_free (res); |
419 | } | 417 | } |
420 | if (NULL != res) | 418 | if (NULL != res) |
421 | lc->th = GNUNET_SERVER_notify_transmit_ready (lc->client, | 419 | lc->th = |
422 | res->msize, | 420 | GNUNET_SERVER_notify_transmit_ready (lc->client, res->msize, |
423 | GNUNET_TIME_UNIT_FOREVER_REL, | 421 | GNUNET_TIME_UNIT_FOREVER_REL, |
424 | &transmit_to_client, lc); | 422 | &transmit_to_client, lc); |
425 | return msize; | 423 | return msize; |
426 | } | 424 | } |
427 | 425 | ||
@@ -448,10 +446,10 @@ GSF_local_client_transmit_ (struct GSF_LocalClient *lc, | |||
448 | memcpy (&res[1], msg, msize); | 446 | memcpy (&res[1], msg, msize); |
449 | GNUNET_CONTAINER_DLL_insert_tail (lc->res_head, lc->res_tail, res); | 447 | GNUNET_CONTAINER_DLL_insert_tail (lc->res_head, lc->res_tail, res); |
450 | if (NULL == lc->th) | 448 | if (NULL == lc->th) |
451 | lc->th = GNUNET_SERVER_notify_transmit_ready (lc->client, | 449 | lc->th = |
452 | msize, | 450 | GNUNET_SERVER_notify_transmit_ready (lc->client, msize, |
453 | GNUNET_TIME_UNIT_FOREVER_REL, | 451 | GNUNET_TIME_UNIT_FOREVER_REL, |
454 | &transmit_to_client, lc); | 452 | &transmit_to_client, lc); |
455 | } | 453 | } |
456 | 454 | ||
457 | 455 | ||
@@ -479,8 +477,8 @@ GSF_client_disconnect_handler_ (void *cls, struct GNUNET_SERVER_Client *client) | |||
479 | GNUNET_CONTAINER_DLL_remove (pos->cr_head, pos->cr_tail, cr); | 477 | GNUNET_CONTAINER_DLL_remove (pos->cr_head, pos->cr_tail, cr); |
480 | GSF_pending_request_cancel_ (cr->pr, GNUNET_NO); | 478 | GSF_pending_request_cancel_ (cr->pr, GNUNET_NO); |
481 | GNUNET_STATISTICS_update (GSF_stats, | 479 | GNUNET_STATISTICS_update (GSF_stats, |
482 | gettext_noop ("# client searches active"), | 480 | gettext_noop ("# client searches active"), -1, |
483 | -1, GNUNET_NO); | 481 | GNUNET_NO); |
484 | if (GNUNET_SCHEDULER_NO_TASK != cr->kill_task) | 482 | if (GNUNET_SCHEDULER_NO_TASK != cr->kill_task) |
485 | GNUNET_SCHEDULER_cancel (cr->kill_task); | 483 | GNUNET_SCHEDULER_cancel (cr->kill_task); |
486 | GNUNET_free (cr); | 484 | GNUNET_free (cr); |