gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r13421 - gnunet/src/fs
Date: Wed, 27 Oct 2010 11:47:07 +0200

Author: wachs
Date: 2010-10-27 11:47:07 +0200 (Wed, 27 Oct 2010)
New Revision: 13421

Modified:
   gnunet/src/fs/fs.c
   gnunet/src/fs/fs_search.c
   gnunet/src/fs/fs_uri.c
   gnunet/src/fs/gnunet-download.c
   gnunet/src/fs/gnunet-service-fs.c
   gnunet/src/fs/perf_gnunet_service_fs_p2p.c
   gnunet/src/fs/test_fs_download.c
   gnunet/src/fs/test_fs_download_indexed.c
   gnunet/src/fs/test_fs_download_persistence.c
   gnunet/src/fs/test_fs_list_indexed.c
   gnunet/src/fs/test_fs_publish.c
   gnunet/src/fs/test_fs_publish_persistence.c
   gnunet/src/fs/test_fs_search.c
   gnunet/src/fs/test_fs_search_persistence.c
   gnunet/src/fs/test_fs_unindex.c
   gnunet/src/fs/test_fs_unindex_persistence.c
   gnunet/src/fs/test_gnunet_service_fs_migration.c
   gnunet/src/fs/test_gnunet_service_fs_p2p.c
Log:
Refactoring gnunet time


Modified: gnunet/src/fs/fs.c
===================================================================
--- gnunet/src/fs/fs.c  2010-10-27 09:41:28 UTC (rev 13420)
+++ gnunet/src/fs/fs.c  2010-10-27 09:47:07 UTC (rev 13421)
@@ -134,7 +134,7 @@
                                           run_time);
       rst = GNUNET_TIME_absolute_get_remaining (end_time);
       restart_at = GNUNET_TIME_relative_min (rst, restart_at);
-      if (rst.value > 0)
+      if (rst.rel_value > 0)
        continue;       
       stop_job (qe);
     }
@@ -677,7 +677,7 @@
   struct GNUNET_TIME_Relative dur;
 
   dur = GNUNET_TIME_absolute_get_duration (timestamp);
-  return GNUNET_BIO_write_int64 (wh, dur.value);
+  return GNUNET_BIO_write_int64 (wh, dur.rel_value);
 }
 
 
@@ -701,7 +701,7 @@
 {
   struct GNUNET_TIME_Relative dur;
   if (GNUNET_OK !=
-      GNUNET_BIO_read_int64 (rh, &dur.value))
+      GNUNET_BIO_read_int64 (rh, &dur.rel_value))
     return GNUNET_SYSERR;
   *timestamp = GNUNET_TIME_absolute_subtract (GNUNET_TIME_absolute_get (),
                                              dur);
@@ -774,7 +774,7 @@
           (GNUNET_YES !=
            GNUNET_FS_uri_test_chk (ret->chk_uri)) ) ) ||
        (GNUNET_OK !=
-       GNUNET_BIO_read_int64 (rh, &ret->expirationTime.value)) ||
+       GNUNET_BIO_read_int64 (rh, &ret->expirationTime.abs_value)) ||
        (GNUNET_OK !=
        read_start_time (rh, &ret->start_time)) ||
        (GNUNET_OK !=
@@ -1186,7 +1186,7 @@
        (GNUNET_OK !=
        GNUNET_BIO_write_string (wh, chks)) ||
        (GNUNET_OK != 
-       GNUNET_BIO_write_int64 (wh, fi->expirationTime.value)) ||
+       GNUNET_BIO_write_int64 (wh, fi->expirationTime.abs_value)) ||
        (GNUNET_OK != 
        write_start_time (wh, fi->start_time)) ||
        (GNUNET_OK !=

Modified: gnunet/src/fs/fs_search.c
===================================================================
--- gnunet/src/fs/fs_search.c   2010-10-27 09:41:28 UTC (rev 13420)
+++ gnunet/src/fs/fs_search.c   2010-10-27 09:47:07 UTC (rev 13421)
@@ -806,7 +806,7 @@
                const void *data,
                size_t size)
 {
-  if (GNUNET_TIME_absolute_get_duration (expiration).value > 0)
+  if (GNUNET_TIME_absolute_get_duration (expiration).rel_value > 0)
     {
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                  "Result received has already expired.\n");

Modified: gnunet/src/fs/fs_uri.c
===================================================================
--- gnunet/src/fs/fs_uri.c      2010-10-27 09:41:28 UTC (rev 13420)
+++ gnunet/src/fs/fs_uri.c      2010-10-27 09:47:07 UTC (rev 13421)
@@ -630,7 +630,7 @@
     }
   ass.purpose.size = htonl(sizeof(struct LocUriAssembly));
   ass.purpose.purpose = htonl(GNUNET_SIGNATURE_PURPOSE_PEER_PLACEMENT);
