diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-03-15 10:28:54 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-03-15 10:28:54 +0000 |
commit | ce2ec1e18e3240f53343719e59b89796c9558ec9 (patch) | |
tree | 34a1d711fb23d6cb7281235222331eeb5571e7d5 /src/fs | |
parent | ba5e41452e8d1fa1283236a7aac9fb85ad3bcd0a (diff) | |
download | gnunet-ce2ec1e18e3240f53343719e59b89796c9558ec9.tar.gz gnunet-ce2ec1e18e3240f53343719e59b89796c9558ec9.zip |
fixes
Diffstat (limited to 'src/fs')
-rw-r--r-- | src/fs/gnunet-service-fs_new.c | 48 | ||||
-rw-r--r-- | src/fs/gnunet-service-fs_pe.c | 4 | ||||
-rw-r--r-- | src/fs/gnunet-service-fs_pe.h | 2 |
3 files changed, 24 insertions, 30 deletions
diff --git a/src/fs/gnunet-service-fs_new.c b/src/fs/gnunet-service-fs_new.c index 5e9fce754..f68250a23 100644 --- a/src/fs/gnunet-service-fs_new.c +++ b/src/fs/gnunet-service-fs_new.c | |||
@@ -96,12 +96,6 @@ const struct GNUNET_CONFIGURATION_Handle *GSF_cfg; | |||
96 | struct GNUNET_STATISTICS_Handle *GSF_stats; | 96 | struct GNUNET_STATISTICS_Handle *GSF_stats; |
97 | 97 | ||
98 | /** | 98 | /** |
99 | * Pointer to handle to the core service (points to NULL until we've | ||
100 | * connected to it). | ||
101 | */ | ||
102 | struct GNUNET_CORE_Handle *GSF_core; | ||
103 | |||
104 | /** | ||
105 | * Handle for DHT operations. | 99 | * Handle for DHT operations. |
106 | */ | 100 | */ |
107 | struct GNUNET_DHT_Handle *GSF_dht; | 101 | struct GNUNET_DHT_Handle *GSF_dht; |
@@ -140,6 +134,12 @@ unsigned int GSF_cover_content_count; | |||
140 | */ | 134 | */ |
141 | struct GNUNET_BLOCK_Context *GSF_block_ctx; | 135 | struct GNUNET_BLOCK_Context *GSF_block_ctx; |
142 | 136 | ||
137 | /** | ||
138 | * Pointer to handle to the core service (points to NULL until we've | ||
139 | * connected to it). | ||
140 | */ | ||
141 | struct GNUNET_CORE_Handle *GSF_core; | ||
142 | |||
143 | 143 | ||
144 | /* ***************************** locals ******************************* */ | 144 | /* ***************************** locals ******************************* */ |
145 | 145 | ||
@@ -154,12 +154,6 @@ static struct GNUNET_CONFIGURATION_Handle *block_cfg; | |||
154 | static GNUNET_SCHEDULER_TaskIdentifier cover_age_task; | 154 | static GNUNET_SCHEDULER_TaskIdentifier cover_age_task; |
155 | 155 | ||
156 | /** | 156 | /** |
157 | * Pointer to handle to the core service (points to NULL until we've | ||
158 | * connected to it). | ||
159 | */ | ||
160 | static struct GNUNET_CORE_Handle *core; | ||
161 | |||
162 | /** | ||
163 | * Datastore 'GET' load tracking. | 157 | * Datastore 'GET' load tracking. |
164 | */ | 158 | */ |
165 | static struct GNUNET_LOAD_Value *datastore_get_load; | 159 | static struct GNUNET_LOAD_Value *datastore_get_load; |
@@ -398,10 +392,10 @@ static void | |||
398 | shutdown_task (void *cls, | 392 | shutdown_task (void *cls, |
399 | const struct GNUNET_SCHEDULER_TaskContext *tc) | 393 | const struct GNUNET_SCHEDULER_TaskContext *tc) |
400 | { | 394 | { |
401 | if (NULL != core) | 395 | if (NULL != GSF_core) |
402 | { | 396 | { |
403 | GNUNET_CORE_disconnect (core); | 397 | GNUNET_CORE_disconnect (GSF_core); |
404 | core = NULL; | 398 | GSF_core = NULL; |
405 | } | 399 | } |
406 | GSF_put_done_ (); | 400 | GSF_put_done_ (); |
407 | GSF_push_done_ (); | 401 | GSF_push_done_ (); |
@@ -531,17 +525,17 @@ main_init (struct GNUNET_SERVER_Handle *server, | |||
531 | {NULL, NULL, 0, 0} | 525 | {NULL, NULL, 0, 0} |
532 | }; | 526 | }; |
533 | 527 | ||
534 | core = GNUNET_CORE_connect (GSF_cfg, | 528 | GSF_core = GNUNET_CORE_connect (GSF_cfg, |
535 | 1, /* larger? */ | 529 | 1, /* larger? */ |
536 | NULL, | 530 | NULL, |
537 | &peer_init_handler, | 531 | &peer_init_handler, |
538 | &peer_connect_handler, | 532 | &peer_connect_handler, |
539 | &GSF_peer_disconnect_handler_, | 533 | &GSF_peer_disconnect_handler_, |
540 | &GSF_peer_status_handler_, | 534 | &GSF_peer_status_handler_, |
541 | NULL, GNUNET_NO, | 535 | NULL, GNUNET_NO, |
542 | NULL, GNUNET_NO, | 536 | NULL, GNUNET_NO, |
543 | p2p_handlers); | 537 | p2p_handlers); |
544 | if (NULL == core) | 538 | if (NULL == GSF_core) |
545 | { | 539 | { |
546 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 540 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
547 | _("Failed to connect to `%s' service.\n"), | 541 | _("Failed to connect to `%s' service.\n"), |
@@ -577,7 +571,7 @@ run (void *cls, | |||
577 | { | 571 | { |
578 | GSF_cfg = cfg; | 572 | GSF_cfg = cfg; |
579 | GSF_dsh = GNUNET_DATASTORE_connect (cfg); | 573 | GSF_dsh = GNUNET_DATASTORE_connect (cfg); |
580 | if (GSF_dsh == NULL) | 574 | if (NULL == GSF_dsh) |
581 | { | 575 | { |
582 | GNUNET_SCHEDULER_shutdown (); | 576 | GNUNET_SCHEDULER_shutdown (); |
583 | return; | 577 | return; |
diff --git a/src/fs/gnunet-service-fs_pe.c b/src/fs/gnunet-service-fs_pe.c index 1c73c8dda..7b0f874ff 100644 --- a/src/fs/gnunet-service-fs_pe.c +++ b/src/fs/gnunet-service-fs_pe.c | |||
@@ -368,14 +368,14 @@ GSF_plan_notify_peer_disconnect_ (const struct GSF_ConnectedPeer *cp) | |||
368 | * @param pr request that is done | 368 | * @param pr request that is done |
369 | */ | 369 | */ |
370 | void | 370 | void |
371 | GSF_plan_notify_request_done_ (const struct GSF_PendingRequest *pr) | 371 | GSF_plan_notify_request_done_ (struct GSF_PendingRequest *pr) |
372 | { | 372 | { |
373 | struct GSF_RequestPlan *rp; | 373 | struct GSF_RequestPlan *rp; |
374 | struct GSF_PendingRequestData *prd; | 374 | struct GSF_PendingRequestData *prd; |
375 | 375 | ||
376 | prd = GSF_pending_request_get_data_ (pr); | ||
376 | while (NULL != (rp = prd->rp_head)) | 377 | while (NULL != (rp = prd->rp_head)) |
377 | { | 378 | { |
378 | prd = GSF_pending_request_get_data_ (rp->pr); | ||
379 | GNUNET_CONTAINER_heap_remove_node (rp->hn); | 379 | GNUNET_CONTAINER_heap_remove_node (rp->hn); |
380 | GNUNET_CONTAINER_DLL_remove (prd->rp_head, | 380 | GNUNET_CONTAINER_DLL_remove (prd->rp_head, |
381 | prd->rp_tail, | 381 | prd->rp_tail, |
diff --git a/src/fs/gnunet-service-fs_pe.h b/src/fs/gnunet-service-fs_pe.h index 14e9dec2e..2413b970f 100644 --- a/src/fs/gnunet-service-fs_pe.h +++ b/src/fs/gnunet-service-fs_pe.h | |||
@@ -59,7 +59,7 @@ GSF_plan_notify_peer_disconnect_ (const struct GSF_ConnectedPeer *cp); | |||
59 | * @param pr request that is done | 59 | * @param pr request that is done |
60 | */ | 60 | */ |
61 | void | 61 | void |
62 | GSF_plan_notify_request_done_ (const struct GSF_PendingRequest *pr); | 62 | GSF_plan_notify_request_done_ (struct GSF_PendingRequest *pr); |
63 | 63 | ||
64 | 64 | ||
65 | /** | 65 | /** |