style: fix formatting issues
- Add missing newlines at end of files - Fix indentation in ssl.go - Remove extra blank lines Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
b1e1547e36
commit
d269940d8b
@ -76,4 +76,4 @@ func platformSendfile(conn any, file *os.File, offset, length int64) error {
|
||||
// macOS sendfile 签名复杂,简化使用 fallback
|
||||
// Windows TransmitFile 需要特殊 API
|
||||
return syscall.ENOTSUP
|
||||
}
|
||||
}
|
||||
|
||||
@ -167,4 +167,4 @@ func getSocketFd(conn net.Conn) (uintptr, error) {
|
||||
default:
|
||||
return 0, syscall.ENOTSUP
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -149,4 +149,4 @@ func BenchmarkGzipCompress_Sizes(b *testing.B) {
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -107,4 +107,4 @@ func BenchmarkCacheKeyHash_Compare(b *testing.B) {
|
||||
_, _ = p.buildCacheKeyHash(ctx)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@ -34,4 +34,4 @@ func isInWhitelist(key []byte, whitelist map[string]bool) bool {
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
@ -140,7 +140,6 @@ func TestPoolConcurrentSubmit(t *testing.T) {
|
||||
|
||||
for range 100 {
|
||||
wg.Go(func() {
|
||||
|
||||
_ = p.Submit(nil, func(_ *fasthttp.RequestCtx) {
|
||||
counter.Add(1)
|
||||
})
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -90,4 +90,4 @@ func IPInAllowList(ip net.IP, allowList []net.IPNet) bool {
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
@ -179,4 +179,4 @@ func BenchmarkExpandAllocation_ContextReuse(b *testing.B) {
|
||||
}
|
||||
|
||||
ReleaseContext(vc)
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user