From 610b59c98118c4062c640deeb0a0faa0455e4e89 Mon Sep 17 00:00:00 2001 From: xc Date: Fri, 10 Oct 2025 14:12:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=8F=91=E9=80=81=E5=9D=97?= =?UTF-8?q?=E7=9A=84=E5=8F=98=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scalib/build.bat | 4 +++- scalib/main.go | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/scalib/build.bat b/scalib/build.bat index 09e88ce..6466fab 100644 --- a/scalib/build.bat +++ b/scalib/build.bat @@ -1,5 +1,7 @@ +@echo off color 87 set GOOS=linux set GOARCH=amd64 set CGO_ENABLED=0 -go build -o scalib main.go \ No newline at end of file +go build -o scalib main.go +echo scalib build success \ No newline at end of file diff --git a/scalib/main.go b/scalib/main.go index 24a484e..444bb0d 100644 --- a/scalib/main.go +++ b/scalib/main.go @@ -122,6 +122,7 @@ func transferFile(c *UpFileClient, curPath string, uploadPath string) error { fmt.Printf("开始发送文件: %s (大小: %d bytes)\n", fileName, fileInfo.Size()) + var scReply bool for { n, err := reader.Read(buffer) if err != nil { @@ -137,9 +138,9 @@ func transferFile(c *UpFileClient, curPath string, uploadPath string) error { FileName: fileName, Offset: offset, IsLast: isLast, - }, &reply) + }, &scReply) - if err != nil || reply != "true" { + if err != nil || !scReply { panic("发送文件块失败: " + err.Error()) }