- 01 Dec, 2015 12 commits
-
-
Russ Cox authored
Fixes #13108. Change-Id: I474cc2a3b7ced1c9eb978fc815f9c6bae9fb3ecc Reviewed-on: https://go-review.googlesource.com/17235Reviewed-by:
Ian Lance Taylor <iant@golang.org>
-
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:
Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
-
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:
Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
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:
Russ Cox <rsc@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Joe Tsai authored
Certain special type-flags, specifically 1, 2, 3, 4, 5, 6, do not have a data section. Thus, regardless of what the size field says, we should not attempt to read any data for these special types. The relevant PAX and USTAR specification says: <<< If the typeflag field is set to specify a file to be of type 1 (a link) or 2 (a symbolic link), the size field shall be specified as zero. If the typeflag field is set to specify a file of type 5 (directory), the size field shall be interpreted as described under the definition of that record type. No data logical records are stored for types 1, 2, or 5. If the typeflag field is set to 3 (character special file), 4 (block special file), or 6 (FIFO), the meaning of the size field is unspecified by this volume of POSIX.1-2008, and no data logical records shall be stored on the medium. Additionally, for type 6, the size field shall be ignored when reading. If the typeflag field is set to any other value, the number of logical records written following the header shall be (size+511)/512, ignoring any fraction in the result of the division. >>> Contrary to the specification, we do not assert that the size field is zero for type 1 and 2 since we liberally accept non-conforming formats. Change-Id: I666b601597cb9d7a50caa081813d90ca9cfc52ed Reviewed-on: https://go-review.googlesource.com/16614Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Russ Cox authored
Or at least make them true. Fixes #12237. Change-Id: I3c92a07233b2174c5731d6fa7fbb9ca3a97beb6b Reviewed-on: https://go-review.googlesource.com/17237Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
Colin Cross authored
Implement setting the compression level for a zip archive by registering a per-Writer compressor through Writer.RegisterCompressor. If no compressors are registered, fall back to the ones registered at the package level. Also implements per-Reader decompressors. Fixes #8359 Change-Id: I93b27c81947b0f817b42e0067aa610ff267fdb21 Reviewed-on: https://go-review.googlesource.com/16669Reviewed-by:
Joe Tsai <joetsai@digital-static.net> Run-TryBot: Joe Tsai <joetsai@digital-static.net> Reviewed-by:
Klaus Post <klauspost@gmail.com> Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
Aleksandr Demakin authored
Use sync.Once to ensure, that 'offsets' field is initialized once only in a threadsafe way. Fixes #12887 Change-Id: I90ef929c421ccd3094339c67a39b02d8f2e47211 Reviewed-on: https://go-review.googlesource.com/16013Reviewed-by:
Robert Griesemer <gri@golang.org>
-
Brad Fitzpatrick authored
A Content-Type always has a slash (type/subtype) A Content-Disposition does not (e.g. "attachment" or "line"). A "media type" is either one of those, plus optional parameters afterwards. Our ParseMediaType and FormatMediaType weren't consistent in whether they permitted Content-Dispositions. Now they both do. Fixes #11289 Change-Id: Ia75723c9d7adb7f4de0f65482780f823cdadb5bd Reviewed-on: https://go-review.googlesource.com/17135Reviewed-by:
Russ Cox <rsc@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Brad Fitzpatrick authored
Fix an old bug where media type parameter values could be escaped by either double quotes (per the spec) or single quotes (due to my bug). The original bug was introduced by me in git rev 90e4ece3 (https://golang.org/cl/4430049) in April 2011 when adding more tests from http://greenbytes.de/tech/tc2231/ and misinterpreting the expected value of test "attwithfntokensq" and not apparently thinking about it enough. No known spec or existing software produces or expects single quotes around values. In fact, it would have be a parsing ambiguity if it were allowed: the string `a=', b='` could parse as two keys "a" and "b" both with value "'", or it could be parse as a single key "a" with value "', b=". Fixes #11291 Change-Id: I6de58009dd47dcabb120b017245d237cb7b1e89a Reviewed-on: https://go-review.googlesource.com/17136Reviewed-by:
Russ Cox <rsc@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Marcel van Lohuizen authored
Check that it now properly handles \xC0 and \xC1. Fixes #11733. Change-Id: I66cfe0d43f9d123d4c4509a3fa18b9b6380dfc39 Reviewed-on: https://go-review.googlesource.com/17225Reviewed-by:
Russ Cox <rsc@golang.org>
-
Michael Hudson-Doyle authored
The ppc64le shared library ABI demands that r12 is set to a function's global entrypoint before jumping to the global entrypoint. Not doing so means that handling signals that usually panic actually crashes (and so, e.g. can't be recovered). Fixes several failures of "cd test; go run run.go -linkshared". Change-Id: Ia4d0da4c13efda68340d38c045a52b37c2f90796 Reviewed-on: https://go-review.googlesource.com/17280Reviewed-by:
Ian Lance Taylor <iant@golang.org>
-
- 30 Nov, 2015 7 commits
-
-
Robert Griesemer authored
Fixes #13420. Change-Id: Id64ebd0527881450fdaffbb66d8b1831a6b7c43c Reviewed-on: https://go-review.googlesource.com/17263Reviewed-by:
Rob Pike <r@golang.org>
-
Robert Griesemer authored
Old parser remains. Change-Id: I05ef1737802e23afc2c2129f58cb66feef8e3425 Reviewed-on: https://go-review.googlesource.com/17244Reviewed-by:
David Crawshaw <crawshaw@golang.org>
-
Robert Griesemer authored
Fixes #13245. Change-Id: I87be63cc7b27f70ca2f9fb6bc9908b9061fe3d9d Reviewed-on: https://go-review.googlesource.com/17203Reviewed-by:
Chris Manghane <cmang@golang.org>
-
Brad Fitzpatrick authored
Updates to x/net rev 195180cf (golang.org/cl/17134, http2: merge duplicate Transport dials) Change-Id: I50b9c73b30c6a21e725aad80126b713d8b0fa362 Reviewed-on: https://go-review.googlesource.com/17261Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Burcu Dogan authored
Fixes #13421. Change-Id: Ic0fc0d0a8e86d2be23db12ddd1a8a8105e26ee56 Reviewed-on: https://go-review.googlesource.com/17250Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Burcu Dogan <jbd@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Carlos C authored
Change-Id: Ica0cf1ba01ba73bd7e2fe38d653503738a962720 Reviewed-on: https://go-review.googlesource.com/13450Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Carlos C authored
Change-Id: Id72cf4daceb7669cf9c7247df8e3ba086ccfe96e Reviewed-on: https://go-review.googlesource.com/12730Reviewed-by:
Russ Cox <rsc@golang.org>
-
- 29 Nov, 2015 3 commits
-
-
Mikio Hara authored
Change-Id: Ibc55e98c43cebe5a21ab3b280489e1bce6405b8b Reviewed-on: https://go-review.googlesource.com/17218Reviewed-by:
Alex Brainman <alex.brainman@gmail.com>
-
Ian Lance Taylor authored
This is the 386 version of the amd64-specific https://golang.org/cl/16933. Update #12416. Change-Id: Ibc3a99dcc753d6281839d8b61016d6c21dbd9649 Reviewed-on: https://go-review.googlesource.com/16970 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Russ Cox <rsc@golang.org>
-
Ian Lance Taylor authored
This makes it more convenient for C code to use GoString with string constants. Since Go string values are immutable, the const qualifier is appropriate in C. Change-Id: I5fb3cdce2ce5079f1f0467a1544bb3a1eb27b811 Reviewed-on: https://go-review.googlesource.com/17067 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Russ Cox <rsc@golang.org>
-
- 28 Nov, 2015 5 commits
-
-
Mikio Hara authored
The builtin name resolver using various resolution techniques is a bit complicated and we sometimes fotget to take care of all the go and cgo code paths and exchanging information to local and remote sources. This change makes LookupAddr return absolute domain names even in the case of local source. Updates #12189. Fixes #12240. Change-Id: Icdd3375bcddc7f5d4d3b24f134d93815073736fc Reviewed-on: https://go-review.googlesource.com/17216Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
Shenghou Ma authored
Fixes #13419. Change-Id: I530d0b714ea0743c72eacd07b390c3f8cc556e21 Reviewed-on: https://go-review.googlesource.com/17239Reviewed-by:
Robert Griesemer <gri@golang.org>
-
Robert Griesemer authored
Follow-up cleanup for https://go-review.googlesource.com/17248: Use properly typed local variable op now that that variable use is not overloaded anymore. Also: Remove unnecessary if stmt from common lexical path. Change-Id: I984b0b346f3fdccd5aedc937330c0a5f99acf324 Reviewed-on: https://go-review.googlesource.com/17249Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
Robert Griesemer authored
- use same local variable name (lno) for line number for LCOLAS everywhere - remove now unneeded assignment of line number to yylval.i in lexer Fix per suggestion of mdempsky. Fixes #13415. Change-Id: Ie3c7f5681615042a12b81b26724b3a5d8a979c25 Reviewed-on: https://go-review.googlesource.com/17248 Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
Adam Langley authored
Some software that produces certificates doesn't encode integers correctly and, about half the time, ends up producing certificates with serial numbers that are actually negative. This buggy software, sadly, appears to be common enough that we should let these errors pass. This change allows a Certificate.SerialNumber to be negative. Fixes #8265. Change-Id: Ief35dae23988fb6d5e2873e3c521366fb03c6af4 Reviewed-on: https://go-review.googlesource.com/17247Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
- 27 Nov, 2015 2 commits
-
-
Mikio Hara authored
The previous change for #12806 modified internal lookup tables and made LookupAddr return forcibly lowercased host names by accident. This change fixes the issue again without any behavioral change for LookupAddr and adds missing test cases for lookupStaticHost and lookupStaticAddr. Updates #12806. Fixes #13359. Change-Id: Ifff4741cd79eb8b320b1b0f8c5e02b3a167c9fa8 Reviewed-on: https://go-review.googlesource.com/17217 Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
Shenghou Ma authored
Usually, you are primarily interested to see the coverage of a particular file (e.g. when you're changing tests that affects a given source file), it is very valuable if you can just refresh the page and immediately see changes to the part you're already looking at (without selecting from the selector again.) Change-Id: I615207c9be6713f436e444771134fceaf4600ff3 Reviewed-on: https://go-review.googlesource.com/17238 Run-TryBot: Minux Ma <minux@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Andrew Gerrand <adg@golang.org>
-
- 26 Nov, 2015 8 commits
-
-
Tamir Duberstein authored
Places a fixed size initial stack and the lval inside the parser struct so that they are allocated together. Places $$char inside the parser struct to avoid allocating the closure used in Lookahead(). Change-Id: I0de664a6d612279fdc3255633e2dff904030bc36 Reviewed-on: https://go-review.googlesource.com/16705Reviewed-by:
Russ Cox <rsc@golang.org>
-
Ralph Corderoy authored
During the TLS handshake, check the cipher suite the server selects is one of those offered in the ClientHello. The code was checking it was in the larger list that was sometimes whittled down for the ClientHello. Fixes #13174 Change-Id: Iad8eebbcfa5027f30403b9700c43cfa949e135bb Reviewed-on: https://go-review.googlesource.com/16698Reviewed-by:
Adam Langley <agl@golang.org> Run-TryBot: Adam Langley <agl@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Russ Cox <rsc@golang.org>
-
Joe Tsai authored
Functions with switches (#13071) cannot be inlined. Functions with consts (#7655) cannot be inlined. benchmark old MB/s new MB/s speedup BenchmarkEncodeDigitsSpeed1e4-4 10.25 10.20 1.00x BenchmarkEncodeDigitsSpeed1e5-4 26.44 27.22 1.03x BenchmarkEncodeDigitsSpeed1e6-4 32.28 33.51 1.04x BenchmarkEncodeDigitsDefault1e4-4 8.61 8.74 1.02x BenchmarkEncodeDigitsDefault1e5-4 7.03 6.98 0.99x BenchmarkEncodeDigitsDefault1e6-4 6.47 6.46 1.00x BenchmarkEncodeDigitsCompress1e4-4 8.62 8.73 1.01x BenchmarkEncodeDigitsCompress1e5-4 7.01 6.98 1.00x BenchmarkEncodeDigitsCompress1e6-4 6.43 6.53 1.02x BenchmarkEncodeTwainSpeed1e4-4 9.67 10.16 1.05x BenchmarkEncodeTwainSpeed1e5-4 26.46 26.94 1.02x BenchmarkEncodeTwainSpeed1e6-4 33.19 34.02 1.03x BenchmarkEncodeTwainDefault1e4-4 8.12 8.37 1.03x BenchmarkEncodeTwainDefault1e5-4 8.22 8.21 1.00x BenchmarkEncodeTwainDefault1e6-4 8.10 8.13 1.00x BenchmarkEncodeTwainCompress1e4-4 8.24 8.39 1.02x BenchmarkEncodeTwainCompress1e5-4 6.51 6.58 1.01x BenchmarkEncodeTwainCompress1e6-4 6.16 6.13 1.00x Change-Id: Ibafa5e3e2de0529853b5b3180e6fd6cb7090b76f Reviewed-on: https://go-review.googlesource.com/17171Reviewed-by:
Russ Cox <rsc@golang.org>
-
Brad Fitzpatrick authored
And updates h2_bundle.go with the fix from x/net/http2. Fixes #13298 Updates #6891 Change-Id: Ia25f22fa10e2a64b9d59211269882681aa18c101 Reviewed-on: https://go-review.googlesource.com/17241 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by:
Andrew Gerrand <adg@golang.org>
-
Robert Griesemer authored
Slightly modified an example. Fixes #13371. Change-Id: I25d260d4200086a0ef9725950132b760657610c5 Reviewed-on: https://go-review.googlesource.com/17209Reviewed-by:
Rob Pike <r@golang.org>
-
Didier Spezia authored
When the source directory path contains spaces, cgo directives cannot be properly validated: $ pwd /root/src/issue 11868 $ cat main.go package main //#cgo CFLAGS: -I${SRCDIR}/../../include import "C" func main() { } $ go build can't load package: package issue 11868: /root/src/issue 11868/main.go: malformed #cgo argument: -I/root/src/issue 11868/../../include Make sure spaces are tolerated in ${SRCDIR} when this variable is expanded. This applies to ${SRCDIR} only. Shell safety checks are still done in the same exact way for anything else. Fixes #11868 Change-Id: I93d1d2b5ab167caa7ae353fe46fb8f69f1f06969 Reviewed-on: https://go-review.googlesource.com/16302Reviewed-by:
Russ Cox <rsc@golang.org>
-
Dmitry Vyukov authored
Factor out duplicated race thunks from sync, syscall net and fmt packages into a separate package and use it. Fixes #8593 Change-Id: I156869c50946277809f6b509463752e7f7d28cdb Reviewed-on: https://go-review.googlesource.com/14870Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Dmitry Vyukov <dvyukov@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
sergey.arseev authored
Transactional memory, will later be used for semaphore implementation. Nacl not supported yet. Change-Id: Ic18453dcaa08d07bb217c0b95461584f007d518b Reviewed-on: https://go-review.googlesource.com/16479Reviewed-by:
Russ Cox <rsc@golang.org>
-
- 25 Nov, 2015 3 commits
-
-
Michael Hudson-Doyle authored
The kernel rejects attempts to create user namespaces when in a chroot. Change-Id: I6548302732c8f5be52f4167cd7233aea16839ad8 Reviewed-on: https://go-review.googlesource.com/17214Reviewed-by:
Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Matthew Dempsky authored
Updates #13402. Change-Id: Ia7b729d81fb78206d214444911f2e6573b88717a Reviewed-on: https://go-review.googlesource.com/17240Reviewed-by:
Ian Lance Taylor <iant@golang.org>
-
Matthew Dempsky authored
This also fixes an unintended behavior where C's "complex float" and "complex double" types were interchangeable with Go's "complex64" and "complex128" types. Fixes #13402. Change-Id: I73f96d9a4772088d495073783c6982e9634430e8 Reviewed-on: https://go-review.googlesource.com/17208Reviewed-by:
Ian Lance Taylor <iant@golang.org>
-