diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-11-05 22:19:43 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-11-05 22:19:43 +0000 |
commit | 632a0bd9d3f244f26c242ee200b0b3a31a7f68df (patch) | |
tree | 2e5821c0eb5acca0231d78e1316a06a9d80032f0 /src/fs/fs_search.c | |
parent | 3c6b67f3282836765bc837fefbc600f7dbe23465 (diff) | |
download | gnunet-632a0bd9d3f244f26c242ee200b0b3a31a7f68df.tar.gz gnunet-632a0bd9d3f244f26c242ee200b0b3a31a7f68df.zip |
-stylistic fixes
Diffstat (limited to 'src/fs/fs_search.c')
-rw-r--r-- | src/fs/fs_search.c | 44 |
1 files changed, 21 insertions, 23 deletions
diff --git a/src/fs/fs_search.c b/src/fs/fs_search.c index fe99a9cf9..52bc4aca0 100644 --- a/src/fs/fs_search.c +++ b/src/fs/fs_search.c | |||
@@ -1326,7 +1326,8 @@ GNUNET_FS_search_start_searching_ (struct GNUNET_FS_SearchContext *sc) | |||
1326 | * @return #GNUNET_OK | 1326 | * @return #GNUNET_OK |
1327 | */ | 1327 | */ |
1328 | static int | 1328 | static int |
1329 | search_result_freeze_probes (void *cls, const struct GNUNET_HashCode * key, | 1329 | search_result_freeze_probes (void *cls, |
1330 | const struct GNUNET_HashCode *key, | ||
1330 | void *value) | 1331 | void *value) |
1331 | { | 1332 | { |
1332 | struct GNUNET_FS_SearchResult *sr = value; | 1333 | struct GNUNET_FS_SearchResult *sr = value; |
@@ -1396,21 +1397,12 @@ search_result_suspend (void *cls, | |||
1396 | GNUNET_FS_download_signal_suspend_ (sr->download); | 1397 | GNUNET_FS_download_signal_suspend_ (sr->download); |
1397 | sr->download = NULL; | 1398 | sr->download = NULL; |
1398 | } | 1399 | } |
1399 | if (NULL != sr->probe_ctx) | ||
1400 | { | ||
1401 | GNUNET_FS_download_stop (sr->probe_ctx, GNUNET_YES); | ||
1402 | sr->probe_ctx = NULL; | ||
1403 | } | ||
1404 | if (GNUNET_SCHEDULER_NO_TASK != sr->probe_ping_task) | ||
1405 | { | ||
1406 | GNUNET_SCHEDULER_cancel (sr->probe_ping_task); | ||
1407 | sr->probe_ping_task = GNUNET_SCHEDULER_NO_TASK; | ||
1408 | } | ||
1409 | if (NULL != sr->update_search) | 1400 | if (NULL != sr->update_search) |
1410 | { | 1401 | { |
1411 | GNUNET_FS_search_signal_suspend_ (sr->update_search); | 1402 | GNUNET_FS_search_signal_suspend_ (sr->update_search); |
1412 | sr->update_search = NULL; | 1403 | sr->update_search = NULL; |
1413 | } | 1404 | } |
1405 | GNUNET_FS_search_stop_probe_ (sr); | ||
1414 | pi.status = GNUNET_FS_STATUS_SEARCH_RESULT_SUSPEND; | 1406 | pi.status = GNUNET_FS_STATUS_SEARCH_RESULT_SUSPEND; |
1415 | pi.value.search.specifics.result_suspend.cctx = sr->client_info; | 1407 | pi.value.search.specifics.result_suspend.cctx = sr->client_info; |
1416 | pi.value.search.specifics.result_suspend.meta = sr->meta; | 1408 | pi.value.search.specifics.result_suspend.meta = sr->meta; |
@@ -1420,11 +1412,6 @@ search_result_suspend (void *cls, | |||
1420 | GNUNET_free_non_null (sr->serialization); | 1412 | GNUNET_free_non_null (sr->serialization); |
1421 | GNUNET_FS_uri_destroy (sr->uri); | 1413 | GNUNET_FS_uri_destroy (sr->uri); |
1422 | GNUNET_CONTAINER_meta_data_destroy (sr->meta); | 1414 | GNUNET_CONTAINER_meta_data_destroy (sr->meta); |
1423 | if (GNUNET_SCHEDULER_NO_TASK != sr->probe_cancel_task) | ||
1424 | { | ||
1425 | GNUNET_SCHEDULER_cancel (sr->probe_cancel_task); | ||
1426 | sr->probe_cancel_task = GNUNET_SCHEDULER_NO_TASK; | ||
1427 | } | ||
1428 | GNUNET_free_non_null (sr->keyword_bitmap); | 1415 | GNUNET_free_non_null (sr->keyword_bitmap); |
1429 | GNUNET_free (sr); | 1416 | GNUNET_free (sr); |
1430 | return GNUNET_OK; | 1417 | return GNUNET_OK; |
@@ -1435,7 +1422,7 @@ search_result_suspend (void *cls, | |||
1435 | * Create SUSPEND event for the given search operation | 1422 | * Create SUSPEND event for the given search operation |
1436 | * and then clean up our state (without stop signal). | 1423 | * and then clean up our state (without stop signal). |
1437 | * | 1424 | * |
1438 | * @param cls the 'struct GNUNET_FS_SearchContext' to signal for | 1425 | * @param cls the `struct GNUNET_FS_SearchContext` to signal for |
1439 | */ | 1426 | */ |
1440 | void | 1427 | void |
1441 | GNUNET_FS_search_signal_suspend_ (void *cls) | 1428 | GNUNET_FS_search_signal_suspend_ (void *cls) |
@@ -1451,9 +1438,15 @@ GNUNET_FS_search_signal_suspend_ (void *cls) | |||
1451 | sc->client_info = GNUNET_FS_search_make_status_ (&pi, sc->h, sc); | 1438 | sc->client_info = GNUNET_FS_search_make_status_ (&pi, sc->h, sc); |
1452 | GNUNET_break (NULL == sc->client_info); | 1439 | GNUNET_break (NULL == sc->client_info); |
1453 | if (sc->task != GNUNET_SCHEDULER_NO_TASK) | 1440 | if (sc->task != GNUNET_SCHEDULER_NO_TASK) |
1441 | { | ||
1454 | GNUNET_SCHEDULER_cancel (sc->task); | 1442 | GNUNET_SCHEDULER_cancel (sc->task); |
1443 | sc->task = GNUNET_SCHEDULER_NO_TASK; | ||
1444 | } | ||
1455 | if (NULL != sc->client) | 1445 | if (NULL != sc->client) |
1446 | { | ||
1456 | GNUNET_CLIENT_disconnect (sc->client); | 1447 | GNUNET_CLIENT_disconnect (sc->client); |
1448 | sc->client = NULL; | ||
1449 | } | ||
1457 | GNUNET_CONTAINER_multihashmap_destroy (sc->master_result_map); | 1450 | GNUNET_CONTAINER_multihashmap_destroy (sc->master_result_map); |
1458 | if (NULL != sc->requests) | 1451 | if (NULL != sc->requests) |
1459 | { | 1452 | { |
@@ -1509,8 +1502,10 @@ GNUNET_FS_search_pause (struct GNUNET_FS_SearchContext *sc) | |||
1509 | struct GNUNET_FS_ProgressInfo pi; | 1502 | struct GNUNET_FS_ProgressInfo pi; |
1510 | 1503 | ||
1511 | if (GNUNET_SCHEDULER_NO_TASK != sc->task) | 1504 | if (GNUNET_SCHEDULER_NO_TASK != sc->task) |
1505 | { | ||
1512 | GNUNET_SCHEDULER_cancel (sc->task); | 1506 | GNUNET_SCHEDULER_cancel (sc->task); |
1513 | sc->task = GNUNET_SCHEDULER_NO_TASK; | 1507 | sc->task = GNUNET_SCHEDULER_NO_TASK; |
1508 | } | ||
1514 | if (NULL != sc->client) | 1509 | if (NULL != sc->client) |
1515 | GNUNET_CLIENT_disconnect (sc->client); | 1510 | GNUNET_CLIENT_disconnect (sc->client); |
1516 | sc->client = NULL; | 1511 | sc->client = NULL; |
@@ -1549,17 +1544,18 @@ GNUNET_FS_search_continue (struct GNUNET_FS_SearchContext *sc) | |||
1549 | * @param cls the global FS handle | 1544 | * @param cls the global FS handle |
1550 | * @param key the key for the search result (unused) | 1545 | * @param key the key for the search result (unused) |
1551 | * @param value the search result to free | 1546 | * @param value the search result to free |
1552 | * @return GNUNET_OK | 1547 | * @return #GNUNET_OK |
1553 | */ | 1548 | */ |
1554 | static int | 1549 | static int |
1555 | search_result_stop (void *cls, const struct GNUNET_HashCode * key, void *value) | 1550 | search_result_stop (void *cls, |
1551 | const struct GNUNET_HashCode *key, | ||
1552 | void *value) | ||
1556 | { | 1553 | { |
1557 | struct GNUNET_FS_SearchContext *sc = cls; | 1554 | struct GNUNET_FS_SearchContext *sc = cls; |
1558 | struct GNUNET_FS_SearchResult *sr = value; | 1555 | struct GNUNET_FS_SearchResult *sr = value; |
1559 | struct GNUNET_FS_ProgressInfo pi; | 1556 | struct GNUNET_FS_ProgressInfo pi; |
1560 | 1557 | ||
1561 | GNUNET_FS_search_stop_probe_ (sr); | 1558 | GNUNET_FS_search_stop_probe_ (sr); |
1562 | |||
1563 | if (NULL != sr->download) | 1559 | if (NULL != sr->download) |
1564 | { | 1560 | { |
1565 | sr->download->search = NULL; | 1561 | sr->download->search = NULL; |
@@ -1593,10 +1589,12 @@ search_result_stop (void *cls, const struct GNUNET_HashCode * key, void *value) | |||
1593 | * @param cls the global FS handle | 1589 | * @param cls the global FS handle |
1594 | * @param key the key for the search result (unused) | 1590 | * @param key the key for the search result (unused) |
1595 | * @param value the search result to free | 1591 | * @param value the search result to free |
1596 | * @return GNUNET_OK | 1592 | * @return #GNUNET_OK |
1597 | */ | 1593 | */ |
1598 | static int | 1594 | static int |
1599 | search_result_free (void *cls, const struct GNUNET_HashCode * key, void *value) | 1595 | search_result_free (void *cls, |
1596 | const struct GNUNET_HashCode *key, | ||
1597 | void *value) | ||
1600 | { | 1598 | { |
1601 | struct GNUNET_FS_SearchResult *sr = value; | 1599 | struct GNUNET_FS_SearchResult *sr = value; |
1602 | 1600 | ||