fix: peek EOF log level

This commit is contained in:
SunBK201 2024-12-06 23:22:31 +08:00
parent bd66d104e8
commit eded8b172f
7 changed files with 12 additions and 8 deletions

View File

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
project_name="ua3f" project_name="ua3f"
release_version="0.7.2" release_version="0.7.3"
target=main.go target=main.go
dist=./dist dist=./dist
release_dir=./bin release_dir=./bin

View File

@ -98,7 +98,7 @@ install_ua3f() {
cd /root cd /root
getcpucore getcpucore
version=0.7.2 version=0.7.3
ua3f_tar=ua3f-$version-$cpucore.tar.gz ua3f_tar=ua3f-$version-$cpucore.tar.gz
chmod_clash chmod_clash

View File

@ -1,5 +1,5 @@
Package: ua3f Package: ua3f
Version: 0.7.2-1 Version: 0.7.3-1
Depends: luci-compat Depends: luci-compat
Source: /feed/openwrt Source: /feed/openwrt
SourceName: UA3F SourceName: UA3F

View File

@ -1,5 +1,5 @@
Package: ua3f Package: ua3f
Version: 0.7.2-1 Version: 0.7.3-1
Depends: luci-compat Depends: luci-compat
Source: /feed/openwrt Source: /feed/openwrt
SourceName: UA3F SourceName: UA3F

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=UA3F PKG_NAME:=UA3F
PKG_VERSION:=0.7.2 PKG_VERSION:=0.7.3
PKG_RELEASE:=1 PKG_RELEASE:=1
# PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz # PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz

View File

@ -3,7 +3,7 @@ local uci = require("luci.model.uci").cursor()
ua3f = Map("ua3f", ua3f = Map("ua3f",
"UA3F", "UA3F",
[[ [[
<a href="https://github.com/SunBK201/UA3F" target="_blank">Version: 0.7.2</a> <a href="https://github.com/SunBK201/UA3F" target="_blank">Version: 0.7.3</a>
<br> <br>
Across the Campus we can reach every corner in the world. Across the Campus we can reach every corner in the world.
]] ]]

View File

@ -18,7 +18,7 @@ import (
"github.com/sunbk201/ua3f/log" "github.com/sunbk201/ua3f/log"
) )
var version = "0.7.2" var version = "0.7.3"
var payload string var payload string
var uaPattern string var uaPattern string
var uaRegexp *regexp2.Regexp var uaRegexp *regexp2.Regexp
@ -349,7 +349,11 @@ func Socks5Forward(client, target net.Conn, destAddrPort string) {
func isHTTP(reader *bufio.Reader) (bool, error) { func isHTTP(reader *bufio.Reader) (bool, error) {
buf, err := reader.Peek(7) buf, err := reader.Peek(7)
if err != nil { 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 return false, err
} }
hint := string(buf) hint := string(buf)