1. 31 Mar, 2016 3 commits
  2. 28 Mar, 2016 5 commits
  3. 25 Mar, 2016 1 commit
  4. 24 Mar, 2016 1 commit
  5. 22 Mar, 2016 2 commits
  6. 21 Mar, 2016 1 commit
  7. 20 Mar, 2016 1 commit
  8. 15 Mar, 2016 1 commit
  9. 10 Mar, 2016 1 commit
  10. 09 Mar, 2016 2 commits
  11. 06 Mar, 2016 1 commit
  12. 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
  13. 04 Mar, 2016 1 commit
  14. 25 Feb, 2016 2 commits
  15. 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
  16. 17 Feb, 2016 3 commits
  17. 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
  18. 11 Feb, 2016 1 commit
  19. 05 Feb, 2016 2 commits
  20. 03 Feb, 2016 2 commits
  21. 02 Feb, 2016 1 commit
  22. 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
  23. 26 Jan, 2016 2 commits