Skip to content

Commit

Permalink
Ignore brutal server error in test
Browse files Browse the repository at this point in the history
  • Loading branch information
nekohasekai committed Nov 8, 2023
1 parent e9cf54c commit 9f87079
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package mux

import (
"context"

Check failure on line 4 in server.go

View workflow job for this annotation

GitHub Actions / Build

File is not `gofumpt`-ed (gofumpt)
"github.com/sagernet/sing/common/debug"

Check failure on line 5 in server.go

View workflow job for this annotation

GitHub Actions / Build

File is not `gci`-ed with --skip-generated -s standard -s prefix(github.com/sagernet/) -s default --custom-order (gci)
"net"

Check failure on line 6 in server.go

View workflow job for this annotation

GitHub Actions / Build

File is not `gofumpt`-ed (gofumpt)

"github.com/sagernet/sing/common/bufio"

Check failure on line 8 in server.go

View workflow job for this annotation

GitHub Actions / Build

File is not `gci`-ed with --skip-generated -s standard -s prefix(github.com/sagernet/) -s default --custom-order (gci)
Expand Down Expand Up @@ -112,11 +113,14 @@ func (s *Service) newConnection(ctx context.Context, sessionConn net.Conn, strea
}
err = SetBrutalOptions(sessionConn, sendBPS)
if err != nil {
err = WriteBrutalResponse(conn, 0, false, E.Cause(err, "enable TCP Brutal").Error())
if err != nil {
return E.Cause(err, "write brutal response")
// ignore error in test
if !debug.Enabled {
err = WriteBrutalResponse(conn, 0, false, E.Cause(err, "enable TCP Brutal").Error())
if err != nil {
return E.Cause(err, "write brutal response")
}
return nil
}
return nil
}
err = WriteBrutalResponse(conn, s.brutal.ReceiveBPS, true, "")
if err != nil {
Expand Down

0 comments on commit 9f87079

Please sign in to comment.