mirror of
https://github.com/shazow/ssh-chat.git
synced 2025-04-14 16:17:17 +03:00
Only abort on EINVAL from tcp Accept()
This commit is contained in:
parent
973a06aa75
commit
ba1dd64475
@ -7,6 +7,7 @@ import (
|
||||
"regexp"
|
||||
"strings"
|
||||
"sync"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"golang.org/x/crypto/ssh"
|
||||
@ -226,9 +227,11 @@ func (s *Server) Start(laddr string) error {
|
||||
conn, err := socket.Accept()
|
||||
|
||||
if err != nil {
|
||||
// TODO: Handle shutdown more gracefully?
|
||||
logger.Errorf("Failed to accept connection, aborting loop: %v", err)
|
||||
return
|
||||
logger.Errorf("Failed to accept connection: %v", err)
|
||||
if err == syscall.EINVAL {
|
||||
// TODO: Handle shutdown more gracefully?
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// Goroutineify to resume accepting sockets early.
|
||||
|
Loading…
x
Reference in New Issue
Block a user