Skip to content

Commit 22e8caf

Browse files
committed
fix bugs
1 parent 0fb4682 commit 22e8caf

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

pkg/remote/fileshare/wshfs/wshfs.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,6 @@ func Copy(ctx context.Context, data wshrpc.CommandFileCopyData) error {
193193
if opts == nil {
194194
opts = &wshrpc.FileCopyOpts{}
195195
}
196-
opts.Recursive = true
197196
log.Printf("Copy: srcuri: %v, desturi: %v, opts: %v", data.SrcUri, data.DestUri, opts)
198197
srcConn, err := parseConnection(ctx, data.SrcUri)
199198
if err != nil {

pkg/wshrpc/wshremote/wshremote_file.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ func (impl *ServerImpl) RemoteFileCopyCommand(ctx context.Context, data wshrpc.C
304304
defer timeoutCancel()
305305
copyStart := time.Now()
306306

307-
srcFileInfo, err := wshclient.RemoteFileInfoCommand(wshfs.RpcClient, srcConn.Path, &wshrpc.RpcOpts{Timeout: opts.Timeout})
307+
srcFileInfo, err := wshclient.RemoteFileInfoCommand(wshfs.RpcClient, srcConn.Path, &wshrpc.RpcOpts{Timeout: opts.Timeout, Route: wshutil.MakeConnectionRouteId(srcConn.Host)})
308308
if err != nil {
309309
return false, fmt.Errorf("cannot get info for source file %q: %w", data.SrcUri, err)
310310
}
@@ -326,7 +326,7 @@ func (impl *ServerImpl) RemoteFileCopyCommand(ctx context.Context, data wshrpc.C
326326
}
327327
defer destFile.Close()
328328

329-
streamChan := wshclient.RemoteStreamFileCommand(wshfs.RpcClient, wshrpc.CommandRemoteStreamFileData{Path: srcConn.Path}, &wshrpc.RpcOpts{Timeout: opts.Timeout})
329+
streamChan := wshclient.RemoteStreamFileCommand(wshfs.RpcClient, wshrpc.CommandRemoteStreamFileData{Path: srcConn.Path}, &wshrpc.RpcOpts{Timeout: opts.Timeout, Route: wshutil.MakeConnectionRouteId(srcConn.Host)})
330330
if err = fsutil.ReadFileStreamToWriter(readCtx, streamChan, destFile); err != nil {
331331
return false, fmt.Errorf("error copying file %q to %q: %w", data.SrcUri, data.DestUri, err)
332332
}

0 commit comments

Comments
 (0)