From eded8b172f78913d7b7d717578424950aef28db7 Mon Sep 17 00:00:00 2001 From: SunBK201 Date: Fri, 6 Dec 2024 23:22:31 +0800 Subject: [PATCH] fix: peek EOF log level --- build.sh | 2 +- install.sh | 2 +- ipkg/CONTROL/control | 2 +- ipkg/CONTROL/control-e | 2 +- openwrt/Makefile | 2 +- openwrt/files/luci/cbi.lua | 2 +- src/main.go | 8 ++++++-- 7 files changed, 12 insertions(+), 8 deletions(-) diff --git a/build.sh b/build.sh index b55fcf6..54a2f47 100755 --- a/build.sh +++ b/build.sh @@ -1,7 +1,7 @@ #!/bin/sh project_name="ua3f" -release_version="0.7.2" +release_version="0.7.3" target=main.go dist=./dist release_dir=./bin diff --git a/install.sh b/install.sh index 0b33fa9..aaee092 100755 --- a/install.sh +++ b/install.sh @@ -98,7 +98,7 @@ install_ua3f() { cd /root getcpucore -version=0.7.2 +version=0.7.3 ua3f_tar=ua3f-$version-$cpucore.tar.gz chmod_clash diff --git a/ipkg/CONTROL/control b/ipkg/CONTROL/control index 6736dd2..f8e8f03 100644 --- a/ipkg/CONTROL/control +++ b/ipkg/CONTROL/control @@ -1,5 +1,5 @@ Package: ua3f -Version: 0.7.2-1 +Version: 0.7.3-1 Depends: luci-compat Source: /feed/openwrt SourceName: UA3F diff --git a/ipkg/CONTROL/control-e b/ipkg/CONTROL/control-e index a30984b..8dc7168 100644 --- a/ipkg/CONTROL/control-e +++ b/ipkg/CONTROL/control-e @@ -1,5 +1,5 @@ Package: ua3f -Version: 0.7.2-1 +Version: 0.7.3-1 Depends: luci-compat Source: /feed/openwrt SourceName: UA3F diff --git a/openwrt/Makefile b/openwrt/Makefile index c7fc4a0..3c3a597 100644 --- a/openwrt/Makefile +++ b/openwrt/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=UA3F -PKG_VERSION:=0.7.2 +PKG_VERSION:=0.7.3 PKG_RELEASE:=1 # PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz diff --git a/openwrt/files/luci/cbi.lua b/openwrt/files/luci/cbi.lua index de0a42c..32b8a3c 100644 --- a/openwrt/files/luci/cbi.lua +++ b/openwrt/files/luci/cbi.lua @@ -3,7 +3,7 @@ local uci = require("luci.model.uci").cursor() ua3f = Map("ua3f", "UA3F", [[ - Version: 0.7.2 + Version: 0.7.3
Across the Campus we can reach every corner in the world. ]] diff --git a/src/main.go b/src/main.go index 7e6bb30..d7775d6 100644 --- a/src/main.go +++ b/src/main.go @@ -18,7 +18,7 @@ import ( "github.com/sunbk201/ua3f/log" ) -var version = "0.7.2" +var version = "0.7.3" var payload string var uaPattern string var uaRegexp *regexp2.Regexp @@ -349,7 +349,11 @@ func Socks5Forward(client, target net.Conn, destAddrPort string) { func isHTTP(reader *bufio.Reader) (bool, error) { buf, err := reader.Peek(7) if err != nil { - logrus.Error(fmt.Sprintf("Peek error: %s", err.Error())) + if strings.Contains(err.Error(), "EOF") { + logrus.Debug(fmt.Sprintf("Peek EOF: %s", err.Error())) + } else { + logrus.Error(fmt.Sprintf("Peek error: %s", err.Error())) + } return false, err } hint := string(buf)