-round expiration times to full seconds
[oweals/gnunet.git] / src / fs / fs_search.c
index a0fec03a1c4d18c638459f29ebdc03239704cd08..38bd55caa05eb8d58696c0e975228ca8e728aba9 100644 (file)
@@ -342,7 +342,7 @@ GNUNET_FS_search_probe_progress_ (void *cls,
     {
       /* should only happen if the cancel task was already
         created on 'DOWNLOAD_INACTIVE' as we were out of time */
-      GNUNET_break (0 == sr->remaining_probe_time.rel_value);
+      GNUNET_break (0 == sr->remaining_probe_time.rel_value_us);
     }
     break;
   case GNUNET_FS_STATUS_DOWNLOAD_INACTIVE:
@@ -354,7 +354,7 @@ GNUNET_FS_search_probe_progress_ (void *cls,
     dur = GNUNET_TIME_absolute_get_duration (sr->probe_active_time);
     sr->remaining_probe_time =
         GNUNET_TIME_relative_subtract (sr->remaining_probe_time, dur);
-    if (0 == sr->remaining_probe_time.rel_value)
+    if (0 == sr->remaining_probe_time.rel_value_us)
       sr->probe_cancel_task =
         GNUNET_SCHEDULER_add_now (&probe_failure_handler, sr);
     GNUNET_FS_search_result_sync_ (sr);
@@ -843,7 +843,7 @@ process_result (struct GNUNET_FS_SearchContext *sc,
                const void *data,
                 size_t size)
 {
-  if (GNUNET_TIME_absolute_get_duration (expiration).rel_value > 0)
+  if (GNUNET_TIME_absolute_get_duration (expiration).rel_value_us > 0)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                 "Result received has already expired.\n");
@@ -1104,6 +1104,7 @@ transmit_search_request (void *cls, size_t size, void *buf)
     memset (&sm->target, 0, sizeof (struct GNUNET_HashCode));
     GNUNET_CRYPTO_ecc_public_key_derive (&sc->uri->data.sks.ns,
                                         sc->uri->data.sks.identifier,
+                                        "fs-ublock",
                                         &dpub);
     GNUNET_CRYPTO_hash (&dpub,
                        sizeof (dpub),
@@ -1290,6 +1291,7 @@ GNUNET_FS_search_start_searching_ (struct GNUNET_FS_SearchContext *sc)
       sre->keyword = GNUNET_strdup (keyword);
       GNUNET_CRYPTO_ecc_public_key_derive (&anon_pub,
                                           keyword,
+                                          "fs-ublock",
                                           &sre->dpub);
       GNUNET_CRYPTO_hash (&sre->dpub, 
                          sizeof (struct GNUNET_CRYPTO_EccPublicKey),