-  et.value = exptime;
+  et.abs_value = exptime;
   ass.exptime = GNUNET_TIME_absolute_hton (et);
   if (GNUNET_OK != 
       GNUNET_CRYPTO_rsa_verify (GNUNET_SIGNATURE_PURPOSE_PEER_PLACEMENT,
@@ -1885,7 +1885,7 @@
                    (unsigned long long) GNUNET_ntohll 
(uri->data.loc.fi.file_length),
                    peerId,
                   peerSig,
-                  (unsigned long long) uri->data.loc.expirationTime.value);
+                  (unsigned long long) uri->data.loc.expirationTime.abs_value);
   GNUNET_free (peerSig);
   GNUNET_free (peerId);
   return ret;

Modified: gnunet/src/fs/gnunet-download.c
===================================================================
--- gnunet/src/fs/gnunet-download.c     2010-10-27 09:41:28 UTC (rev 13420)
+++ gnunet/src/fs/gnunet-download.c     2010-10-27 09:47:07 UTC (rev 13421)
@@ -106,7 +106,7 @@
       if (verbose)
        {         
          s = GNUNET_STRINGS_relative_time_to_string(info->value.download.eta);
-         t = GNUNET_STRINGS_byte_size_fancy(info->value.download.completed * 
1000LL / (info->value.download.duration.value + 1));
+         t = GNUNET_STRINGS_byte_size_fancy(info->value.download.completed * 
1000LL / (info->value.download.duration.rel_value + 1));
          fprintf (stdout,
                   _("Downloading `%s' at %llu/%llu (%s remaining, %s/s)\n"),
                   info->value.download.filename,
@@ -125,7 +125,7 @@
       GNUNET_SCHEDULER_shutdown (sched);
       break;
     case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED:
-      s = GNUNET_STRINGS_byte_size_fancy(info->value.download.completed * 1000 
/ (info->value.download.duration.value + 1));
+      s = GNUNET_STRINGS_byte_size_fancy(info->value.download.completed * 1000 
/ (info->value.download.duration.rel_value + 1));
       fprintf (stdout,
               _("Downloading `%s' done (%s/s).\n"),
               info->value.download.filename,

Modified: gnunet/src/fs/gnunet-service-fs.c
===================================================================
--- gnunet/src/fs/gnunet-service-fs.c   2010-10-27 09:41:28 UTC (rev 13420)
+++ gnunet/src/fs/gnunet-service-fs.c   2010-10-27 09:47:07 UTC (rev 13421)
@@ -928,7 +928,7 @@
 
   delay = GNUNET_TIME_absolute_get_duration (start);
   GNUNET_LOAD_update (datastore_get_load,
-                     delay.value);
+                     delay.rel_value);
 }
 
 
@@ -1032,7 +1032,7 @@
   unsigned int repl;
   
   /* consider 'cp' as a migration target for mb */
-  if (GNUNET_TIME_absolute_get_remaining (cp->migration_blocked).value > 0)
+  if (GNUNET_TIME_absolute_get_remaining (cp->migration_blocked).rel_value > 0)
     return GNUNET_YES; /* peer has requested no migration! */
   if (mb != NULL)
     {
@@ -1496,7 +1496,7 @@
                                            pr))
     {
       GNUNET_LOAD_update (rt_entry_lifetime,
-                         GNUNET_TIME_absolute_get_duration 
(pr->start_time).value);
+                         GNUNET_TIME_absolute_get_duration 
(pr->start_time).rel_value);
     }
   if (pr->qe != NULL)
      {
@@ -2127,7 +2127,7 @@
       return 0;
     }  
   GNUNET_LOAD_update (cp->transmission_delay,
-                     GNUNET_TIME_absolute_get_duration 
(cp->last_transmission_request_start).value);
+                     GNUNET_TIME_absolute_get_duration 
(cp->last_transmission_request_start).rel_value);
   now = GNUNET_TIME_absolute_get ();
   msize = 0;
   min_delay = GNUNET_TIME_UNIT_FOREVER_REL;
@@ -2136,7 +2136,7 @@
          (pm->msize <= size) )
     {
       next_pm = pm->next;
-      if (pm->delay_until.value > now.value)
+      if (pm->delay_until.abs_value > now.abs_value)
        {
          min_delay = GNUNET_TIME_relative_min (min_delay,
                                                
GNUNET_TIME_absolute_get_remaining (pm->delay_until));
@@ -2783,13 +2783,13 @@
 #endif
   /* 2b) many other requests to this peer */
   delay = GNUNET_TIME_absolute_get_duration 
(cp->last_request_times[cp->last_request_times_off % MAX_QUEUE_PER_PEER]);
-  if (delay.value <= cp->avg_delay.value)
+  if (delay.rel_value <= cp->avg_delay.rel_value)
     {
 #if DEBUG_FS
       GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
                  "NOT sending query since we send %u others to this peer in 
the last %llums\n",
                  MAX_QUEUE_PER_PEER,
-                 cp->avg_delay.value);
+                 cp->avg_delay.abs_value);
 #endif
       return GNUNET_YES; /* skip */      
     }
