mirror of
https://github.com/shizunge/endlessh-go.git
synced 2026-06-23 04:10:08 +00:00
remove unnecessary panic recovery in send goroutine
There is no concrete panic path in the send flow — Write() and SetWriteDeadline() return errors, not panics. The defer/recover was overly defensive and could mask real bugs.
This commit is contained in:
@@ -41,13 +41,6 @@ func startSending(maxClients int64, bannerMaxLength int64, records chan<- metric
|
||||
return
|
||||
}
|
||||
go func() {
|
||||
// Recover from unexpected panics to ensure client cleanup.
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
glog.Errorf("Recovered panic in send goroutine: %v", r)
|
||||
c.Close()
|
||||
}
|
||||
}()
|
||||
bytesSent, err := c.Send(bannerMaxLength)
|
||||
remoteIpAddr := c.RemoteIpAddr()
|
||||
localPort := c.LocalPort()
|
||||
|
||||
Reference in New Issue
Block a user