From 68f64e1a4594e1e6f72a7a5be8212ffb12551ba3 Mon Sep 17 00:00:00 2001 From: xmdhs Date: Wed, 24 May 2023 13:12:30 +0800 Subject: [PATCH] fix --- build-android.bat | 5 +++++ natmap/natmap.go | 4 +--- 2 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 build-android.bat diff --git a/build-android.bat b/build-android.bat new file mode 100644 index 0000000..5bc6959 --- /dev/null +++ b/build-android.bat @@ -0,0 +1,5 @@ +SET CGO_ENABLED=0 +SET GOOS=linux +SET GOARCH=arm +SET GOARM=7 +go build -trimpath -ldflags "-w -s" -tags="androidgodns" diff --git a/natmap/natmap.go b/natmap/natmap.go index 630c3cd..3e35aa1 100644 --- a/natmap/natmap.go +++ b/natmap/natmap.go @@ -60,14 +60,12 @@ func keepalive(ctx context.Context, port uint16, log func(error)) { defer time.Sleep(10 * time.Second) rep, err := c.Do(reqs) - if rep != nil { - defer rep.Body.Close() - } if err != nil { c.CloseIdleConnections() log(err) return } + defer rep.Body.Close() }() } }