Skip to content

Commit

Permalink
Do not report error to logs when close normally
Browse files Browse the repository at this point in the history
  • Loading branch information
adamwasila committed Jan 14, 2020
1 parent d63d566 commit d289075
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"math/rand"
"net"
"os"
"strings"
"sync"
"time"

Expand Down Expand Up @@ -107,6 +108,9 @@ func (p *Proxy) ListenAndLoop() error {
for {
conn, err := ln.AcceptTCP()
if err != nil {
if strings.Contains(err.Error(), "use of closed network connection") {
return nil
}
return err
}
acceptedTimestamp := time.Now()
Expand Down

0 comments on commit d289075

Please sign in to comment.