Skip to content

Commit

Permalink
we return before logging out
Browse files Browse the repository at this point in the history
  • Loading branch information
shade34321 committed Oct 8, 2022
1 parent d148d8c commit 15031b1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions http3/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -575,13 +575,16 @@ func (s *Server) handleRequest(conn quic.Connection, str quic.Stream, decoder *q
var panicked bool
func() {
defer func() {
if p := recover(); p != nil && err != http.ErrAbortHandler {
if p := recover(); p != nil {
panicked = true
if p == http.ErrAbortHandler {
return
}
// Copied from net/http/server.go
const size = 64 << 10
buf := make([]byte, size)
buf = buf[:runtime.Stack(buf, false)]
s.logger.Errorf("http: panic serving: %v\n%s", p, buf)
panicked = true
}
}()
handler.ServeHTTP(r, req)
Expand Down

0 comments on commit 15031b1

Please sign in to comment.