gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r25269 - gnunet/src/fs


From: gnunet
Subject: [GNUnet-SVN] r25269 - gnunet/src/fs
Date: Wed, 5 Dec 2012 20:33:59 +0100

Author: grothoff
Date: 2012-12-05 20:33:59 +0100 (Wed, 05 Dec 2012)
New Revision: 25269

Modified:
   gnunet/src/fs/fs_api.c
   gnunet/src/fs/fs_api.h
   gnunet/src/fs/fs_download.c
   gnunet/src/fs/fs_search.c
Log:
-more logging

Modified: gnunet/src/fs/fs_api.c
===================================================================
--- gnunet/src/fs/fs_api.c      2012-12-05 18:28:48 UTC (rev 25268)
+++ gnunet/src/fs/fs_api.c      2012-12-05 19:33:59 UTC (rev 25269)
@@ -61,6 +61,10 @@
   qe->h->active_blocks += qe->blocks;
   qe->h->active_downloads++;
   qe->start_time = GNUNET_TIME_absolute_get ();
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+             "Starting job %p (%u active)\n",
+             qe,
+             qe->h->active_downloads);
   GNUNET_CONTAINER_DLL_remove (qe->h->pending_head, qe->h->pending_tail, qe);
   GNUNET_CONTAINER_DLL_insert_after (qe->h->running_head, qe->h->running_tail,
                                      qe->h->running_tail, qe);
@@ -85,6 +89,10 @@
       GNUNET_TIME_relative_add (qe->run_time,
                                 GNUNET_TIME_absolute_get_duration
                                 (qe->start_time));
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+             "Stopping job %p (%u active)\n",
+             qe,
+             qe->h->active_downloads);
   GNUNET_CONTAINER_DLL_remove (qe->h->running_head, qe->h->running_tail, qe);
   GNUNET_CONTAINER_DLL_insert_after (qe->h->pending_head, qe->h->pending_tail,
                                      qe->h->pending_tail, qe);
@@ -318,24 +326,31 @@
   if (h->queue_job != GNUNET_SCHEDULER_NO_TASK)
     GNUNET_SCHEDULER_cancel (h->queue_job);
   h->queue_job = GNUNET_SCHEDULER_add_now (&process_job_queue, h);
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+             "Queueing job %p\n",
+             qe);
   return qe;
 }
 
 
 /**
  * Dequeue a job from the queue.
- * @param qh handle for the job
+ *
+ * @param qe handle for the job
  */
 void
-GNUNET_FS_dequeue_ (struct GNUNET_FS_QueueEntry *qh)
+GNUNET_FS_dequeue_ (struct GNUNET_FS_QueueEntry *qe)
 {
   struct GNUNET_FS_Handle *h;
 
-  h = qh->h;
-  if (NULL != qh->client)
-    stop_job (qh);
-  GNUNET_CONTAINER_DLL_remove (h->pending_head, h->pending_tail, qh);
-  GNUNET_free (qh);
+  h = qe->h;
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+             "Dequeueing job %p\n",
+             qe);
+  if (NULL != qe->client)
+    stop_job (qe);
+  GNUNET_CONTAINER_DLL_remove (h->pending_head, h->pending_tail, qe);
+  GNUNET_free (qe);
   if (h->queue_job != GNUNET_SCHEDULER_NO_TASK)
     GNUNET_SCHEDULER_cancel (h->queue_job);
   h->queue_job = GNUNET_SCHEDULER_add_now (&process_job_queue, h);

Modified: gnunet/src/fs/fs_api.h
===================================================================
--- gnunet/src/fs/fs_api.h      2012-12-05 18:28:48 UTC (rev 25268)
+++ gnunet/src/fs/fs_api.h      2012-12-05 19:33:59 UTC (rev 25269)
@@ -633,10 +633,11 @@
 
 /**
  * Dequeue a job from the queue.
- * @param qh handle for the job
+ *
+ * @param qe handle for the job
  */
 void
-GNUNET_FS_dequeue_ (struct GNUNET_FS_QueueEntry *qh);
+GNUNET_FS_dequeue_ (struct GNUNET_FS_QueueEntry *qe);
 
 
 /**

Modified: gnunet/src/fs/fs_download.c
===================================================================
--- gnunet/src/fs/fs_download.c 2012-12-05 18:28:48 UTC (rev 25268)
+++ gnunet/src/fs/fs_download.c 2012-12-05 19:33:59 UTC (rev 25269)
@@ -2081,6 +2081,11 @@
     return NULL;
   }
   dc = GNUNET_malloc (sizeof (struct GNUNET_FS_DownloadContext));
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+             "Starting download %p, %u bytes at offset %llu\n",
+             dc,
+             (unsigned long long) length,
+             (unsigned long long) offset);
   dc->h = h;
   dc->uri = GNUNET_FS_uri_dup (uri);
   dc->meta = GNUNET_CONTAINER_meta_data_duplicate (meta);
@@ -2258,6 +2263,10 @@
                        (0 == (dc->options & GNUNET_FS_DOWNLOAD_IS_PROBE))
                        ? GNUNET_FS_QUEUE_PRIORITY_NORMAL 
                        : GNUNET_FS_QUEUE_PRIORITY_PROBE);
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+             "Download %p put into queue as job %p\n",
+             dc,
+             dc->job_queue);
 }
 
 

Modified: gnunet/src/fs/fs_search.c
===================================================================
--- gnunet/src/fs/fs_search.c   2012-12-05 18:28:48 UTC (rev 25268)
+++ gnunet/src/fs/fs_search.c   2012-12-05 19:33:59 UTC (rev 25269)
@@ -211,6 +211,10 @@
   GNUNET_FS_download_stop (sr->probe_ctx, GNUNET_YES);
   sr->probe_ctx = NULL;
   GNUNET_FS_search_result_sync_ (sr);
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+             "Probe #%u for search result %p failed\n",
+             sr->availability_trials,
+             sr);
   signal_probe_result (sr);
 }
 
@@ -232,6 +236,10 @@
   GNUNET_FS_download_stop (sr->probe_ctx, GNUNET_YES);
   sr->probe_ctx = NULL;
   GNUNET_FS_search_result_sync_ (sr);
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+             "Probe #%u for search result %p succeeded\n",
+             sr->availability_trials,
+             sr);
   signal_probe_result (sr);
 }
 
@@ -361,6 +369,11 @@
     len = len - off;
   else
     len = DBLOCK_SIZE;
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+             "Starting probe #%u (at offset %llu) for search result %p\n",
+             sr->availability_trials + 1,
+             (unsigned long long) off,
+             sr);
   sr->remaining_probe_time =
       GNUNET_TIME_relative_multiply (sr->sc->h->avg_block_latency,
                                      2 * (1 + sr->availability_trials));




reply via email to

[Prev in Thread] Current Thread [Next in Thread]