diff --git a/internal/handler/sendfile.go b/internal/handler/sendfile.go index 22e7914..9f9d08b 100644 --- a/internal/handler/sendfile.go +++ b/internal/handler/sendfile.go @@ -76,4 +76,4 @@ func platformSendfile(conn any, file *os.File, offset, length int64) error { // macOS sendfile 签名复杂,简化使用 fallback // Windows TransmitFile 需要特殊 API return syscall.ENOTSUP -} \ No newline at end of file +} diff --git a/internal/handler/sendfile_linux.go b/internal/handler/sendfile_linux.go index 1b792a7..a4c8d57 100644 --- a/internal/handler/sendfile_linux.go +++ b/internal/handler/sendfile_linux.go @@ -167,4 +167,4 @@ func getSocketFd(conn net.Conn) (uintptr, error) { default: return 0, syscall.ENOTSUP } -} \ No newline at end of file +} diff --git a/internal/middleware/compression/pool_bench_test.go b/internal/middleware/compression/pool_bench_test.go index 374ebe6..dce10ed 100644 --- a/internal/middleware/compression/pool_bench_test.go +++ b/internal/middleware/compression/pool_bench_test.go @@ -149,4 +149,4 @@ func BenchmarkGzipCompress_Sizes(b *testing.B) { } }) } -} \ No newline at end of file +} diff --git a/internal/proxy/cache_key_allocation_test.go b/internal/proxy/cache_key_allocation_test.go index 4db6291..5834c5a 100644 --- a/internal/proxy/cache_key_allocation_test.go +++ b/internal/proxy/cache_key_allocation_test.go @@ -107,4 +107,4 @@ func BenchmarkCacheKeyHash_Compare(b *testing.B) { _, _ = p.buildCacheKeyHash(ctx) } }) -} \ No newline at end of file +} diff --git a/internal/proxy/utils.go b/internal/proxy/utils.go index dbcc4b3..b995f7d 100644 --- a/internal/proxy/utils.go +++ b/internal/proxy/utils.go @@ -34,4 +34,4 @@ func isInWhitelist(key []byte, whitelist map[string]bool) bool { } } return false -} \ No newline at end of file +} diff --git a/internal/server/pool_test.go b/internal/server/pool_test.go index 39996a5..e367c41 100644 --- a/internal/server/pool_test.go +++ b/internal/server/pool_test.go @@ -140,7 +140,6 @@ func TestPoolConcurrentSubmit(t *testing.T) { for range 100 { wg.Go(func() { - _ = p.Submit(nil, func(_ *fasthttp.RequestCtx) { counter.Add(1) }) diff --git a/internal/server/server.go b/internal/server/server.go index 728bb1d..f5f56f3 100644 --- a/internal/server/server.go +++ b/internal/server/server.go @@ -447,7 +447,6 @@ func (s *Server) startSingleMode() error { s.fastServer = s.createFastServer(serverCfg, s.handler) - s.running = true // 创建监听器并保存,用于热升级 @@ -578,7 +577,6 @@ func (s *Server) startVHostMode() error { s.fastServer = s.createFastServer(serverCfg, s.handler) - s.running = true // 创建监听器并保存,用于热升级 @@ -678,7 +676,6 @@ func (s *Server) startMultiServerMode() error { // 创建 fasthttp.Server fastSrv := s.createFastServer(serverCfg, h) - // 检查 SSL 配置 if serverCfg.SSL.Cert != "" && serverCfg.SSL.Key != "" { tlsManager, err := ssl.NewTLSManager(&serverCfg.SSL) diff --git a/internal/stream/ssl.go b/internal/stream/ssl.go index 5e61bdd..98373be 100644 --- a/internal/stream/ssl.go +++ b/internal/stream/ssl.go @@ -131,12 +131,12 @@ func (m *SSLManager) GetTLSConfig() *tls.Config { // 设置协议版本 if len(m.config.Protocols) > 0 { - tlsConfig.MinVersion = sslutil.ParseMinTLSVersion(m.config.Protocols) + tlsConfig.MinVersion = sslutil.ParseMinTLSVersion(m.config.Protocols) } // 设置加密套件 if len(m.config.Ciphers) > 0 { - tlsConfig.CipherSuites = sslutil.ParseCipherSuitesLenient(m.config.Ciphers) + tlsConfig.CipherSuites = sslutil.ParseCipherSuitesLenient(m.config.Ciphers) } // 配置客户端证书验证(mTLS) diff --git a/internal/utils/ipallowlist.go b/internal/utils/ipallowlist.go index 1eb8bf5..a846220 100644 --- a/internal/utils/ipallowlist.go +++ b/internal/utils/ipallowlist.go @@ -90,4 +90,4 @@ func IPInAllowList(ip net.IP, allowList []net.IPNet) bool { } } return false -} \ No newline at end of file +} diff --git a/internal/variable/expand_allocation_test.go b/internal/variable/expand_allocation_test.go index 8acf6cc..93a0ee9 100644 --- a/internal/variable/expand_allocation_test.go +++ b/internal/variable/expand_allocation_test.go @@ -179,4 +179,4 @@ func BenchmarkExpandAllocation_ContextReuse(b *testing.B) { } ReleaseContext(vc) -} \ No newline at end of file +}