@@ -2816,7 +2816,7 @@
          score += 1.0; /* likely successful based on hot path */
     }
   /* 3b) include latency */
-  if (cp->avg_delay.value < 4 * TTL_DECREMENT)
+  if (cp->avg_delay.rel_value < 4 * TTL_DECREMENT)
     score += 1.0; /* likely fast based on latency */
   /* 3c) include priorities */
   if (cp->avg_priority <= pr->remaining_priority / 2.0)
@@ -2964,7 +2964,7 @@
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                  "No peer selected for forwarding of query `%s', will try 
again in %llu ms!\n",
                  GNUNET_h2s (&pr->query),
-                 delay.value);
+                 delay.abs_value);
 #endif
       pr->task = GNUNET_SCHEDULER_add_delayed (sched,
                                               delay,
@@ -3211,9 +3211,9 @@
       if (i < pr->used_targets_off)
        {
          cur_delay = GNUNET_TIME_absolute_get_duration 
(pr->used_targets[i].last_request_time);      
-         prq->sender->avg_delay.value
-           = (prq->sender->avg_delay.value * 
-              (RUNAVG_DELAY_N - 1) + cur_delay.value) / RUNAVG_DELAY_N; 
+         prq->sender->avg_delay.rel_value
+           = (prq->sender->avg_delay.rel_value * 
+              (RUNAVG_DELAY_N - 1) + cur_delay.rel_value) / RUNAVG_DELAY_N; 
          prq->sender->avg_priority
            = (prq->sender->avg_priority * 
               (RUNAVG_DELAY_N - 1) + pr->priority) / (double) RUNAVG_DELAY_N;
@@ -3275,7 +3275,7 @@
                                                          key,
                                                          pr));
       GNUNET_LOAD_update (rt_entry_lifetime,
-                         GNUNET_TIME_absolute_get_duration 
(pr->start_time).value);
+                         GNUNET_TIME_absolute_get_duration 
(pr->start_time).rel_value);
       break;
     case GNUNET_BLOCK_EVALUATION_OK_DUPLICATE:
       GNUNET_STATISTICS_update (stats,
@@ -3395,7 +3395,7 @@
        = GNUNET_TIME_relative_to_absolute (art_delay);
       GNUNET_STATISTICS_update (stats,
                                gettext_noop ("cummulative artificial delay 
introduced (ms)"),
-                               art_delay.value,
+                               art_delay.abs_value,
                                GNUNET_NO);
 #endif
       reply->msize = msize;
@@ -3469,7 +3469,7 @@
   delay = GNUNET_TIME_absolute_get_duration (*start);
   GNUNET_free (start);
   GNUNET_LOAD_update (datastore_put_load,
-                     delay.value);
+                     delay.rel_value);
   if (GNUNET_OK == success)
     return;
   GNUNET_STATISTICS_update (stats,
@@ -3594,7 +3594,7 @@
     {
       cp = GNUNET_CONTAINER_multihashmap_get (connected_peers,
                                              &other->hashPubKey);
-      if (GNUNET_TIME_absolute_get_duration (cp->last_migration_block).value < 
5000)
+      if (GNUNET_TIME_absolute_get_duration 
(cp->last_migration_block).rel_value < 5000)
        return GNUNET_OK; /* already blocked */
       /* We're too busy; send MigrationStop message! */
       if (GNUNET_YES != active_migration) 
@@ -4105,7 +4105,7 @@
     }
   if ( (GNUNET_LOAD_get_load (cp->transmission_delay) > 3 * (1 + priority)) ||
        (GNUNET_LOAD_get_average (cp->transmission_delay) > 
-       GNUNET_CONSTANTS_MAX_CORK_DELAY.value * 2 + GNUNET_LOAD_get_average 
(rt_entry_lifetime)) )
+       GNUNET_CONSTANTS_MAX_CORK_DELAY.rel_value * 2 + GNUNET_LOAD_get_average 
(rt_entry_lifetime)) )
     {
       /* don't have BW to send to peer, or would likely take longer than we 
have for it,
         so at best indirect the query */
@@ -4161,8 +4161,8 @@
                                              &cdc);
   if (cdc.have != NULL)
     {
-      if (cdc.have->start_time.value + cdc.have->ttl >=
-         pr->start_time.value + pr->ttl)
+      if (cdc.have->start_time.abs_value + cdc.have->ttl >=
+         pr->start_time.abs_value + pr->ttl)
        {
          /* existing request has higher TTL, drop new one! */
          cdc.have->priority += pr->priority;
@@ -4205,7 +4205,7 @@
   
   pr->hnode = GNUNET_CONTAINER_heap_insert (requests_by_expiration_heap,
                                            pr,
-                                           pr->start_time.value + pr->ttl);
+                                           pr->start_time.abs_value + pr->ttl);
 
   GNUNET_STATISTICS_update (stats,
                            gettext_noop ("# P2P searches received"),

Modified: gnunet/src/fs/perf_gnunet_service_fs_p2p.c
===================================================================
--- gnunet/src/fs/perf_gnunet_service_fs_p2p.c  2010-10-27 09:41:28 UTC (rev 
13420)
+++ gnunet/src/fs/perf_gnunet_service_fs_p2p.c  2010-10-27 09:47:07 UTC (rev 
13421)
@@ -206,9 +206,9 @@
   if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_PREREQ_DONE))
     {
       del = GNUNET_TIME_absolute_get_duration (start_time);
-      if (del.value == 0)
-       del.value = 1;
-      fancy = GNUNET_STRINGS_byte_size_fancy (((unsigned long long)FILESIZE) * 
1000LL / del.value);
+      if (del.rel_value == 0)
+       del.rel_value = 1;
+      fancy = GNUNET_STRINGS_byte_size_fancy (((unsigned long long)FILESIZE) * 
1000LL / del.rel_value);
       fprintf (stdout,
               "Download speed was %s/s\n",
               fancy);

Modified: gnunet/src/fs/test_fs_download.c
===================================================================
--- gnunet/src/fs/test_fs_download.c    2010-10-27 09:41:28 UTC (rev 13420)
+++ gnunet/src/fs/test_fs_download.c    2010-10-27 09:47:07 UTC (rev 13421)
@@ -142,15 +142,15 @@
     case GNUNET_FS_STATUS_PUBLISH_PROGRESS:
 #if VERBOSE
       printf ("Publish is progressing (%llu/%llu at level %u off %llu)...\n",
-              (unsigned long long) event->value.publish.completed,
-              (unsigned long long) event->value.publish.size,
-             event->value.publish.specifics.progress.depth,
-             (unsigned long long) 
event->value.publish.specifics.progress.offset);
+              (unsigned long long) event->abs_value.publish.completed,
+              (unsigned long long) event->abs_value.publish.size,
+             event->abs_value.publish.specifics.progress.depth,
+             (unsigned long long) 
event->abs_value.publish.specifics.progress.offset);
 #endif      
       break;
     case GNUNET_FS_STATUS_PUBLISH_COMPLETED:
       printf ("Publishing complete, %llu kbps.\n",
-             (unsigned long long) (FILESIZE * 1000LL / 
(1+GNUNET_TIME_absolute_get_duration (start).value) / 1024LL));
+             (unsigned long long) (FILESIZE * 1000LL / 
(1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024LL));
       fn = GNUNET_DISK_mktemp ("gnunet-download-test-dst");
       start = GNUNET_TIME_absolute_get ();
       download = GNUNET_FS_download_start (fs,
@@ -167,7 +167,7 @@
       break;
     case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED:
       printf ("Download complete,  %llu kbps.\n",
-             (unsigned long long) (FILESIZE * 1000LL / 
(1+GNUNET_TIME_absolute_get_duration (start).value) / 1024LL));
+             (unsigned long long) (FILESIZE * 1000LL / 
(1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024LL));
       GNUNET_SCHEDULER_add_now (sched,
                                &abort_download_task,
                                NULL);
@@ -176,10 +176,10 @@
       GNUNET_assert (download == event->value.download.dc);
 #if VERBOSE
       printf ("Download is progressing (%llu/%llu at level %u off %llu)...\n",
-              (unsigned long long) event->value.download.completed,
-              (unsigned long long) event->value.download.size,
-             event->value.download.specifics.progress.depth,
-             (unsigned long long) 
event->value.download.specifics.progress.offset);
+              (unsigned long long) event->abs_value.download.completed,
+              (unsigned long long) event->abs_value.download.size,
+             event->abs_value.download.specifics.progress.depth,
+             (unsigned long long) 
event->abs_value.download.specifics.progress.offset);
 #endif
       break;
     case GNUNET_FS_STATUS_PUBLISH_ERROR:

