Skip to content

Commit

Permalink
cmd/flatend: read http.ErrServerClosed as io.EOF
Browse files Browse the repository at this point in the history
  • Loading branch information
lithdew committed May 11, 2020
1 parent ec4e7c5 commit 428b0fb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/flatend/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"io"
"log"
"net"
"net/http"
"os"
"os/signal"
)
Expand All @@ -15,6 +16,10 @@ func isEOF(err error) bool {
return true
}

if errors.Is(err, http.ErrServerClosed) {
return true
}

var netErr *net.OpError
if errors.As(err, &netErr) && netErr.Err.Error() == "use of closed network connection" {
return true
Expand Down

0 comments on commit 428b0fb

Please sign in to comment.