Skip to content

Commit

Permalink
Fix accept handler.
Browse files Browse the repository at this point in the history
  • Loading branch information
sbruens committed Jun 14, 2024
1 parent f8d7aa5 commit 1952036
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cmd/outline-ss-server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,12 @@ func (s *SSServer) serve(listener io.Closer, cipherList service.CipherList) erro
tcpHandler := service.NewTCPHandler(authFunc, s.m, tcpReadTimeout)
accept := func() (transport.StreamConn, error) {
conn, err := ln.Accept()
if err == nil {
conn.(*net.TCPConn).SetKeepAlive(true)
if err != nil {
return nil, err
}
return conn.(transport.StreamConn), err
c := conn.(*net.TCPConn)
c.SetKeepAlive(true)
return c, err
}
go service.StreamServe(accept, tcpHandler.Handle)
case net.PacketConn:
Expand Down

0 comments on commit 1952036

Please sign in to comment.