Modified: gnunet/src/fs/test_fs_download_indexed.c
===================================================================
--- gnunet/src/fs/test_fs_download_indexed.c    2010-10-27 09:41:28 UTC (rev 
13420)
+++ gnunet/src/fs/test_fs_download_indexed.c    2010-10-27 09:47:07 UTC (rev 
13421)
@@ -144,15 +144,15 @@
     case GNUNET_FS_STATUS_PUBLISH_PROGRESS:
 #if VERBOSE
       printf ("Publish is progressing (%llu/%llu at level %u off %llu)...\n",
-              (unsigned long long) event->value.publish.completed,
-              (unsigned long long) event->value.publish.size,
-             event->value.publish.specifics.progress.depth,
-             (unsigned long long) 
event->value.publish.specifics.progress.offset);
+              (unsigned long long) event->abs_value.publish.completed,
+              (unsigned long long) event->abs_value.publish.size,
+             event->abs_value.publish.specifics.progress.depth,
+             (unsigned long long) 
event->abs_value.publish.specifics.progress.offset);
 #endif      
       break;
     case GNUNET_FS_STATUS_PUBLISH_COMPLETED:
       printf ("Publishing complete, %llu kbps.\n",
-             (unsigned long long) (FILESIZE * 1000LL / 
(1+GNUNET_TIME_absolute_get_duration (start).value) / 1024LL));
+             (unsigned long long) (FILESIZE * 1000LL / 
(1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024LL));
       fn = GNUNET_DISK_mktemp ("gnunet-download-test-dst");
       start = GNUNET_TIME_absolute_get ();
       download = GNUNET_FS_download_start (fs,
@@ -169,7 +169,7 @@
       break;
     case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED:
       printf ("Download complete,  %llu kbps.\n",
-             (unsigned long long) (FILESIZE * 1000LL / 
(1+GNUNET_TIME_absolute_get_duration (start).value) / 1024LL));
+             (unsigned long long) (FILESIZE * 1000LL / 
(1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024LL));
       GNUNET_SCHEDULER_add_now (sched,
                                &abort_download_task,
                                NULL);
@@ -178,10 +178,10 @@
       GNUNET_assert (download == event->value.download.dc);
 #if VERBOSE
       printf ("Download is progressing (%llu/%llu at level %u off %llu)...\n",
-              (unsigned long long) event->value.download.completed,
-              (unsigned long long) event->value.download.size,
-             event->value.download.specifics.progress.depth,
-             (unsigned long long) 
event->value.download.specifics.progress.offset);
+              (unsigned long long) event->abs_value.download.completed,
+              (unsigned long long) event->abs_value.download.size,
+             event->abs_value.download.specifics.progress.depth,
+             (unsigned long long) 
event->abs_value.download.specifics.progress.offset);
 #endif
       break;
     case GNUNET_FS_STATUS_PUBLISH_ERROR:

