diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-03-07 19:15:01 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-03-07 19:15:01 +0000 |
commit | cc5f193706781f4c55d7616429f413c3b190284d (patch) | |
tree | 5d259b07d1d9db5349d3b9c3e04accd22690716d /src/fs/fs_download.c | |
parent | 8aaf1f156eee428287d573f07144b56fd298a81b (diff) | |
download | gnunet-cc5f193706781f4c55d7616429f413c3b190284d.tar.gz gnunet-cc5f193706781f4c55d7616429f413c3b190284d.zip |
-better interpretation of instant downloads from local database / existing block
Diffstat (limited to 'src/fs/fs_download.c')
-rw-r--r-- | src/fs/fs_download.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/fs/fs_download.c b/src/fs/fs_download.c index d21386390..189afd146 100644 --- a/src/fs/fs_download.c +++ b/src/fs/fs_download.c | |||
@@ -183,6 +183,9 @@ struct ProcessResultClosure | |||
183 | */ | 183 | */ |
184 | int do_store; | 184 | int do_store; |
185 | 185 | ||
186 | /** | ||
187 | * When did we last transmit the request? | ||
188 | */ | ||
186 | struct GNUNET_TIME_Absolute last_transmission; | 189 | struct GNUNET_TIME_Absolute last_transmission; |
187 | 190 | ||
188 | }; | 191 | }; |
@@ -937,7 +940,8 @@ process_result_with_request (void *cls, const GNUNET_HashCode * key, | |||
937 | struct ContentHashKey *chkarr; | 940 | struct ContentHashKey *chkarr; |
938 | 941 | ||
939 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 942 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
940 | "Received block `%s' matching pending request at depth %u and offset %llu/%llu\n", | 943 | "Received %u byte block `%s' matching pending request at depth %u and offset %llu/%llu\n", |
944 | (unsigned int) prc->size, | ||
941 | GNUNET_h2s (key), dr->depth, (unsigned long long) dr->offset, | 945 | GNUNET_h2s (key), dr->depth, (unsigned long long) dr->offset, |
942 | (unsigned long long) GNUNET_ntohll (dc->uri->data. | 946 | (unsigned long long) GNUNET_ntohll (dc->uri->data. |
943 | chk.file_length)); | 947 | chk.file_length)); |
@@ -1063,11 +1067,11 @@ process_result_with_request (void *cls, const GNUNET_HashCode * key, | |||
1063 | pi.value.download.specifics.progress.depth = dr->depth; | 1067 | pi.value.download.specifics.progress.depth = dr->depth; |
1064 | pi.value.download.specifics.progress.trust_offered = 0; | 1068 | pi.value.download.specifics.progress.trust_offered = 0; |
1065 | if (prc->last_transmission.abs_value != GNUNET_TIME_UNIT_FOREVER_ABS.abs_value) | 1069 | if (prc->last_transmission.abs_value != GNUNET_TIME_UNIT_FOREVER_ABS.abs_value) |
1066 | pi.value.download.specifics.progress.block_download_duration = | 1070 | pi.value.download.specifics.progress.block_download_duration |
1067 | GNUNET_TIME_absolute_get_duration (prc->last_transmission); | 1071 | = GNUNET_TIME_absolute_get_duration (prc->last_transmission); |
1068 | else | 1072 | else |
1069 | pi.value.download.specifics.progress.block_download_duration.rel_value = | 1073 | pi.value.download.specifics.progress.block_download_duration |
1070 | GNUNET_TIME_UNIT_FOREVER_REL.rel_value; | 1074 | = GNUNET_TIME_UNIT_ZERO; /* found locally */ |
1071 | GNUNET_FS_download_make_status_ (&pi, dc); | 1075 | GNUNET_FS_download_make_status_ (&pi, dc); |
1072 | if (dr->depth == 0) | 1076 | if (dr->depth == 0) |
1073 | propagate_up (dr); | 1077 | propagate_up (dr); |