aboutsummaryrefslogtreecommitdiff
path: root/src/fs/fs_api.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-12-05 19:33:59 +0000
committerChristian Grothoff <christian@grothoff.org>2012-12-05 19:33:59 +0000
commitfbdce8d7a2ec33531a6c1f27bfccf81865bc9a7d (patch)
treee153f3d1176949c5c4dc938b0ca0b1d85d8c2f62 /src/fs/fs_api.c
parent8fc100cd5192d0fb082c94dbe8283f82875a93bd (diff)
downloadgnunet-fbdce8d7a2ec33531a6c1f27bfccf81865bc9a7d.tar.gz
gnunet-fbdce8d7a2ec33531a6c1f27bfccf81865bc9a7d.zip
-more logging
Diffstat (limited to 'src/fs/fs_api.c')
-rw-r--r--src/fs/fs_api.c29
1 files changed, 22 insertions, 7 deletions
diff --git a/src/fs/fs_api.c b/src/fs/fs_api.c
index f03cdb8e4..678187a27 100644
--- a/src/fs/fs_api.c
+++ b/src/fs/fs_api.c
@@ -61,6 +61,10 @@ start_job (struct GNUNET_FS_QueueEntry *qe)
61 qe->h->active_blocks += qe->blocks; 61 qe->h->active_blocks += qe->blocks;
62 qe->h->active_downloads++; 62 qe->h->active_downloads++;
63 qe->start_time = GNUNET_TIME_absolute_get (); 63 qe->start_time = GNUNET_TIME_absolute_get ();
64 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
65 "Starting job %p (%u active)\n",
66 qe,
67 qe->h->active_downloads);
64 GNUNET_CONTAINER_DLL_remove (qe->h->pending_head, qe->h->pending_tail, qe); 68 GNUNET_CONTAINER_DLL_remove (qe->h->pending_head, qe->h->pending_tail, qe);
65 GNUNET_CONTAINER_DLL_insert_after (qe->h->running_head, qe->h->running_tail, 69 GNUNET_CONTAINER_DLL_insert_after (qe->h->running_head, qe->h->running_tail,
66 qe->h->running_tail, qe); 70 qe->h->running_tail, qe);
@@ -85,6 +89,10 @@ stop_job (struct GNUNET_FS_QueueEntry *qe)
85 GNUNET_TIME_relative_add (qe->run_time, 89 GNUNET_TIME_relative_add (qe->run_time,
86 GNUNET_TIME_absolute_get_duration 90 GNUNET_TIME_absolute_get_duration
87 (qe->start_time)); 91 (qe->start_time));
92 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
93 "Stopping job %p (%u active)\n",
94 qe,
95 qe->h->active_downloads);
88 GNUNET_CONTAINER_DLL_remove (qe->h->running_head, qe->h->running_tail, qe); 96 GNUNET_CONTAINER_DLL_remove (qe->h->running_head, qe->h->running_tail, qe);
89 GNUNET_CONTAINER_DLL_insert_after (qe->h->pending_head, qe->h->pending_tail, 97 GNUNET_CONTAINER_DLL_insert_after (qe->h->pending_head, qe->h->pending_tail,
90 qe->h->pending_tail, qe); 98 qe->h->pending_tail, qe);
@@ -318,24 +326,31 @@ GNUNET_FS_queue_ (struct GNUNET_FS_Handle *h, GNUNET_FS_QueueStart start,
318 if (h->queue_job != GNUNET_SCHEDULER_NO_TASK) 326 if (h->queue_job != GNUNET_SCHEDULER_NO_TASK)
319 GNUNET_SCHEDULER_cancel (h->queue_job); 327 GNUNET_SCHEDULER_cancel (h->queue_job);
320 h->queue_job = GNUNET_SCHEDULER_add_now (&process_job_queue, h); 328 h->queue_job = GNUNET_SCHEDULER_add_now (&process_job_queue, h);
329 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
330 "Queueing job %p\n",
331 qe);
321 return qe; 332 return qe;
322} 333}
323 334
324 335
325/** 336/**
326 * Dequeue a job from the queue. 337 * Dequeue a job from the queue.
327 * @param qh handle for the job 338 *
339 * @param qe handle for the job
328 */ 340 */
329void 341void
330GNUNET_FS_dequeue_ (struct GNUNET_FS_QueueEntry *qh) 342GNUNET_FS_dequeue_ (struct GNUNET_FS_QueueEntry *qe)
331{ 343{
332 struct GNUNET_FS_Handle *h; 344 struct GNUNET_FS_Handle *h;
333 345
334 h = qh->h; 346 h = qe->h;
335 if (NULL != qh->client) 347 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
336 stop_job (qh); 348 "Dequeueing job %p\n",
337 GNUNET_CONTAINER_DLL_remove (h->pending_head, h->pending_tail, qh); 349 qe);
338 GNUNET_free (qh); 350 if (NULL != qe->client)
351 stop_job (qe);
352 GNUNET_CONTAINER_DLL_remove (h->pending_head, h->pending_tail, qe);
353 GNUNET_free (qe);
339 if (h->queue_job != GNUNET_SCHEDULER_NO_TASK) 354 if (h->queue_job != GNUNET_SCHEDULER_NO_TASK)
340 GNUNET_SCHEDULER_cancel (h->queue_job); 355 GNUNET_SCHEDULER_cancel (h->queue_job);
341 h->queue_job = GNUNET_SCHEDULER_add_now (&process_job_queue, h); 356 h->queue_job = GNUNET_SCHEDULER_add_now (&process_job_queue, h);