fix: early exit on Accept() error

This commit is contained in:
wpetit 2020-10-21 19:48:12 +02:00
parent c4ed26526e
commit 424e985c2b
1 changed files with 2 additions and 0 deletions

View File

@ -42,6 +42,8 @@ func (s *Server) handleNewConn(ctx context.Context, conn *kcp.UDPSession) {
if err := remoteClient.Accept(ctx, conn); err != nil { if err := remoteClient.Accept(ctx, conn); err != nil {
logger.Error(ctx, "remote client error", logger.E(err)) logger.Error(ctx, "remote client error", logger.E(err))
return
} }
if err := remoteClient.Listen(ctx); err != nil { if err := remoteClient.Listen(ctx); err != nil {