From 0763c320e8b33b9b04febe995c263d71e1e9e5ae Mon Sep 17 00:00:00 2001 From: xc Date: Fri, 19 Sep 2025 19:00:40 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=BF=9C=E7=A8=8B=E8=B0=83?= =?UTF-8?q?=E7=94=A8=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scagent/core/FileRpc.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scagent/core/FileRpc.go b/scagent/core/FileRpc.go index 55515ac..32d3875 100644 --- a/scagent/core/FileRpc.go +++ b/scagent/core/FileRpc.go @@ -114,9 +114,10 @@ func (f *FileService) Compress(args *ZipBlock, reply *string) error { // 如果压缩包生成成功以后再执行 if strings.EqualFold(strings.ToLower(rest), "arcok") { // 合并为实际路径 - remotePath := path.Join("/www/wwwroot", args.RemotePath, zpFileName) + // remotePath := path.Join("/www/wwwroot", args.RemotePath, zpFileName) // 异步发送文件到远程服务器上 - go clientUploadFile(args.RemoteAddr, ziprl, remotePath) + // go clientUploadFile(args.RemoteAddr, ziprl, remotePath) + go clientUploadFile(args.RemoteAddr, ziprl) // 返回压缩包名称 *reply = ziprl @@ -127,7 +128,7 @@ func (f *FileService) Compress(args *ZipBlock, reply *string) error { // 客户端调用RPC传送文件的函数 // 传入zip的实际路径,远程的服务器带端口,远程文件存放路径 -func clientUploadFile(remote string, filePath string, uploadPath string) error { +func clientUploadFile(remote string, filePath string) error { // fmt.Printf("remote: %s, filePath: %s, uploadPath: %s\n", remote, filePath, uploadPath) // 启用日志 logger := util.NewProductionLogger() @@ -173,7 +174,8 @@ func clientUploadFile(remote string, filePath string, uploadPath string) error { reader := bufio.NewReader(file) var offset int64 = 0 - logger.Info("开始发送文件: %s (大小: %d bytes)", zap.String("filename", fileName), zap.String("path", filePath)) + // logger.Info("开始发送文件: %s (大小: %d bytes)", zap.String("filename", fileName), zap.String("path", filePath)) + fmt.Printf("开始发送文件: %s (大小: %d bytes)\n", fileName, fileInfo.Size()) // 发送文件 for {