Modified: gnunet/src/fs/test_fs_download_persistence.c
===================================================================
--- gnunet/src/fs/test_fs_download_persistence.c        2010-10-27 09:41:28 UTC 
(rev 13420)
+++ gnunet/src/fs/test_fs_download_persistence.c        2010-10-27 09:47:07 UTC 
(rev 13421)
@@ -180,15 +180,15 @@
     case GNUNET_FS_STATUS_PUBLISH_PROGRESS:
 #if VERBOSE
       printf ("Publish is progressing (%llu/%llu at level %u off %llu)...\n",
-              (unsigned long long) event->value.publish.completed,
-              (unsigned long long) event->value.publish.size,
-             event->value.publish.specifics.progress.depth,
-             (unsigned long long) 
event->value.publish.specifics.progress.offset);
+              (unsigned long long) event->abs_value.publish.completed,
+              (unsigned long long) event->abs_value.publish.size,
+             event->abs_value.publish.specifics.progress.depth,
+             (unsigned long long) 
event->abs_value.publish.specifics.progress.offset);
 #endif      
       break;
     case GNUNET_FS_STATUS_PUBLISH_COMPLETED:
       printf ("Publishing complete, %llu kbps.\n",
-             (unsigned long long) (FILESIZE * 1000LL / 
(1+GNUNET_TIME_absolute_get_duration (start).value) / 1024LL));
+             (unsigned long long) (FILESIZE * 1000LL / 
(1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024LL));
       fn = GNUNET_DISK_mktemp ("gnunet-download-test-dst");
       start = GNUNET_TIME_absolute_get ();
       GNUNET_assert (download == NULL);
@@ -206,7 +206,7 @@
     case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED:
       consider_restart (event->status);
       printf ("Download complete,  %llu kbps.\n",
-             (unsigned long long) (FILESIZE * 1000LL / 
(1+GNUNET_TIME_absolute_get_duration (start).value) / 1024LL));
+             (unsigned long long) (FILESIZE * 1000LL / 
(1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024LL));
       GNUNET_SCHEDULER_add_now (sched,
                                &abort_download_task,
                                NULL);
@@ -216,10 +216,10 @@
       GNUNET_assert (download == event->value.download.dc);
 #if VERBOSE
       printf ("Download is progressing (%llu/%llu at level %u off %llu)...\n",
-              (unsigned long long) event->value.download.completed,
-              (unsigned long long) event->value.download.size,
-             event->value.download.specifics.progress.depth,
-             (unsigned long long) 
event->value.download.specifics.progress.offset);
+              (unsigned long long) event->abs_value.download.completed,
+              (unsigned long long) event->abs_value.download.size,
+             event->abs_value.download.specifics.progress.depth,
+             (unsigned long long) 
event->abs_value.download.specifics.progress.offset);
 #endif
       break;
     case GNUNET_FS_STATUS_PUBLISH_ERROR:

