Refactoring gnunet time
authorMatthias Wachs <wachs@net.in.tum.de>
Wed, 27 Oct 2010 09:47:07 +0000 (09:47 +0000)
committerMatthias Wachs <wachs@net.in.tum.de>
Wed, 27 Oct 2010 09:47:07 +0000 (09:47 +0000)
18 files changed:
src/fs/fs.c
src/fs/fs_search.c
src/fs/fs_uri.c
src/fs/gnunet-download.c
src/fs/gnunet-service-fs.c
src/fs/perf_gnunet_service_fs_p2p.c
src/fs/test_fs_download.c
src/fs/test_fs_download_indexed.c
src/fs/test_fs_download_persistence.c
src/fs/test_fs_list_indexed.c
src/fs/test_fs_publish.c
src/fs/test_fs_publish_persistence.c
src/fs/test_fs_search.c
src/fs/test_fs_search_persistence.c
src/fs/test_fs_unindex.c
src/fs/test_fs_unindex_persistence.c
src/fs/test_gnunet_service_fs_migration.c
src/fs/test_gnunet_service_fs_p2p.c

index accaafac4997969712470a1547105adc1c10c54e..e144a0b89a43329a62fe89909c0fbb30598cd4ca 100644 (file)
@@ -134,7 +134,7 @@ process_job_queue (void *cls,
                                           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 @@ write_start_time (struct GNUNET_BIO_WriteHandle *wh,
   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 @@ read_start_time (struct GNUNET_BIO_ReadHandle *rh,
 {
   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 @@ deserialize_fi_node (struct GNUNET_FS_Handle *h,
           (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_FS_file_information_sync_ (struct GNUNET_FS_FileInformation * fi)
        (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 !=
index f077bdac3f4957078b0feebcb1ae3e77989ea068..16e1dd1d58c4b2153d890c162889f72b3aea6da6 100644 (file)
@@ -806,7 +806,7 @@ process_result (struct GNUNET_FS_SearchContext *sc,
                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");
index dff4b868601b7d0fcfa353cbbbc4957432a61212..ca516cc85abcb62ba2311b7a5c3b24cfff3be443 100644 (file)
@@ -630,7 +630,7 @@ uri_loc_parse (const char *s, char **emsg)
     }
   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 @@ uri_loc_to_string (const struct GNUNET_FS_Uri *uri)
                    (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;
index 0956346436064acf48eb05bf020b87dc6cdd13b4..6f7854756b588ebd7a75bc8368b452cf5cc34b75 100644 (file)
@@ -106,7 +106,7 @@ progress_cb (void *cls,
       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 @@ progress_cb (void *cls,
       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,
index 9c1b3f04fbc16f24eb64537b448436e5c4d973ca..1cd1142613d89160cfbbac61a137e85288dd9fb5 100644 (file)
@@ -928,7 +928,7 @@ update_datastore_delays (struct GNUNET_TIME_Absolute start)
 
   delay = GNUNET_TIME_absolute_get_duration (start);
   GNUNET_LOAD_update (datastore_get_load,
-                     delay.value);
+                     delay.rel_value);
 }
 
 
@@ -1032,7 +1032,7 @@ consider_migration (void *cls,
   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 @@ destroy_pending_request (struct PendingRequest *pr)
                                            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 @@ transmit_to_peer (void *cls,
       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 @@ transmit_to_peer (void *cls,
          (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 @@ target_peer_select_cb (void *cls,
 #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 @@ target_peer_select_cb (void *cls,
          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 @@ forward_request_task (void *cls,
       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 @@ struct GNUNET_TIME_Relative art_delay;
       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 @@ struct GNUNET_TIME_Relative art_delay;
                                                          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 @@ struct GNUNET_TIME_Relative art_delay;
        = 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 @@ put_migration_continuation (void *cls,
   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 @@ handle_p2p_put (void *cls,
     {
       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 @@ handle_p2p_get (void *cls,
     }
   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 @@ handle_p2p_get (void *cls,
                                              &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 @@ handle_p2p_get (void *cls,
   
   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"),
index caeabedd55f58fc6a0d337cfe436f09ea0dc9ba4..8b1c0ad242e6d08adebaf228edfc55e787759c86 100644 (file)
@@ -206,9 +206,9 @@ do_report (void *cls,
   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);
index 010b3336dd0b56c0701ed428e812d522883fc29f..848c9595424b3e764509e7bc76eea0148efdd55f 100644 (file)
@@ -142,15 +142,15 @@ progress_cb (void *cls,
     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 @@ progress_cb (void *cls,
       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 @@ progress_cb (void *cls,
       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:
index 725d06f880dd235761dd6615c8fc7905a832d96a..ac4f57bb9ac6d1806a5532c86498747b8894bfee 100644 (file)
@@ -144,15 +144,15 @@ progress_cb (void *cls,
     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 @@ progress_cb (void *cls,
       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 @@ progress_cb (void *cls,
       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:
index ffd66c52d2c52918efabee9fa274a347b86e4415..4560985c95f7ebe72bf319cc3e69c32a427ad7ac 100644 (file)
@@ -180,15 +180,15 @@ progress_cb (void *cls,
     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 @@ progress_cb (void *cls,
     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 @@ progress_cb (void *cls,
       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:
index eb5fdf50515be1575fc6ef23fae306bbc99eeb7d..dd2b30417a1a358e441118db885ad1f161a18a87 100644 (file)
@@ -115,7 +115,7 @@ progress_cb (void *cls,
     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 @@ progress_cb (void *cls,
       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:
index 45d1c822a17927c23e03528499e85a4c030b5eb9..f5b835259ff34db7fe41788d5fb7c83ae71f0d0e 100644 (file)
@@ -100,7 +100,7 @@ progress_cb (void *cls,
     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 @@ progress_cb (void *cls,
       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:
index dfcf335c7619537237c617e3d57e5586ae1348e3..b4b9b58ba96e7e41f0c3b9f07b720739cb34586b 100644 (file)
@@ -148,7 +148,7 @@ progress_cb (void *cls,
       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 @@ progress_cb (void *cls,
       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:
index 5fdfdc7e685db3a86ac2ed5cbe109aeaad355bb2..98315ac5ccd2a8c2384a842b588f2412cdbb7dcc 100644 (file)
@@ -103,10 +103,10 @@ progress_cb (void *cls,
     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:
index 2b689e478a2b25d27611b563e9c5932cff55ce1d..97b7f656b7d8c9847e2c89a80a5b5e233fd19729 100644 (file)
@@ -150,10 +150,10 @@ progress_cb (void *cls,
     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:
index 468f86504f9244d3aab6084e6a675644039bc1f8..6fe47a6c48312a088fd1ea26930b1e3a882d80db 100644 (file)
@@ -102,15 +102,15 @@ progress_cb (void *cls,
     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 @@ progress_cb (void *cls,
       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 @@ progress_cb (void *cls,
       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:
index 3483b7e0992337b6309595ab44be20477d66d1b7..cbe08913fc11622c90a2227d2b2f6734b6d4dc07 100644 (file)
@@ -151,15 +151,15 @@ progress_cb (void *cls,
     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 @@ progress_cb (void *cls,
       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 @@ progress_cb (void *cls,
       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:
index ae502158e88dc7389eac18d3497340ce92cbc434..3d6afbdc2569af1809ed9910c36623b199a3e581 100644 (file)
@@ -67,9 +67,9 @@ do_stop (void *cls,
   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);
index d15c6e144a4f92cfa7cffc10b96fa5def89d2043..f026baf6b86c298fa6dc091b60acddd3b0a099a9 100644 (file)
@@ -63,9 +63,9 @@ do_stop (void *cls,
   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);