perf: several dragged items cross to another place as one tar stream; older agents get them one by one

This commit is contained in:
redtea committed 2026-10-15 22:28:46 +03:00
1 parent 6916af4236
commit 7d1996dd7d
8 files changed
+301 -72

No files matched your search

+16
View File
@@ -5,6 +5,8 @@
// outbound requests.
package proto
import "strings"
import "encoding/json"
// Control poll message types (server -> agent, returned from /api/agent/poll).
@@ -372,6 +374,20 @@ type FSShipArgs struct {
// Conn: the files of this side are on the SSH host of this agent's file
// connection (an SSH file pane), not on the machine itself.
Conn string `json:"conn,omitempty"`
// More: other things of Src's folder sent in the same stream under their
// own names (several files dragged at once). Agents before 0.2.0 do not
// know it; the server sends to them one at a time.
More []string `json:"more,omitempty"`
}
// ShipNames is what lands at the other end: Name, then More by their names.
func (a FSShipArgs) ShipNames() []string {
n := []string{a.Name}
for _, p := range a.More {
p = strings.TrimRight(p, "/")
n = append(n, p[strings.LastIndex(p, "/")+1:])
}
return n
}
// ShipProgress is what a sending machine reports: bytes of files sent out of