Modified: gnunet/src/fs/test_fs_list_indexed.c
===================================================================
--- gnunet/src/fs/test_fs_list_indexed.c        2010-10-27 09:41:28 UTC (rev 
13420)
+++ gnunet/src/fs/test_fs_list_indexed.c        2010-10-27 09:47:07 UTC (rev 
13421)
@@ -115,7 +115,7 @@
     case GNUNET_FS_STATUS_PUBLISH_COMPLETED:
       ret = event->value.publish.cctx;
       printf ("Publish complete,  %llu kbps.\n",
-             (unsigned long long) (FILESIZE * 1000 / 
(1+GNUNET_TIME_absolute_get_duration (start).value) / 1024));
+             (unsigned long long) (FILESIZE * 1000 / 
(1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024));
       if (0 == strcmp ("list_indexed-context-dir", 
                       event->value.publish.cctx))      
        GNUNET_SCHEDULER_add_continuation (sched,
@@ -129,10 +129,10 @@
       GNUNET_assert (publish == event->value.publish.pc);
 #if VERBOSE
       printf ("Publish is progressing (%llu/%llu at level %u off %llu)...\n",
-              (unsigned long long) event->value.publish.completed,
-              (unsigned long long) event->value.publish.size,
-             event->value.publish.specifics.progress.depth,
-             (unsigned long long) 
event->value.publish.specifics.progress.offset);
+              (unsigned long long) event->abs_value.publish.completed,
+              (unsigned long long) event->abs_value.publish.size,
+             event->abs_value.publish.specifics.progress.depth,
+             (unsigned long long) 
event->abs_value.publish.specifics.progress.offset);
 #endif
       break;
     case GNUNET_FS_STATUS_PUBLISH_ERROR:

Modified: gnunet/src/fs/test_fs_publish.c
===================================================================
--- gnunet/src/fs/test_fs_publish.c     2010-10-27 09:41:28 UTC (rev 13420)
+++ gnunet/src/fs/test_fs_publish.c     2010-10-27 09:47:07 UTC (rev 13421)
@@ -100,7 +100,7 @@
     case GNUNET_FS_STATUS_PUBLISH_COMPLETED:
       ret = event->value.publish.cctx;
       printf ("Publish complete,  %llu kbps.\n",
-             (unsigned long long) (FILESIZE * 1000 / 
(1+GNUNET_TIME_absolute_get_duration (start).value) / 1024));
+             (unsigned long long) (FILESIZE * 1000 / 
(1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024));
       if (0 == strcmp ("publish-context-dir", 
                       event->value.publish.cctx))      
        GNUNET_SCHEDULER_add_continuation (sched,
@@ -113,10 +113,10 @@
       GNUNET_assert (publish == event->value.publish.pc);
 #if VERBOSE
       printf ("Publish is progressing (%llu/%llu at level %u off %llu)...\n",
-              (unsigned long long) event->value.publish.completed,
-              (unsigned long long) event->value.publish.size,
-             event->value.publish.specifics.progress.depth,
-             (unsigned long long) 
event->value.publish.specifics.progress.offset);
+              (unsigned long long) event->abs_value.publish.completed,
+              (unsigned long long) event->abs_value.publish.size,
+             event->abs_value.publish.specifics.progress.depth,
+             (unsigned long long) 
event->abs_value.publish.specifics.progress.offset);
 #endif
       break;
     case GNUNET_FS_STATUS_PUBLISH_ERROR:

Modified: gnunet/src/fs/test_fs_publish_persistence.c
===================================================================
--- gnunet/src/fs/test_fs_publish_persistence.c 2010-10-27 09:41:28 UTC (rev 
13420)
+++ gnunet/src/fs/test_fs_publish_persistence.c 2010-10-27 09:47:07 UTC (rev 
13421)
@@ -148,7 +148,7 @@
       consider_restart (event->status);
       ret = event->value.publish.cctx;
       printf ("Publish complete,  %llu kbps.\n",
-             (unsigned long long) (FILESIZE * 1000 / 
(1+GNUNET_TIME_absolute_get_duration (start).value) / 1024));
+             (unsigned long long) (FILESIZE * 1000 / 
(1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024));
       if (0 == strcmp ("publish-context-dir", 
                       event->value.publish.cctx))      
        GNUNET_SCHEDULER_add_continuation (sched,
@@ -162,10 +162,10 @@
       GNUNET_assert (publish == event->value.publish.pc);
 #if VERBOSE
       printf ("Publish is progressing (%llu/%llu at level %u off %llu)...\n",
-              (unsigned long long) event->value.publish.completed,
-              (unsigned long long) event->value.publish.size,
-             event->value.publish.specifics.progress.depth,
-             (unsigned long long) 
event->value.publish.specifics.progress.offset);
+              (unsigned long long) event->abs_value.publish.completed,
+              (unsigned long long) event->abs_value.publish.size,
+             event->abs_value.publish.specifics.progress.depth,
+             (unsigned long long) 
event->abs_value.publish.specifics.progress.offset);
 #endif
       break;
     case GNUNET_FS_STATUS_PUBLISH_SUSPEND:

