Skip to content

Commit 22cd22e

Browse files
committed
fixup! gvfs-helper: add prefetch support
Adjust our logging of the prefetch/since data into the server because the client always thinks that the value is zero. Signed-off-by: Derrick Stolee <stolee@gmail.com>
1 parent 82d60a0 commit 22cd22e

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

gvfs-helper-client.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -539,10 +539,9 @@ int gh_client__get_immediate(const struct object_id *oid,
539539
* Ask gvfs-helper to prefetch commits-and-trees packfiles since a
540540
* given timestamp.
541541
*
542-
* If seconds_since_epoch is zero, gvfs-helper will scan the ODB for
543-
* the last received prefetch and ask for ones newer than that.
542+
* We ignore seconds_since_epoch and use the value from the ODB.
544543
*/
545-
int gh_client__prefetch(timestamp_t seconds_since_epoch,
544+
int gh_client__prefetch(timestamp_t seconds_since_epoch UNUSED,
546545
int *nr_packfiles_received)
547546
{
548547
struct gh_server__process *entry;
@@ -557,14 +556,12 @@ int gh_client__prefetch(timestamp_t seconds_since_epoch,
557556
return -1;
558557

559558
trace2_region_enter("gh-client", "objects/prefetch", the_repository);
560-
trace2_data_intmax("gh-client", the_repository, "prefetch/since",
561-
seconds_since_epoch);
562559

563560
process = &entry->subprocess.process;
564561

565562
sigchain_push(SIGPIPE, SIG_IGN);
566563

567-
err = gh_client__send__objects_prefetch(process, seconds_since_epoch);
564+
err = gh_client__send__objects_prefetch(process, /* seconds unknown */ 0);
568565
if (!err)
569566
err = gh_client__objects__receive_response(
570567
process, &ghc, &nr_loose, &nr_packfile);

gvfs-helper-client.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ int gh_client__drain_queue(enum gh_client__created *p_ghc);
7070
* Ask `gvfs-helper server` to fetch any "prefetch packs"
7171
* available on the server more recent than the requested time.
7272
*
73-
* If seconds_since_epoch is zero, gvfs-helper will scan the ODB for
73+
* seconds_since_epoch is ignored. the gvfs-helper will scan the ODB for
7474
* the last received prefetch and ask for ones newer than that.
7575
*
7676
* A long-running background process is used to subsequent requests

gvfs-helper.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3542,6 +3542,10 @@ static void do__http_get__gvfs_prefetch(struct gh__response_status *status,
35423542
strbuf_addf(&component_url, "?lastPackTimestamp=%"PRItime,
35433543
seconds_since_epoch);
35443544

3545+
trace2_data_intmax(TR2_CAT, the_repository,
3546+
"prefetch/since",
3547+
seconds_since_epoch);
3548+
35453549
params.b_is_post = 0;
35463550
params.b_write_to_file = 1;
35473551
params.b_permit_cache_server_if_defined = 1;

0 commit comments

Comments
 (0)