commit | 1da14a5a36f220ea3f03470682b737b1dfd5de22 | [log] [tgz] |
---|---|---|
author | marius a. eriksen <marius@grailbio.com> | Mon Feb 11 22:33:38 2019 +0000 |
committer | Brad Fitzpatrick <bradfitz@golang.org> | Mon Apr 15 21:45:37 2019 +0000 |
tree | 62aa258baa7e4de4b5b62b55f23ee565a614e342 | |
parent | 4a65cf94b67935be46fbc55ddaea48ae3f7a1471 [diff] |
http2: don't hang a stream if trailers values are not provided Pre-declared trailers are written after a server's request handler returns, in which case the trailer header frame is also responsible for closing the stream. However, if the server handler does not define a trailer header value before returning, the headers are empty and no header frame is written. In this case, the stream would simply hang. This change fixes this by closing the stream if there are no header values but endStream is true. Some other options to consider: 1. Reset the stream with an error; the user didn't define a trailer value as they said they would. From my brief reading of the http/2 RFC, this isn't actually required. 2. Send an explicitly empty header value. Change-Id: I07e01250df60ac33fa6d34beb81ec2fa7e43c146 GitHub-Last-Rev: dfc532d7857822d507b218e4cc2511bf0b6dfcbd GitHub-Pull-Request: golang/net#31 Reviewed-on: https://go-review.googlesource.com/c/net/+/161958 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This repository holds supplementary Go networking libraries.
The easiest way to install is to run go get -u golang.org/x/net
. You can also manually git clone the repository to $GOPATH/src/golang.org/x/net
.
This repository uses Gerrit for code changes. To learn how to submit changes to this repository, see https://golang.org/doc/contribute.html. The main issue tracker for the net repository is located at https://github.com/golang/go/issues. Prefix your issue with “x/net:” in the subject line, so it is easy to find.