Modified: gnunet/src/fs/test_fs_search.c
===================================================================
--- gnunet/src/fs/test_fs_search.c      2010-10-27 09:41:28 UTC (rev 13420)
+++ gnunet/src/fs/test_fs_search.c      2010-10-27 09:47:07 UTC (rev 13421)
@@ -103,10 +103,10 @@
     case GNUNET_FS_STATUS_PUBLISH_PROGRESS:
 #if VERBOSE
       printf ("Publish is progressing (%llu/%llu at level %u off %llu)...\n",
-              (unsigned long long) event->value.publish.completed,
-              (unsigned long long) event->value.publish.size,
-             event->value.publish.specifics.progress.depth,
-             (unsigned long long) 
event->value.publish.specifics.progress.offset);
+              (unsigned long long) event->abs_value.publish.completed,
+              (unsigned long long) event->abs_value.publish.size,
+             event->abs_value.publish.specifics.progress.depth,
+             (unsigned long long) 
event->abs_value.publish.specifics.progress.offset);
 #endif      
       break;
     case GNUNET_FS_STATUS_PUBLISH_COMPLETED:

Modified: gnunet/src/fs/test_fs_search_persistence.c
===================================================================
--- gnunet/src/fs/test_fs_search_persistence.c  2010-10-27 09:41:28 UTC (rev 
13420)
+++ gnunet/src/fs/test_fs_search_persistence.c  2010-10-27 09:47:07 UTC (rev 
13421)
@@ -150,10 +150,10 @@
     case GNUNET_FS_STATUS_PUBLISH_PROGRESS:
 #if VERBOSE
       printf ("Publish is progressing (%llu/%llu at level %u off %llu)...\n",
-              (unsigned long long) event->value.publish.completed,
-              (unsigned long long) event->value.publish.size,
-             event->value.publish.specifics.progress.depth,
-             (unsigned long long) 
event->value.publish.specifics.progress.offset);
+              (unsigned long long) event->abs_value.publish.completed,
+              (unsigned long long) event->abs_value.publish.size,
+             event->abs_value.publish.specifics.progress.depth,
+             (unsigned long long) 
event->abs_value.publish.specifics.progress.offset);
 #endif      
       break;
     case GNUNET_FS_STATUS_PUBLISH_COMPLETED:

Modified: gnunet/src/fs/test_fs_unindex.c
===================================================================
--- gnunet/src/fs/test_fs_unindex.c     2010-10-27 09:41:28 UTC (rev 13420)
+++ gnunet/src/fs/test_fs_unindex.c     2010-10-27 09:47:07 UTC (rev 13421)
@@ -102,15 +102,15 @@
     case GNUNET_FS_STATUS_PUBLISH_PROGRESS:
 #if VERBOSE
       printf ("Publish is progressing (%llu/%llu at level %u off %llu)...\n",
-              (unsigned long long) event->value.publish.completed,
-              (unsigned long long) event->value.publish.size,
-             event->value.publish.specifics.progress.depth,
-             (unsigned long long) 
event->value.publish.specifics.progress.offset);
+              (unsigned long long) event->abs_value.publish.completed,
+              (unsigned long long) event->abs_value.publish.size,
+             event->abs_value.publish.specifics.progress.depth,
+             (unsigned long long) 
event->abs_value.publish.specifics.progress.offset);
 #endif      
       break;
     case GNUNET_FS_STATUS_PUBLISH_COMPLETED:
       printf ("Publishing complete, %llu kbps.\n",
-             (unsigned long long) (FILESIZE * 1000 / 
(1+GNUNET_TIME_absolute_get_duration (start).value) / 1024));
+             (unsigned long long) (FILESIZE * 1000 / 
(1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024));
       start = GNUNET_TIME_absolute_get ();
       unindex = GNUNET_FS_unindex_start (fs,
                                         fn,
@@ -119,7 +119,7 @@
       break;
     case GNUNET_FS_STATUS_UNINDEX_COMPLETED:
       printf ("Unindex complete,  %llu kbps.\n",
-             (unsigned long long) (FILESIZE * 1000 / 
(1+GNUNET_TIME_absolute_get_duration (start).value) / 1024));
+             (unsigned long long) (FILESIZE * 1000 / 
(1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024));
       GNUNET_SCHEDULER_add_continuation (sched,
                                         &abort_unindex_task,
                                         NULL,
@@ -129,10 +129,10 @@
       GNUNET_assert (unindex == event->value.unindex.uc);
 #if VERBOSE
       printf ("Unindex is progressing (%llu/%llu at level %u off %llu)...\n",
-              (unsigned long long) event->value.unindex.completed,
-              (unsigned long long) event->value.unindex.size,
-             event->value.unindex.specifics.progress.depth,
-             (unsigned long long) 
event->value.unindex.specifics.progress.offset);
+              (unsigned long long) event->abs_value.unindex.completed,
+              (unsigned long long) event->abs_value.unindex.size,
+             event->abs_value.unindex.specifics.progress.depth,
+             (unsigned long long) 
event->abs_value.unindex.specifics.progress.offset);
 #endif
       break;
     case GNUNET_FS_STATUS_PUBLISH_ERROR:

Modified: gnunet/src/fs/test_fs_unindex_persistence.c
===================================================================
--- gnunet/src/fs/test_fs_unindex_persistence.c 2010-10-27 09:41:28 UTC (rev 
13420)
+++ gnunet/src/fs/test_fs_unindex_persistence.c 2010-10-27 09:47:07 UTC (rev 
13421)
@@ -151,15 +151,15 @@
     case GNUNET_FS_STATUS_PUBLISH_PROGRESS:
 #if VERBOSE
       printf ("Publish is progressing (%llu/%llu at level %u off %llu)...\n",
-              (unsigned long long) event->value.publish.completed,
-              (unsigned long long) event->value.publish.size,
-             event->value.publish.specifics.progress.depth,
-             (unsigned long long) 
event->value.publish.specifics.progress.offset);
+              (unsigned long long) event->abs_value.publish.completed,
+              (unsigned long long) event->abs_value.publish.size,
+             event->abs_value.publish.specifics.progress.depth,
+             (unsigned long long) 
event->abs_value.publish.specifics.progress.offset);
 #endif      
       break;
     case GNUNET_FS_STATUS_PUBLISH_COMPLETED:
       printf ("Publishing complete, %llu kbps.\n",
-             (unsigned long long) (FILESIZE * 1000 / 
(1+GNUNET_TIME_absolute_get_duration (start).value) / 1024));
+             (unsigned long long) (FILESIZE * 1000 / 
(1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024));
       start = GNUNET_TIME_absolute_get ();
       unindex = GNUNET_FS_unindex_start (fs,
                                         fn,
@@ -168,7 +168,7 @@
       break;
     case GNUNET_FS_STATUS_UNINDEX_COMPLETED:
       printf ("Unindex complete,  %llu kbps.\n",
-             (unsigned long long) (FILESIZE * 1000 / 
(1+GNUNET_TIME_absolute_get_duration (start).value) / 1024));
+             (unsigned long long) (FILESIZE * 1000 / 
(1+GNUNET_TIME_absolute_get_duration (start).rel_value) / 1024));
       GNUNET_SCHEDULER_add_continuation (sched,
                                         &abort_unindex_task,
                                         NULL,
@@ -179,10 +179,10 @@
       GNUNET_assert (unindex == event->value.unindex.uc);
 #if VERBOSE
       printf ("Unindex is progressing (%llu/%llu at level %u off %llu)...\n",
-              (unsigned long long) event->value.unindex.completed,
-              (unsigned long long) event->value.unindex.size,
-             event->value.unindex.specifics.progress.depth,
-             (unsigned long long) 
event->value.unindex.specifics.progress.offset);
+              (unsigned long long) event->abs_value.unindex.completed,
+              (unsigned long long) event->abs_value.unindex.size,
+             event->abs_value.unindex.specifics.progress.depth,
+             (unsigned long long) 
event->abs_value.unindex.specifics.progress.offset);
 #endif
       break;
     case GNUNET_FS_STATUS_PUBLISH_SUSPEND:

