ipn: fix localapi and peerapi protocol for taildrop resume (#9860)

Minor fixes:
* The branch for listing or hashing partial files was inverted.
* The host for peerapi call needs to be real (rather than bogus).
* Handle remote peers that don't support resuming.
* Make resume failures non-fatal (since we can still continue).

This was tested locally, end-to-end system test is future work.

Updates tailscale/corp#14772

Signed-off-by: Joe Tsai <joetsai@digital-static.net>
Co-authored-by: Rhea Ghosh <rhea@tailscale.com>
This commit is contained in:
Joe Tsai
2023-10-17 16:14:47 -07:00
committed by GitHub
parent 77127a2494
commit 7971333603
2 changed files with 15 additions and 10 deletions

View File

@@ -655,7 +655,7 @@ func (h *peerAPIHandler) handlePeerPut(w http.ResponseWriter, r *http.Request) {
var err error
id := taildrop.ClientID(h.peerNode.StableID())
if r.URL.Path == "/v0/put/"+baseName {
if prefix == "" {
resp, err = h.ps.taildrop.PartialFiles(id)
} else {
ranges, ok := httphdr.ParseRange(r.Header.Get("Range"))