- 17 Dec, 2015 12 commits
-
-
Russ Cox authored
Fixes #12910. Change-Id: If446e5dce236483bbb898cc5959baf8371f05142 Reviewed-on: https://go-review.googlesource.com/17550Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Adam Langley <agl@golang.org>
-
Russ Cox authored
Thanks to Albert Hafvenström for the diagnosis. Fixes #11246. Change-Id: I2b9e670c0ecf6aa01e5bf4d7a402619e93cc4f4a Reviewed-on: https://go-review.googlesource.com/17942Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Russ Cox authored
If cgo is turned off, there may not be an external linker available. Fixes #13450. Change-Id: Idbf3f3f57b4bb3908b67264f96d276acc952102a Reviewed-on: https://go-review.googlesource.com/17941Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Russ Cox authored
Maybe it will say something that helps the user understand the problem. Note that we can't use os/exec.ExitError's new Stderr field because cmd/dist is compiled with Go 1.4. Fixes #13099. Change-Id: I4b5910434bf324d1b85107002a64684d8ba14dc8 Reviewed-on: https://go-review.googlesource.com/17940Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Ian Lance Taylor authored
This uses weak declarations so that it will work with current versions of gccgo that do not support pointer checking. Change-Id: Ia34507e3231ac60517cb6834f0b673764715a256 Reviewed-on: https://go-review.googlesource.com/17429 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
-
Joe Tsai authored
Change-Id: Ice85d161f026a991953bd63ecc6ec80f8d06dfbd Reviewed-on: https://go-review.googlesource.com/17901 Run-TryBot: Joe Tsai <joetsai@digital-static.net> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Brad Fitzpatrick authored
I updated this in the previous commit (https://golang.org/cl/17931) but noticed a typo. and it still wasn't great. The Go 1.5 text was too brief to know how to use it: // Trailer maps trailer keys to values, in the same // format as the header. Change-Id: I33c49b6a4a7a3596735a4cc7865ad625809da900 Reviewed-on: https://go-review.googlesource.com/17932Reviewed-by: Russ Cox <rsc@golang.org>
-
Russ Cox authored
The new flag -args stops flag processing, leaving the rest of the command line to be passed to the underlying test binary verbatim. Thus, both of these pass a literal -v -n on the test binary command line, without putting the go command into verbose mode or disabling execution of commands: go test . -args -v -n go test -args -v -n Also try to make the documentation a bit clearer. Fixes #7221. Fixes #12177. Change-Id: Ief9e830a6fbb9475d96011716a86e2524a35eceb Reviewed-on: https://go-review.googlesource.com/17775Reviewed-by: Rob Pike <r@golang.org>
-
Russ Cox authored
No longer needed - the change to 'go test' was rolled back. This reverts commit 2c96e5d2. Change-Id: Ibe9c5f48e3e4cbbbde2f5c8c516b2987ebba55ae Reviewed-on: https://go-review.googlesource.com/17776Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Minux Ma <minux@golang.org>
-
Russ Cox authored
Fixes build. Change-Id: Ia71fc031cc8eb575e5ab5323ff4084147d143744 Reviewed-on: https://go-review.googlesource.com/17867Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Brad Fitzpatrick authored
This CL updates the bundled copy of x/net/http2 to include https://golang.org/cl/17930 and enables the previously-skipped tests TestTrailersServerToClient_h2 and TestTrailersServerToClient_Flush_h2. It also updates the docs on http.Response.Trailer to describe how to use it. No change in rules. Just documenting the old unwritten rules. (there were tests locking in the behavior, and misc docs and examples scattered about, but not on http.Response.Trailer itself) Updates #13557 Change-Id: I6261d439f6c0d17654a1a7928790e8ffed16df6c Reviewed-on: https://go-review.googlesource.com/17931 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Blake Mizerany <blake.mizerany@gmail.com>
-
Adam Langley authored
This change adds a check after computing an RSA signature that the signature is correct. This prevents an error in the CRT computation from leaking the private key. See references in the linked bug. benchmark old ns/op new ns/op delta BenchmarkRSA2048Sign-3 5713305 6225215 +8.96% Fixes #12453 Change-Id: I1f24e0b542f7c9a3f7e7ad4e971db3dc440ed3c1 Reviewed-on: https://go-review.googlesource.com/17862Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
-
- 16 Dec, 2015 23 commits
-
-
Alex Brainman authored
CL 17821 used syscall.CancelIoEx to cancel outstanding connect call, but did not check for syscall.CancelIoEx return value. Also I am worried about introducing race here. We should use proper tools available for us instead. For example, we could use fd.setWriteDeadline just like unix version does. Do that. Change-Id: Idb9a03c8c249278ce3e2a4c49cc32445d4c7b065 Reviewed-on: https://go-review.googlesource.com/17920Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
-
Shenghou Ma authored
Fixes #13635. Change-Id: Icab4a45567f435f002a8f6c85db9538acf054a70 Reviewed-on: https://go-review.googlesource.com/17863 Run-TryBot: Minux Ma <minux@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Brad Fitzpatrick authored
Updates to x/net/http2 git rev c24de9d5 Change-Id: I3d929ae38dca1a93e9a262d4eaaafee1d36fa839 Reviewed-on: https://go-review.googlesource.com/17896Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
-
Russ Cox authored
Fixes #12411. Change-Id: I2202a754c7750e3b2119e3744362c98ca0d2433e Reviewed-on: https://go-review.googlesource.com/17818Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Russ Cox authored
Fixes #11737. Change-Id: Id231b502ac5a44035dc3a02515b43bf665cb1e87 Reviewed-on: https://go-review.googlesource.com/17816Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Russ Cox authored
Fixes #12677. Change-Id: I72012f55615fcf5f4a16c054706c9bcd82e49ccd Reviewed-on: https://go-review.googlesource.com/17817Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Russ Cox authored
This broke a number of common "go test" invocations. Will fix the original concern differently. This reverts commit 6acb4d94. Fixes #13583. Change-Id: If582b81061df28173c698bed1d7d8283b0713cae Reviewed-on: https://go-review.googlesource.com/17773Reviewed-by: Rob Pike <r@golang.org>
-
Brad Fitzpatrick authored
The old test was in client_test.go but was a mix of four things: - clients writing trailers - servers reading trailers - servers writing trailers - clients reading trailers It definitely wasn't just about clients. This moves it into clientserver_test.go and separates it into two halves: - servers writing trailers + clients reading trailers - clients writing trailers + servers reading trailers Which still isn't ideal, but is much better, and easier to read. Updates #13557 Change-Id: I8c3e58a1f974c1b10bb11ef9b588cfa0f73ff5d9 Reviewed-on: https://go-review.googlesource.com/17895 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Blake Mizerany <blake.mizerany@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Russ Cox authored
Also fix bug reported in CL 17510. Found during fix of #13515 in CL 17672, but separate from the fix. Change-Id: I4b1024569a98f5cfd2ebb442ec3d64356164d284 Reviewed-on: https://go-review.googlesource.com/17673Reviewed-by: Robert Griesemer <gri@golang.org>
-
Russ Cox authored
I've already turned away one attempt to remove this field. As the comment above the struct says, many tools know the layout. The field cannot simply be removed. It was one thing to remove the fields name, but the TODO should not have been added. Change-Id: If40eacf0eb35835082055e129e2b88333a0731b9 Reviewed-on: https://go-review.googlesource.com/17741Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Russ Cox authored
Change-Id: I65084e518c735f1e50d191a612cd32533b241685 Reviewed-on: https://go-review.googlesource.com/17742Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Russ Cox authored
This fix, plus a one-line change to golang.org/x/tools/go/loader, is sufficient to let that loader package process source code using vendored packages. For example, GOPATH="" ssadump net/http # uses vendored http2 used to fail, not able to find net/http's import of the vendored copy of golang.org/x/net/http2/hpack. This CL plus the fix to loader (CL 17727) suffices to get ssadump working, as well as - I expect - most other source code processing built on golang.org/x/tools/go/loader. Fixes #12278. Change-Id: I83715e757419171159f67d49bb453636afdd91f0 Reviewed-on: https://go-review.googlesource.com/17726Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Russ Cox authored
Change-Id: I5aa54e96729b3261f491f51b37e04e59c91b0830 Reviewed-on: https://go-review.googlesource.com/17840Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Rob Pike <r@golang.org>
-
Brad Fitzpatrick authored
Fixes #11206 (that we accept invalid bytes) Fixes #13624 (that we don't require a Host header in HTTP/1.1 per spec) Change-Id: I4138281d513998789163237e83bb893aeda43336 Reviewed-on: https://go-review.googlesource.com/17892Reviewed-by: Russ Cox <rsc@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Brad Fitzpatrick authored
Change-Id: I04ed7e5ab992c1eb3528432797026d0c7d2818f1 Reviewed-on: https://go-review.googlesource.com/17894Reviewed-by: Russ Cox <rsc@golang.org>
-
Austin Clements authored
TestMemStats currently requires that NumGC != 0, but GC may legitimately not have run (for example, if this test runs first, or GOGC is set high, etc). Accept NumGC == 0 and instead sanity check NumGC by making sure that all pause times after NumGC are 0. Fixes #11989. Change-Id: I4203859fbb83292d59a509f2eeb24d6033e7aabc Reviewed-on: https://go-review.googlesource.com/17830 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
-
Robert Griesemer authored
This simply copies the current version of math/big into the compiler directory. The change was created automatically by running cmd/compile/internal/big/vendor.bash. No other manual changes. Change-Id: Ica225d196b3ac10dfd9d4dc1e4e4ef0b22812ff9 Reviewed-on: https://go-review.googlesource.com/17900 Run-TryBot: Robert Griesemer <gri@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Brad Fitzpatrick authored
The Transport had a delicate protocol between its readLoop goroutine and the goroutine calling RoundTrip. The basic concern is that the caller's RoundTrip goroutine wants to wait for either a connection-level error (the conn dying) or the response. But sometimes both happen: there's a valid response (without a body), but the conn is also going away. Both goroutines' logic dealing with this had grown large and complicated with hard-to-follow comments over the years. Simplify and document. Pull some bits into functions and do all bodyless stuff in one place (it's special enough), rather than having a bunch of conditionals scattered everywhere. One test is no longer even applicable since the race it tested is no longer possible (the code doesn't exist). The bug that this fixes is that when the Transport reads a bodyless response from a server, it was returning that response before returning the persistent connection to the idle pool. As a result, ~1/1000 of serial requests would end up creating a new connection rather than re-using the just-used connection due to goroutine scheduling chance. Instead, this now adds bodyless responses' connections back to the idle pool first, then sends the response to the RoundTrip goroutine, but making sure that the RoundTrip goroutine is outside of its select on the connection dying. There's a new buffered channel involved now, which is a minor complication, but it's much more self-contained and well-documented than the previous complexity. (The alternative of making the responseAndError channel itself unbuffered is too invasive and risky at this point; it would require a number of changes to avoid deadlocked goroutines in error cases) In any case, flakes look to be gone now. We'll see if trybots agree. Fixes #13633 Change-Id: I95a22942b2aa334ae7c87331fddd751d4cdfdffc Reviewed-on: https://go-review.googlesource.com/17890Reviewed-by: Russ Cox <rsc@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
-
Russ Cox authored
Fixes #13264. Change-Id: I74b941164610921a03814733fea08631f18b6178 Reviewed-on: https://go-review.googlesource.com/17815Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Shenghou Ma authored
So that there is a uniformed way to retrieve Go version from a Go binary, starting from Go 1.4 (see https://golang.org/cl/117040043) Updates #13507. Change-Id: Iaa2b14fca2d8c4d883d3824e2efc82b3e6fe2624 Reviewed-on: https://go-review.googlesource.com/17459Reviewed-by: Keith Randall <khr@golang.org>
-
Ian Lance Taylor authored
This matches SIGEMT on other systems that use it (SIGEMT is not used for most linux systems). Change-Id: If394c06c9ed1cb3ea2564385a8edfbed8b5566d1 Reviewed-on: https://go-review.googlesource.com/17874 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Minux Ma <minux@golang.org>
-
Mikio Hara authored
Updates #11225. Change-Id: I6c33d577f144643781f370ba2ab0997d1c1a3820 Reviewed-on: https://go-review.googlesource.com/17880Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Robert Griesemer authored
Also fixed conversion bug and added corresponding test case. Change-Id: I26f143fbc8d40a6d073ecb095e61b461495f3d68 Reviewed-on: https://go-review.googlesource.com/17872 Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Alan Donovan <adonovan@google.com>
-
- 15 Dec, 2015 5 commits
-
-
Robert Griesemer authored
Fixes #13595. Change-Id: I870ddc97ea25b7f6f7a1bb1a78e5e4874fba1ddc Reviewed-on: https://go-review.googlesource.com/17871Reviewed-by: Rob Pike <r@golang.org>
-
Brad Fitzpatrick authored
Dialer.Cancel is a new optional <-chan struct{} channel whose closure indicates that the dial should be canceled. It is compatible with the x/net/context and http.Request.Cancel types. Tested by hand with: package main import ( "log" "net" "time" ) func main() { log.Printf("start.") var d net.Dialer cancel := make(chan struct{}) time.AfterFunc(2*time.Second, func() { log.Printf("timeout firing") close(cancel) }) d.Cancel = cancel c, err := d.Dial("tcp", "192.168.0.1:22") if err != nil { log.Print(err) return } log.Fatalf("unexpected connect: %v", c) } Which says: 2015/12/14 22:24:58 start. 2015/12/14 22:25:00 timeout firing 2015/12/14 22:25:00 dial tcp 192.168.0.1:22: operation was canceled Fixes #11225 Change-Id: I2ef39e3a540e29fe6bfec03ab7a629a6b187fcb3 Reviewed-on: https://go-review.googlesource.com/17821Reviewed-by: Russ Cox <rsc@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Brad Fitzpatrick authored
This might deflake it. Or it'll at least give us more debugging clues. Fixes #13626 maybe Change-Id: Ie8cd0375d60dad033ec6a64830a90e7b9152a3d9 Reviewed-on: https://go-review.googlesource.com/17825Reviewed-by: Austin Clements <austin@google.com> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
-
Brad Fitzpatrick authored
CloseNotifier wasn't well specified previously. This CL simplifies its implementation, clarifies the public documentation on CloseNotifier, clarifies internal documentation on conn, and fixes two CloseNotifier bugs in the process. The main change, though, is tightening the rules and expectations for using CloseNotifier: * the caller must consume the Request.Body first (old rule, unwritten) * the received value is the "true" value (old rule, unwritten) * no promises for channel sends after Handler returns (old rule, unwritten) * a subsequent pipelined request fires the CloseNotifier (new behavior; previously it never fired and thus effectively deadlocked as in #13165) * advise that it should only be used without HTTP/1.1 pipelining (use HTTP/2 or non-idempotent browsers). Not that browsers actually use pipelining. The main implementation change is that each Handler now gets its own CloseNotifier channel value, rather than sharing one between the whole conn. This means Handlers can't affect subsequent requests. This is how HTTP/2's Server works too. The old docs never clarified a behavior either way. The other side effect of each request getting its own CloseNotifier channel is that one handler can't "poison" the underlying conn preventing subsequent requests on the same connection from using CloseNotifier (this is #9763). In the old implementation, once any request on a connection used ClosedNotifier, the conn's underlying bufio.Reader source was switched from the TCPConn to the read side of the pipe being fed by a never-ending copy. Since it was impossible to abort that never-ending copy, we could never get back to a fresh state where it was possible to return the underlying TCPConn to callers of Hijack. Now, instead of a never-ending Copy, the background goroutine doing a Read from the TCPConn (or *tls.Conn) only reads a single byte. That single byte can be in the request body, a socket timeout error, io.EOF error, or the first byte of the second body. In any case, the new *connReader type stitches sync and async reads together like an io.MultiReader. To clarify the flow of Read data and combat the complexity of too many wrapper Reader types, the *connReader absorbs the io.LimitReader previously used for bounding request header reads. The liveSwitchReader type is removed. (an unused switchWriter type is also removed) Many fields on *conn are also documented more fully. Fixes #9763 (CloseNotify + Hijack together) Fixes #13165 (deadlock with CloseNotify + pipelined requests) Change-Id: I40abc0a1992d05b294d627d1838c33cbccb9dd65 Reviewed-on: https://go-review.googlesource.com/17750Reviewed-by: Russ Cox <rsc@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Austin Clements authored
Currently, sysmon triggers a forced GC solely based on memstats.last_gc. However, memstats.last_gc isn't updated until mark termination, so once sysmon starts triggering forced GC, it will keep triggering them until GC finishes. The first of these actually starts a GC; the remainder up to the last print "GC forced", but gcStart returns immediately because gcphase != _GCoff; then the last may start another GC if the previous GC finishes (and sets last_gc) between sysmon triggering it and gcStart checking the GC phase. Fix this by expanding the condition for starting a forced GC to also require that no GC is currently running. This, combined with the way forcegchelper blocks until the GC cycle is started, ensures sysmon only starts one GC when the time exceeds the forced GC threshold. Fixes #13458. Change-Id: Ie6cf841927f6085136be3f45259956cd5cf10d23 Reviewed-on: https://go-review.googlesource.com/17819 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
-