Modified: gnunet/src/fs/test_gnunet_service_fs_migration.c
===================================================================
--- gnunet/src/fs/test_gnunet_service_fs_migration.c    2010-10-27 09:41:28 UTC 
(rev 13420)
+++ gnunet/src/fs/test_gnunet_service_fs_migration.c    2010-10-27 09:47:07 UTC 
(rev 13421)
@@ -67,9 +67,9 @@
   if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_PREREQ_DONE))
     {
       del = GNUNET_TIME_absolute_get_duration (start_time);
-      if (del.value == 0)
-       del.value = 1;
-      fancy = GNUNET_STRINGS_byte_size_fancy (((unsigned long long)FILESIZE) * 
1000LL / del.value);
+      if (del.rel_value == 0)
+       del.rel_value = 1;
+      fancy = GNUNET_STRINGS_byte_size_fancy (((unsigned long long)FILESIZE) * 
1000LL / del.rel_value);
       fprintf (stdout,
               "Download speed was %s/s\n",
               fancy);

Modified: gnunet/src/fs/test_gnunet_service_fs_p2p.c
===================================================================
--- gnunet/src/fs/test_gnunet_service_fs_p2p.c  2010-10-27 09:41:28 UTC (rev 
13420)
+++ gnunet/src/fs/test_gnunet_service_fs_p2p.c  2010-10-27 09:47:07 UTC (rev 
13421)
@@ -63,9 +63,9 @@
   if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_PREREQ_DONE))
     {
       del = GNUNET_TIME_absolute_get_duration (start_time);
-      if (del.value == 0)
-       del.value = 1;
-      fancy = GNUNET_STRINGS_byte_size_fancy (((unsigned long long)FILESIZE) * 
1000LL / del.value);
+      if (del.rel_value == 0)
+       del.rel_value = 1;
+      fancy = GNUNET_STRINGS_byte_size_fancy (((unsigned long long)FILESIZE) * 
1000LL / del.rel_value);
       fprintf (stdout,
               "Download speed was %s/s\n",
               fancy);




reply via email to

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