Repository navigation
http: add metadata defaults for --http-no-head - #9648
Conversation
Signed-off-by: Giridhar <[email protected]>
ncw
left a comment
There was a problem hiding this comment.
I put some minor concerns inline - otherwise looks great - thank you.
|
All requested changes are addressed in |
ncw
left a comment
There was a problem hiding this comment.
This is looking great now - thank you.
I have a minor thing that needs fixing - see inline - then I can merge
Thank you :-)
|
|
||
| When HEAD requests are disabled, rclone normally reports an unknown file size. | ||
| Set this option to a non-negative value to report that size for every file, | ||
| including 0. Leave it at -1 to keep reporting an unknown size. |
There was a problem hiding this comment.
This should say "Leave it unset (the default, shown as "off") to keep reporting an unknown size"
As you can't actually set an fs.SizeSuffix value to -1
|
Hi @giri256, a gentle nudge on this one. It's only one line away from merging: the If you'd rather, I can make that change when I merge. Just say so. Thanks! |
|
Thanks for the nudge, and sorry for the delay. Fixed in |
What this changes
Adds two advanced HTTP backend options for use with
--http-no-head:--http-no-head-sizereports a configured size for every file instead of the usual unknown size. Its default is-1(unknown), while any non-negative value—including0—is reported as authoritative.--http-no-head-timereports a configured modification time instead of the Unix epoch sentinel.Both options preserve current behavior when left unset. The values are applied in the common no-HEAD metadata path, so they cover both directory listings and direct object lookup.
The size option's help now calls out that an incorrect fixed size can cause transfer size-check failures/retries, incorrect multi-thread ranges, and mount reads being limited at the reported size. The time option notes that changing it later makes every file appear modified to a sync.
Verification
go test ./backend/http -count=1go vet ./backend/httpgolangci-lint run ./backend/http/...with zero findingsgit diff --checkFocused tests cover the default unknown size, an explicit zero-byte size, and configured size/time metadata.
Fixes #7988