1. 03 Dec, 2015 16 commits
  2. 02 Dec, 2015 17 commits
  3. 01 Dec, 2015 7 commits
    • Russ Cox's avatar
      encoding/base64: add package-level example · e4e49423
      Russ Cox authored
      Fixes #13011.
      
      Change-Id: Ia4c67880fca83f4298ff6bb1b217ec26c8c83427
      Reviewed-on: https://go-review.googlesource.com/17231Reviewed-by: default avatarDavid Crawshaw <crawshaw@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      e4e49423
    • Russ Cox's avatar
      regexp/syntax: fix handling of \Q...\E · 0680e9c0
      Russ Cox authored
      It's not a group: must handle the inside as a sequence of literal chars,
      not a single literal string.
      
      That is, \Qab\E+ is the same as ab+, not (ab)+.
      
      Fixes #11187.
      
      Change-Id: I5406d05ccf7efff3a7f15395bdb0cfb2bd23a8ed
      Reviewed-on: https://go-review.googlesource.com/17233Reviewed-by: default avatarDavid Crawshaw <crawshaw@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      0680e9c0
    • Carlos Cirello's avatar
      net/http/httputil: add package level examples · 5fc58385
      Carlos Cirello authored
      Change-Id: I5be18b68602a7ebb740cf05924236ce17e386e55
      Reviewed-on: https://go-review.googlesource.com/17295
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      5fc58385
    • Russ Cox's avatar
      testing: document that T and B are safe for concurrent calls · e2071ecd
      Russ Cox authored
      Fixes #13108.
      
      Change-Id: I474cc2a3b7ced1c9eb978fc815f9c6bae9fb3ecc
      Reviewed-on: https://go-review.googlesource.com/17235Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      e2071ecd
    • Blake Gentry's avatar
      net/http: retry idempotent HTTP reqs on dead reused conns · 5dd372bd
      Blake Gentry authored
      If we try to reuse a connection that the server is in the process of
      closing, we may end up successfully writing out our request (or a
      portion of our request) only to find a connection error when we try to
      read from (or finish writing to) the socket. This manifests as an EOF
      returned from the Transport's RoundTrip.
      
      The issue, among others, is described in #4677.
      
      This change follows some of the Chromium guidelines for retrying
      idempotent requests only when the connection has been already been used
      successfully and no header data has yet been received for the response.
      
      As part of this change, an unexported error was defined for
      errMissingHost, which was previously defined inline. errMissingHost is
      the only non-network error returned from a Request's Write() method.
      
      Additionally, this breaks TestLinuxSendfile because its test server
      explicitly triggers the type of scenario this change is meant to retry
      on. Because that test server stops accepting conns on the test listener
      before the retry, the test would time out. To fix this, the test was
      altered to use a non-idempotent test type (POST).
      
      Change-Id: I1ca630b944f0ed7ec1d3d46056a50fb959481a16
      Reviewed-on: https://go-review.googlesource.com/3210Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      5dd372bd
    • David Benjamin's avatar
      encoding/asn1: Reject invalid INTEGERs. · 7c20ea93
      David Benjamin authored
      The empty string is not a valid DER integer. DER also requires that values be
      minimally-encoded, so excess padding with leading 0s (0xff for negative
      numbers) is forbidden. (These rules also apply to BER, incidentally.)
      
      Fixes #12622.
      
      Change-Id: I041f94e34a8afa29dbf94dd8fc450944bc91c9c3
      Reviewed-on: https://go-review.googlesource.com/17008Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      7c20ea93
    • Joe Tsai's avatar
      archive/tar: fix issues with readGNUSparseMap1x0 · 7823197e
      Joe Tsai authored
      Motivations:
      * Use of strconv.ParseInt does not properly treat integers as 64bit,
      preventing this function from working properly on 32bit machines.
      * Use of io.ReadFull does not properly detect truncated streams
      when the file suddenly ends on a block boundary.
      * The function blindly trusts user input for numEntries and allocates
      memory accordingly.
      * The function does not validate that numEntries is not negative,
      allowing a malicious sparse file to cause a panic during make.
      
      In general, this function was overly complicated for what it was
      accomplishing and it was hard to reason that it was free from
      bounds errors. Instead, it has been rewritten and relies on
      bytes.Buffer.ReadString to do the main work. So long as invariants
      about the number of '\n' in the buffer are maintained, it is much
      easier to see why this approach is correct.
      
      Change-Id: Ibb12c4126c26e0ea460ea063cd17af68e3cf609e
      Reviewed-on: https://go-review.googlesource.com/15174Reviewed-by: default avatarRuss Cox <rsc@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      7823197e