1. 24 Mar, 2016 1 commit
  2. 22 Mar, 2016 2 commits
  3. 21 Mar, 2016 1 commit
  4. 20 Mar, 2016 1 commit
  5. 15 Mar, 2016 1 commit
  6. 10 Mar, 2016 1 commit
  7. 09 Mar, 2016 2 commits
  8. 06 Mar, 2016 1 commit
  9. 05 Mar, 2016 1 commit
    • Jacob Hoffman-Andrews's avatar
      publicsuffix: Make gen.go faster. · 08f168e5
      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: 's avatarNigel Tao <nigeltao@golang.org>
      08f168e5
  10. 04 Mar, 2016 1 commit
  11. 25 Feb, 2016 2 commits
  12. 23 Feb, 2016 3 commits
    • Dmitri Shuralyov's avatar
      http2/h2i: Handle invalid usage more idiomatically. · 4599ae79
      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: 's avatarBlake Mizerany <blake.mizerany@gmail.com>
      4599ae79
    • Mikio Hara's avatar
      internal/iana: update protocol numbers · 0899459b
      Mikio Hara authored
      Change-Id: I88b1fac3419f3e655a11cb22050fcd9a9a6c6616
      Reviewed-on: https://go-review.googlesource.com/19786Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
      0899459b
    • Brad Fitzpatrick's avatar
      http2: move merging of HEADERS and CONTINUATION into Framer · 9e1fb3c1
      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: 's avatarBlake Mizerany <blake.mizerany@gmail.com>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      9e1fb3c1
  13. 17 Feb, 2016 3 commits
  14. 13 Feb, 2016 1 commit
    • Brad Fitzpatrick's avatar
      http2: fix crash in Transport on double Read of invalid gzip Response.Body · cbbbe2bc
      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: 's avatarIan Lance Taylor <iant@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      cbbbe2bc
  15. 11 Feb, 2016 1 commit
  16. 05 Feb, 2016 2 commits
  17. 03 Feb, 2016 2 commits
  18. 02 Feb, 2016 1 commit
  19. 01 Feb, 2016 2 commits
    • Brad Fitzpatrick's avatar
      http2: don't add *Response to activeRes in Transport on Headers.END_STREA · 644ffc06
      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: 's avatarBlake Mizerany <blake.mizerany@gmail.com>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      644ffc06
    • Brad Fitzpatrick's avatar
      http2: add mechanism to send undeclared Trailers mid handler · d513e585
      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: 's avatarAndrew Gerrand <adg@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      d513e585
  20. 26 Jan, 2016 3 commits
  21. 21 Jan, 2016 1 commit
  22. 20 Jan, 2016 2 commits
  23. 19 Jan, 2016 2 commits
  24. 18 Jan, 2016 1 commit
  25. 16 Jan, 2016 1 commit
  26. 15 Jan, 2016 1 commit
    • Brad Fitzpatrick's avatar
      http2: make Transport close unneeded connections after h1->h2 upgrade · a8e212f3
      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: 's avatarAndrew Gerrand <adg@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      a8e212f3