Skip to content

Commit

Permalink
Close mux if there's an error accepting a request
Browse files Browse the repository at this point in the history
  • Loading branch information
dviejokfs committed Apr 4, 2022
1 parent 9f10ce5 commit c048ca5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cmd/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ func (c serverCmd) run() error {
for {
conn, err := ml.Accept()
if err != nil {
_ = muxListener.Close()
delete(sessions, sni)
if strings.Contains(strings.ToLower(err.Error()), "listener closed") {
log.Info().Msg("listener closed")
return
Expand Down

0 comments on commit c048ca5

Please sign in to comment.