Skip to content

Commit

Permalink
Revert "Remove use of deprecated net.Error.Temporary (#1589)" (#1594)
Browse files Browse the repository at this point in the history
This reverts commit ef7392e.

See:
#1589 (comment)

breaks udp serving
  • Loading branch information
miekg authored Aug 13, 2024
1 parent ef7392e commit 39938e9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,9 @@ func (srv *Server) serveTCP(l net.Listener) error {
if !srv.isStarted() {
return nil
}
if neterr, ok := err.(net.Error); ok && neterr.Temporary() {
continue
}
return err
}
srv.lock.Lock()
Expand Down Expand Up @@ -532,6 +535,9 @@ func (srv *Server) serveUDP(l net.PacketConn) error {
if !srv.isStarted() {
return nil
}
if netErr, ok := err.(net.Error); ok && netErr.Temporary() {
continue
}
return err
}
if len(m) < headerSize {
Expand Down

0 comments on commit 39938e9

Please sign in to comment.