Skip to content

Commit

Permalink
net/http: update bundled http2 for ErrAbortHandler support, document …
Browse files Browse the repository at this point in the history
…it more

Updates http2 to x/net/http2 git rev 0e2717d for:

   http2: conditionally log stacks from panics in Server Handlers like net/http
   https://golang.org/cl/33102

Fixes #17790

Change-Id: Idd3f0c65540398d41b412a33f1d80de3f7f31409
Reviewed-on: https://go-review.googlesource.com/33103
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
  • Loading branch information
bradfitz committed Nov 10, 2016
1 parent a501fef commit 0457957
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
3 changes: 0 additions & 3 deletions src/net/http/clientserver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1189,9 +1189,6 @@ func testInterruptWithPanic(t *testing.T, h2 bool, panicValue interface{}) {
if gotLog == "" {
return
}
if h2 {
t.Skip("TODO: make http2.Server respect ErrAbortHandler")
}
t.Fatalf("want no log output; got: %s", gotLog)
}
if gotLog == "" {
Expand Down
16 changes: 11 additions & 5 deletions src/net/http/h2_bundle.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion src/net/http/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ var (
// If ServeHTTP panics, the server (the caller of ServeHTTP) assumes
// that the effect of the panic was isolated to the active request.
// It recovers the panic, logs a stack trace to the server error log,
// and hangs up the connection.
// and hangs up the connection. To abort a handler so the client sees
// an interrupted response but the server doesn't log an error, panic
// with the value ErrAbortHandler.
type Handler interface {
ServeHTTP(ResponseWriter, *Request)
}
Expand Down

0 comments on commit 0457957

Please sign in to comment.