- 20 Mar, 2016 1 commit
-
-
David Symonds authored
cancelCtx has an embedded sync.Mutex. This change causes an extra allocation when creating a new timerCtx via WithDeadline, but that seems minor when compared with better locking discipline. If it turns out to be a problem, the whole cancelCtx struct can be flattened into timerCtx. Addresses part of golang/go#14839. Change-Id: Ie86ed1b63592b521aefde747d5fafcd49ac18178 Reviewed-on: https://go-review.googlesource.com/20840Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
- 15 Mar, 2016 1 commit
-
-
Dave Day authored
Change-Id: Ia61f61d0b9395f383ff622f2d606dcd499f57776 Reviewed-on: https://go-review.googlesource.com/20588Reviewed-by: David Symonds <dsymonds@golang.org>
-
- 10 Mar, 2016 1 commit
-
-
Brad Fitzpatrick authored
It was allocating 64k of garbage per request. benchmark old ns/op new ns/op delta BenchmarkServer_GetRequest-2 234445 236751 +0.98% BenchmarkServer_PostRequest-2 284443 263019 -7.53% benchmark old allocs new allocs delta BenchmarkServer_GetRequest-2 25 25 +0.00% BenchmarkServer_PostRequest-2 31 30 -3.23% benchmark old bytes new bytes delta BenchmarkServer_GetRequest-2 1540 1540 +0.00% BenchmarkServer_PostRequest-2 67658 1800 -97.34% Change-Id: I9deee0ad2fddecd65c82e40782f61da0217735fc Reviewed-on: https://go-review.googlesource.com/20542Reviewed-by: Blake Mizerany <blake.mizerany@gmail.com> Reviewed-by: Andrew Gerrand <adg@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
- 09 Mar, 2016 2 commits
-
-
Sam Whited authored
Specifically state that it is safe to call methods on Conn from multiple goroutines in the docs. Fixes #6692 Change-Id: I1b0e8812ca5b2e3ca72948c5404d569879e54f34 Reviewed-on: https://go-review.googlesource.com/20455Reviewed-by: Andrew Gerrand <adg@golang.org>
-
Mikio Hara authored
Change-Id: I5ab995f50ff43cb88d670f52464d6f0e0f188275 Reviewed-on: https://go-review.googlesource.com/20460Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
- 06 Mar, 2016 1 commit
-
-
Brad Fitzpatrick authored
Change-Id: If36de4de2c4fac6767aa5490e6f3d8c15531dda6 Reviewed-on: https://go-review.googlesource.com/20275Reviewed-by: Dave Day <djd@golang.org>
-
- 05 Mar, 2016 1 commit
-
-
Jacob Hoffman-Andrews authored
Previously this took 20 minutes, now it takes 2-4 seconds. Changes: - Iterate over prefix length, from longest to shortest. - Build a map of prefixes and reuse it to avoid one loop. - When removing simple substrings, sort by length and only consider strings long enough to be worth checking. Saves 600ms out of 800ms. - Removed the option to generate uncrushed table. - Fix an unhandled error in n.walk(w, assignIndexes) Change-Id: I321d2c2bd18f4918479500f3c61d5e59ee173f3d Reviewed-on: https://go-review.googlesource.com/20029Reviewed-by: Nigel Tao <nigeltao@golang.org>
-
- 04 Mar, 2016 1 commit
-
-
Nigel Tao authored
$ cd golang.org/x/net/publicsuffix/ $ go run gen.go -version "publicsuffix.org's public_suffix_list.dat, git revision bade64c (2016-03-01)" -test >table_test.go $ go run gen.go -version "publicsuffix.org's public_suffix_list.dat, git revision bade64c (2016-03-01)" >table.go Change-Id: Ib9ecfdab44dad630510532b08c2d4e54ea94b67a Reviewed-on: https://go-review.googlesource.com/20183Reviewed-by: David Symonds <dsymonds@golang.org>
-
- 25 Feb, 2016 2 commits
-
-
Brad Fitzpatrick authored
Change-Id: Ida47c3feab7bfb0f12bf832953e16d167e6547dd Reviewed-on: https://go-review.googlesource.com/19917Reviewed-by: Andrew Gerrand <adg@golang.org>
-
Brad Fitzpatrick authored
Fixes golang/go#14501 Change-Id: Ibaa7fb1fff404c62c35bb7c63f4a442e4fc0610d Reviewed-on: https://go-review.googlesource.com/19918Reviewed-by: Andrew Gerrand <adg@golang.org>
-
- 23 Feb, 2016 3 commits
-
-
Dmitri Shuralyov authored
I believe it is more idiomatic to use exit code 2 for flag parsing errors and invalid usage cases. It's also not needed to do os.Exit inside usage since flag handling code does it anyway; usage should only print usage text. Change-Id: I0fe2047e3fd01489d32dfb8fde49ce7829439687 Reviewed-on: https://go-review.googlesource.com/19774Reviewed-by: Blake Mizerany <blake.mizerany@gmail.com>
-
Mikio Hara authored
Change-Id: I88b1fac3419f3e655a11cb22050fcd9a9a6c6616 Reviewed-on: https://go-review.googlesource.com/19786Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Brad Fitzpatrick authored
HEADERS and CONTINUATION frames are special in that they must appear contiguous on the wire and there are lots of annoying details to verify while working through its state machine, including the handling of hpack header list size limits and DoS vectors. We now have three implementations of this merging (Server, Transport, and grpc), and grpc's is not complete. The Transport's was also partially incomplete. Move this up to the Framer (opt-in, for compatibility) and remove the support from the Server and Transport. I can fix grpc later to use this. Recommended reviewing order: * hpack.go exports the HeaderField.Size method and adds an IsPseudo method. * errors.go adds some new unexported error types, for testing. * frame.go adds the new type MetaHeadersFrame. * frame.go adds new fields on Framer for controlling how ReadFrame behaves * frame.go Framer.ReadFrame now calls the new Framer.readMetaFrame method * frame_test.go adds a bunch of tests. these are largely redundant with the existing tests which were in server and transport before. They really belong with frame_test.go, but I also don't want to delete tests in a CL like this. I probably won't remove them later either. * server.go and transport.go can be reviewed in either order at this point. Both are the fun part of this change: deleting lots of hairy state machine code (which was redundant in at least 6 ways: server headers, server trailers, client headers, client trailers, grpc headers, grpc trailers...). Both server and transport.go have the general following form: - set Framer.ReadMetaHeaders - stop handling *HeadersFrame and *ContinuationFrame; handle *MetaHeadersFrame instead. - delete all the state machine + hpack parsing callback hell The diffstat numbers look like a wash once you exclude the new tests, but this pays for itself by far when you consider the grpc savings as well, and the increased simplicity. Change-Id: If348cf585165b528b7d3ab2e5f86b49a03fbb0d2 Reviewed-on: https://go-review.googlesource.com/19726Reviewed-by: Blake Mizerany <blake.mizerany@gmail.com> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
-
- 17 Feb, 2016 3 commits
-
-
Mikio Hara authored
Also makes use of encoding/binary package. Change-Id: I0faf7d55bf3340e84b7d7cf1c77ab3886c728a07 Reviewed-on: https://go-review.googlesource.com/19533 Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Mikio Hara authored
Also makes use of encoding/binary package. Change-Id: Id41ea874487f88a3de9fa28b613a77eb66643cc8 Reviewed-on: https://go-review.googlesource.com/19534 Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Mikio Hara authored
Also makes use of encoding/binary package. Change-Id: Ia771290aaccb936fbb7052abaaf96290a9ed4644 Reviewed-on: https://go-review.googlesource.com/19535 Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
- 13 Feb, 2016 1 commit
-
-
Brad Fitzpatrick authored
This old code was buggy: type gzipReader struct { body io.ReadCloser // underlying Response.Body zr io.Reader // lazily-initialized gzip reader } func (gz *gzipReader) Read(p []byte) (n int, err error) { if gz.zr == nil { gz.zr, err = gzip.NewReader(gz.body) if err != nil { return 0, err } } return gz.zr.Read(p) } If a Read on a gzipped Response.Body (of type *http2.gzipReader) resulted in gzip.NewReader returning an error, gzipReader assigned a *gzip.Reader-typed nil value to the gz.zr interface value. On a subsequent Read, gz.zr would not be equal to ==, because it was actually equal to (type *gzip.Reader, nil), and then zr.Read would call (*gzip.Reader).Read with a nil receiver and explode. Debugged internally. (http://go/http2gzipbug) Change-Id: Icba040ace8ffac3536e5e7ade6695c7660838ca1 Reviewed-on: https://go-review.googlesource.com/19483Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
-
- 11 Feb, 2016 1 commit
-
-
Nigel Tao authored
Also add more detail to some code-gen error messages. Change-Id: I776609435d3b27d2fffd48046f98fb0b098451c5 Reviewed-on: https://go-review.googlesource.com/19440Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
- 05 Feb, 2016 2 commits
-
-
Mikio Hara authored
Change-Id: I3798117511b4c9d9033a3b5dbefbae34d7bec639 Reviewed-on: https://go-review.googlesource.com/19244Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Brad Fitzpatrick authored
Accept common things that users might try to do to be helpful (managed by net/http anyway, and previously legal or at best ignored), like Connection: close Connection: keep-alive Transfer-Encoding: chunked But reject all other connection-level headers, per http2 spec. The Google GFE enforces this, so we need to filter these before sending, and give users a better error message for the ones we can't safely filter. That is, reject any connection-level header that we don't know the meaning of. This CL also makes "Connection: close" mean the same as Request.Close, and respects that as well, which was previously ignored in http2. Mostly tests. Updates golang/go#14227 Change-Id: I06e20286f71e8416149588e2c6274a3fce68033b Reviewed-on: https://go-review.googlesource.com/19223Reviewed-by: Andrew Gerrand <adg@golang.org> Reviewed-by: Russ Cox <rsc@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
- 03 Feb, 2016 2 commits
-
-
Brad Fitzpatrick authored
Fixes golang/go#12737 Updates golang/go#14141 Change-Id: I552b603b63a7c87d7fcdb4eb09f96ab9fd0ec0aa Reviewed-on: https://go-review.googlesource.com/19176Reviewed-by: Andrew Gerrand <adg@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Brad Fitzpatrick authored
Updates golang/go#14204 Change-Id: Id2598c77e2677a50988c00adc8751a9b87751202 Reviewed-on: https://go-review.googlesource.com/19159Reviewed-by: Andrew Gerrand <adg@golang.org>
-
- 02 Feb, 2016 1 commit
-
-
Ricardo Padilha authored
Change-Id: I89cb0ac7b7066e557e6f0c2abc2f9edf589017d0 Reviewed-on: https://go-review.googlesource.com/19140 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
- 01 Feb, 2016 2 commits
-
-
Brad Fitzpatrick authored
Prevents a memory leak. Tests (to be updated) in Go standard library. Updates golang/go#14084 Change-Id: I3ff602a013bb8fda7a17bccb31beadb08421ae6a Reviewed-on: https://go-review.googlesource.com/19134Reviewed-by: Blake Mizerany <blake.mizerany@gmail.com> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Brad Fitzpatrick authored
This adds a way for http.Handlers to set trailers after the header has already been flushed. This comment from the code explains: // promoteUndeclaredTrailers permits http.Handlers to set trailers // after the header has already been flushed. Because the Go // ResponseWriter interface has no way to set Trailers (only the // Header), and because we didn't want to expand the ResponseWriter // interface, and because nobody used trailers, and because RFC 2616 // says you SHOULD (but not must) predeclare any trailers in the // header, the official ResponseWriter rules said trailers in Go must // be predeclared, and then we reuse the same ResponseWriter.Header() // map to mean both Headers and Trailers. When it's time to write the // Trailers, we pick out the fields of Headers that were declared as // trailers. That worked for a while, until we found the first major // user of Trailers in the wild: gRPC (using them only over http2), // and gRPC libraries permit setting trailers mid-stream without // predeclarnig them. So: change of plans. We still permit the old // way, but we also permit this hack: if a Header() key begins with // "Trailer:", the suffix of that key is a Trailer. Because ':' is an // invalid token byte anyway, there is no ambiguity. (And it's already // filtered out) It's mildly hacky, but not terrible. The official pre-declaring way still works. Example from net/http docs: https://golang.org/pkg/net/http/#example_ResponseWriter_trailers And ResponseWriter docs explaining it: https://golang.org/pkg/net/http/#ResponseWriter I don't want to add a new interface-assertable upgrade type (like Hijacker or Flusher) for this because it's hurts composability and makes everybody in the ecocsystem implement those, and two optional interfaces is already bad enough. This is a weird enough feature (Trailers by itself is weird enough), that I don't feel like a third optional interface is worth it. This code also filters invalid header fields (updates golang/go#14048), since I had to update that code as part of this. But I want to later return an error back to the user if possible. Or log something. With this CL, all the grpc-go end2end tests pass with a new http2-based Server implementation: https://github.com/bradfitz/grpc-go/commit/a06f8f0593bfa8a0af72e57fb3916144f7b30121 Change-Id: I80f863d05a1810bd6f302f34932ad9df0a6646a6 Reviewed-on: https://go-review.googlesource.com/19131Reviewed-by: Andrew Gerrand <adg@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
- 26 Jan, 2016 3 commits
-
-
Brad Fitzpatrick authored
Leftover from https://golang.org/cl/18932 Change-Id: I41c1adfdebd7dff0f75c2ba2b669f13b163984a2 Reviewed-on: https://go-review.googlesource.com/18936Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Brad Fitzpatrick authored
Recognize connection aborted errors on Windows and don't log them by default, like the Unix case. Log frame reading errors only at verbose level, to match net/http.Server. Updates golang/go#13925 Updates golang/go#14061 Change-Id: I87998a924b11d4dad5512e010b29d2da6b4bf867 Reviewed-on: https://go-review.googlesource.com/18932Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Brad Fitzpatrick authored
Fixes golang/go#14065 Change-Id: Ic19a0f740cddced8fb782f65cea14da383b047b1 Reviewed-on: https://go-review.googlesource.com/18802Reviewed-by: Olivier Poitrey <rs@rhapsodyk.net> Reviewed-by: Daniel Morsing <daniel.morsing@gmail.com> Reviewed-by: Chris Broadfoot <cbro@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
-
- 21 Jan, 2016 1 commit
-
-
Brad Fitzpatrick authored
(addressing review comments from Ralph Corderoy in https://golang.org/cl/18728) Change-Id: I22457a6f768f9136a0e6b84964f0eaf33983c75f Reviewed-on: https://go-review.googlesource.com/18801 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ralph Corderoy <ralph@inputplus.co.uk> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
- 20 Jan, 2016 2 commits
-
-
Brad Fitzpatrick authored
This validates incoming header field values in Server and Transport to make sure the peer isn't sending us a \x00, CR, NL or other non-VCHAR except space and tab. It does not yet validate that we don't send such things, though. Updates golang/go#14029 Change-Id: I7c6a56d5d0d255f1b8fa64480b34b3b5e1f4f367 Reviewed-on: https://go-review.googlesource.com/18727Reviewed-by: Andrew Gerrand <adg@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Brad Fitzpatrick authored
Updates letsencrypt/boulder#1374 Change-Id: I853e08d94cbe235a3a1bbff28e1b121c4589b810 Reviewed-on: https://go-review.googlesource.com/18724Reviewed-by: Andrew Gerrand <adg@golang.org>
-
- 19 Jan, 2016 2 commits
-
-
Brad Fitzpatrick authored
Forgot to git mail after https://golang.org/cl/18721 Change-Id: Ie5e2ad91e7580d5283b19b68491fd10978fa2488 Reviewed-on: https://go-review.googlesource.com/18722 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Andrew Gerrand <adg@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Brad Fitzpatrick authored
The http2 Transport now respects the http1 Transport's DisableCompression, DisableKeepAlives, and ResponseHeaderTimeout, if the http2 and http1 Transports are wired up together, as they are in the upcoming Go 1.6. Updates golang/go#14008 Change-Id: I2f477f6fe5dbef9d0e5439dfc7f3ec2c0da7f296 Reviewed-on: https://go-review.googlesource.com/18721Reviewed-by: Andrew Gerrand <adg@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
- 18 Jan, 2016 1 commit
-
-
Brad Fitzpatrick authored
Same policy and logic (and comments) as the net/http.Transport. Updates golang/go#14003 Change-Id: I5744140fed16c00b0dc9a4bc74631b7df7d8241c Reviewed-on: https://go-review.googlesource.com/18709Reviewed-by: Andrew Gerrand <adg@golang.org>
-
- 16 Jan, 2016 1 commit
-
-
Brad Fitzpatrick authored
This is needed so another CL in the main repo can keep the pointer around to pass through Transport.CloseIdleConnections from the http1 transport. This CL doesn't modify the exported ConfigureTransport signature. We'll use the private one in the standard library for now. (since it gets bundled into the same package) Updates golang/go#13975 Change-Id: I824e9ac4a44616c8c2a480f83bd3dc62bffc30e4 Reviewed-on: https://go-review.googlesource.com/18678Reviewed-by: Andrew Gerrand <adg@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
- 15 Jan, 2016 2 commits
-
-
Brad Fitzpatrick authored
If a user starts two HTTP requests when no http2 connection is available, both end up creating new TCP connections, since the server's protocol (h1 or h2) isn't yet known. Once it turns out that the server supports h2, one of the connections is useless. Previously we kept upgrading both TLS connections to h2 (SETTINGS frame exchange, etc). Now the unnecessary connections are closed instead, before the h2 preface/SETTINGS. Tests in the standard library (where it's easier to test), in the commit which updates h2_bundle.go with this change. Updates golang/go#13957 Change-Id: I5af177e6ea755d572b551cc0b0de9da865ef4ae7 Reviewed-on: https://go-review.googlesource.com/18675Reviewed-by: Andrew Gerrand <adg@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Nigel Tao authored
Change-Id: I327897f8fa06e4f65dbd32b81be80fdc438bc6e0 Reviewed-on: https://go-review.googlesource.com/18656Reviewed-by: David Symonds <dsymonds@golang.org>
-
- 13 Jan, 2016 3 commits
-
-
Brad Fitzpatrick authored
I can't reproduce the user's bug yet, but this might fix or at least help clarify what's happening. Also deflakes a test. Updates golang/go#13932 Change-Id: If56bdd833f183d4502701e65e56749434bd82150 Reviewed-on: https://go-review.googlesource.com/18576Reviewed-by: Andrew Gerrand <adg@golang.org>
-
Brad Fitzpatrick authored
plan9's network deadline & cancelation code is so brittle that it's not even worth testing this package there. It only results in 10 minute deadlocks and slows down the trybots which should be ~30 seconds, not 10 minutes. Change-Id: I097a885ae5887f0ecf357611aa7fae8885e18e05 Reviewed-on: https://go-review.googlesource.com/18578Reviewed-by: Chris Broadfoot <cbro@golang.org>
-
Brad Fitzpatrick authored
They lack terminal.MakeRaw and terminal.Restore. Updates golang/go#11811 Change-Id: I1e5d8ca90b2f9c13fe7a6396c2f86e0a5b392b84 Reviewed-on: https://go-review.googlesource.com/18577 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Chris Broadfoot <cbro@golang.org>
-