mirror of
https://github.com/Sagit-chu/flvx.git
synced 2026-10-05 17:46:37 +08:00
fix(gost): filter expected net.ErrClosed noise in service handler
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -54,10 +54,10 @@ var needWrap = false
|
|||||||
|
|
||||||
// SetProtocolBlock sets protocol blocking switches and recomputes wrapper need
|
// SetProtocolBlock sets protocol blocking switches and recomputes wrapper need
|
||||||
func SetProtocolBlock(httpOn int, tlsOn int, socksOn int) {
|
func SetProtocolBlock(httpOn int, tlsOn int, socksOn int) {
|
||||||
isHttp = httpOn
|
isHttp = httpOn
|
||||||
isTls = tlsOn
|
isTls = tlsOn
|
||||||
isSocks = socksOn
|
isSocks = socksOn
|
||||||
needWrap = isTls+isSocks+isHttp > 0
|
needWrap = isTls+isSocks+isHttp > 0
|
||||||
}
|
}
|
||||||
|
|
||||||
type Option func(opts *options)
|
type Option func(opts *options)
|
||||||
@@ -292,7 +292,9 @@ func (s *defaultService) Serve() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if err := s.handler.Handle(ctx, conn); err != nil {
|
if err := s.handler.Handle(ctx, conn); err != nil {
|
||||||
log.Error(err)
|
if !errors.Is(err, net.ErrClosed) {
|
||||||
|
log.Error(err)
|
||||||
|
}
|
||||||
if v := xmetrics.GetCounter(xmetrics.MetricServiceHandlerErrorsCounter,
|
if v := xmetrics.GetCounter(xmetrics.MetricServiceHandlerErrorsCounter,
|
||||||
metrics.Labels{"service": s.name, "client": clientIP}); v != nil {
|
metrics.Labels{"service": s.name, "client": clientIP}); v != nil {
|
||||||
v.Inc()
|
v.Inc()
|
||||||
|
|||||||
Reference in New Issue
Block a user