Commit 78d024a5 authored by Chris Broadfoot's avatar Chris Broadfoot

all: merge master into release-branch.go1.7

7a622740 net/http: make Transport use new connection if over HTTP/2 concurrency limit
219ca602 doc: fix required OS X version inconsistency for binary downloads
26015b95 runtime: make stack 16-byte aligned for external code in _rt0_amd64_linux_lib
9fde86b0 runtime, syscall: fix kernel gettimeofday ABI change on iOS 10
3a03e877 os: check for waitid returning ENOSYS
10316757 net/http: update bundled http2 for flow control window adjustment fix
da070bed syscall: fix Gettimeofday on macOS Sierra
f135c326 runtime: initialize hash algs before typemap

Change-Id: Ie176f3db1e253d75ae8e56b16d3fd9900b37dde3
parents 09fc3cc5 7a622740
......@@ -17,7 +17,7 @@
<p>
<a href="https://golang.org/dl/" target="_blank">Official binary
distributions</a> are available for the FreeBSD (release 8-STABLE and above),
Linux, Mac OS X (10.7 and above), and Windows operating systems and
Linux, Mac OS X (10.8 and above), and Windows operating systems and
the 32-bit (<code>386</code>) and 64-bit (<code>amd64</code>) x86 processor
architectures.
</p>
......@@ -49,7 +49,7 @@ If your OS or architecture is not on the list, you may be able to
<tr><td colspan="3"><hr></td></tr>
<tr><td>FreeBSD 8-STABLE or later</td> <td>amd64</td> <td>Debian GNU/kFreeBSD not supported</td></tr>
<tr><td>Linux 2.6.23 or later with glibc</td> <td>amd64, 386, arm</td> <td>CentOS/RHEL 5.x not supported</td></tr>
<tr><td>Mac OS X 10.7 or later</td> <td>amd64</td> <td>use the clang or gcc<sup>&#8224;</sup> that comes with Xcode<sup>&#8225;</sup></td></tr>
<tr><td>Mac OS X 10.7 or later</td> <td>amd64</td> <td>use the clang or gcc<sup>&#8224;</sup> that comes with Xcode<sup>&#8225;</sup> for <code>cgo</code> support</td></tr>
<tr><td>Windows XP or later</td> <td>amd64, 386</td> <td>use MinGW gcc<sup>&#8224;</sup>. No need for cygwin or msys.</td></tr>
</table>
......
This diff is collapsed.
......@@ -398,6 +398,15 @@ func (t *Transport) RoundTrip(req *Request) (*Response, error) {
// HTTP request on a new connection. The non-nil input error is the
// error from roundTrip.
func (pc *persistConn) shouldRetryRequest(req *Request, err error) bool {
if err == http2ErrNoCachedConn {
// Issue 16582: if the user started a bunch of
// requests at once, they can all pick the same conn
// and violate the server's max concurrent streams.
// Instead, match the HTTP/1 behavior for now and dial
// again to get a new TCP connection, rather than failing
// this request.
return true
}
if err == errMissingHost {
// User error.
return false
......
......@@ -28,6 +28,12 @@ func (p *Process) blockUntilWaitable() (bool, error) {
_, _, e := syscall.Syscall6(syscall.SYS_WAITID, _P_PID, uintptr(p.Pid), uintptr(unsafe.Pointer(psig)), syscall.WEXITED|syscall.WNOWAIT, 0, 0)
runtime.KeepAlive(psig)
if e != 0 {
// waitid has been available since Linux 2.6.9, but
// reportedly is not available in Ubuntu on Windows.
// See issue 16610.
if e == syscall.ENOSYS {
return false, nil
}
return false, NewSyscallError("waitid", e)
}
return true, nil
......
......@@ -289,7 +289,7 @@ var aeskeysched [hashRandomBytes]byte
// used in hash{32,64}.go to seed the hash function
var hashkey [4]uintptr
func init() {
func alginit() {
// Install aes hash algorithm if we have the instructions we need
if (GOARCH == "386" || GOARCH == "amd64") &&
GOOS != "nacl" &&
......
......@@ -439,7 +439,8 @@ func schedinit() {
stackinit()
mallocinit()
mcommoninit(_g_.m)
typelinksinit()
alginit() // maps must not be used before this call
typelinksinit() // uses maps
itabsinit()
msigsave(_g_.m)
......
......@@ -12,13 +12,18 @@ TEXT _rt0_amd64_linux(SB),NOSPLIT,$-8
// When building with -buildmode=c-shared, this symbol is called when the shared
// library is loaded.
TEXT _rt0_amd64_linux_lib(SB),NOSPLIT,$0x48
// Note: This function calls external C code, which might required 16-byte stack
// alignment after cmd/internal/obj applies its transformations.
TEXT _rt0_amd64_linux_lib(SB),NOSPLIT,$0x50
MOVQ SP, AX
ANDQ $-16, SP
MOVQ BX, 0x10(SP)
MOVQ BP, 0x18(SP)
MOVQ R12, 0x20(SP)
MOVQ R13, 0x28(SP)
MOVQ R14, 0x30(SP)
MOVQ R15, 0x38(SP)
MOVQ AX, 0x40(SP)
MOVQ DI, _rt0_amd64_linux_lib_argc<>(SB)
MOVQ SI, _rt0_amd64_linux_lib_argv<>(SB)
......@@ -50,6 +55,7 @@ restore:
MOVQ 0x28(SP), R13
MOVQ 0x30(SP), R14
MOVQ 0x38(SP), R15
MOVQ 0x40(SP), SP
RET
TEXT _rt0_amd64_linux_lib_go(SB),NOSPLIT,$0
......
......@@ -162,11 +162,15 @@ TEXT runtime·mincore(SB),NOSPLIT,$0
TEXT time·now(SB), 7, $32
MOVW $8(R13), R0 // timeval
MOVW $0, R1 // zone
MOVW $0, R2 // see issue 16570
MOVW $SYS_gettimeofday, R12
SWI $0x80 // Note: R0 is tv_sec, R1 is tv_usec
CMP $0, R0
BNE inreg
MOVW 8(R13), R0
MOVW 12(R13), R1
inreg:
MOVW R1, R2 // usec
MOVW R0, sec+0(FP)
MOVW $0, R1
MOVW R1, loc+4(FP)
......@@ -178,9 +182,14 @@ TEXT time·now(SB), 7, $32
TEXT runtime·nanotime(SB),NOSPLIT,$32
MOVW $8(R13), R0 // timeval
MOVW $0, R1 // zone
MOVW $0, R2 // see issue 16570
MOVW $SYS_gettimeofday, R12
SWI $0x80 // Note: R0 is tv_sec, R1 is tv_usec
CMP $0, R0
BNE inreg
MOVW 8(R13), R0
MOVW 12(R13), R1
inreg:
MOVW R1, R2
MOVW $1000000000, R3
MULLU R0, R3, (R1, R0)
......
......@@ -155,9 +155,14 @@ TEXT time·now(SB),NOSPLIT,$40-12
MOVD RSP, R0 // timeval
MOVD R0, R9 // this is how dyld calls gettimeofday
MOVW $0, R1 // zone
MOVD $0, R2 // see issue 16570
MOVW $SYS_gettimeofday, R16
SVC $0x80 // Note: x0 is tv_sec, w1 is tv_usec
CMP $0, R0
BNE inreg
MOVD 0(RSP), R0
MOVW 8(RSP), R1
inreg:
MOVD R0, sec+0(FP)
MOVW $1000, R3
MUL R3, R1
......@@ -168,9 +173,14 @@ TEXT runtime·nanotime(SB),NOSPLIT,$40
MOVD RSP, R0 // timeval
MOVD R0, R9 // this is how dyld calls gettimeofday
MOVW $0, R1 // zone
MOVD $0, R2 // see issue 16570
MOVW $SYS_gettimeofday, R16
SVC $0x80 // Note: x0 is tv_sec, w1 is tv_usec
CMP $0, R0
BNE inreg
MOVD 0(RSP), R0
MOVW 8(RSP), R1
inreg:
MOVW $1000000000, R3
MUL R3, R0
MOVW $1000, R3
......
......@@ -26,14 +26,21 @@ func NsecToTimeval(nsec int64) (tv Timeval) {
}
//sysnb gettimeofday(tp *Timeval) (sec int32, usec int32, err error)
func Gettimeofday(tv *Timeval) (err error) {
// The tv passed to gettimeofday must be non-nil
// but is otherwise unused. The answers come back
// in the two registers.
func Gettimeofday(tv *Timeval) error {
// The tv passed to gettimeofday must be non-nil.
// Before macOS Sierra (10.12), tv was otherwise unused and
// the answers came back in the two registers.
// As of Sierra, gettimeofday return zeros and populates
// tv itself.
sec, usec, err := gettimeofday(tv)
if err != nil {
return err
}
if sec != 0 || usec != 0 {
tv.Sec = int32(sec)
tv.Usec = int32(usec)
return err
}
return nil
}
func SetKevent(k *Kevent_t, fd, mode, flags int) {
......
......@@ -26,14 +26,21 @@ func NsecToTimeval(nsec int64) (tv Timeval) {
}
//sysnb gettimeofday(tp *Timeval) (sec int64, usec int32, err error)
func Gettimeofday(tv *Timeval) (err error) {
// The tv passed to gettimeofday must be non-nil
// but is otherwise unused. The answers come back
// in the two registers.
func Gettimeofday(tv *Timeval) error {
// The tv passed to gettimeofday must be non-nil.
// Before macOS Sierra (10.12), tv was otherwise unused and
// the answers came back in the two registers.
// As of Sierra, gettimeofday return zeros and populates
// tv itself.
sec, usec, err := gettimeofday(tv)
if err != nil {
return err
}
if sec != 0 || usec != 0 {
tv.Sec = sec
tv.Usec = usec
return err
}
return nil
}
func SetKevent(k *Kevent_t, fd, mode, flags int) {
......
......@@ -26,14 +26,19 @@ func NsecToTimeval(nsec int64) (tv Timeval) {
}
//sysnb gettimeofday(tp *Timeval) (sec int32, usec int32, err error)
func Gettimeofday(tv *Timeval) (err error) {
func Gettimeofday(tv *Timeval) error {
// The tv passed to gettimeofday must be non-nil
// but is otherwise unused. The answers come back
// in the two registers.
sec, usec, err := gettimeofday(tv)
if err != nil {
return err
}
if sec != 0 || usec != 0 {
tv.Sec = int32(sec)
tv.Usec = int32(usec)
return err
}
return nil
}
func SetKevent(k *Kevent_t, fd, mode, flags int) {
......
......@@ -26,14 +26,19 @@ func NsecToTimeval(nsec int64) (tv Timeval) {
}
//sysnb gettimeofday(tp *Timeval) (sec int64, usec int32, err error)
func Gettimeofday(tv *Timeval) (err error) {
func Gettimeofday(tv *Timeval) error {
// The tv passed to gettimeofday must be non-nil
// but is otherwise unused. The answers come back
// in the two registers.
sec, usec, err := gettimeofday(tv)
if err != nil {
return err
}
if sec != 0 || usec != 0 {
tv.Sec = sec
tv.Usec = usec
return err
}
return nil
}
func SetKevent(k *Kevent_t, fd, mode, flags int) {
......
// Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build darwin
// +build amd64 386 arm arm64
package syscall_test
import (
"syscall"
"testing"
)
func TestDarwinGettimeofday(t *testing.T) {
tv := &syscall.Timeval{}
if err := syscall.Gettimeofday(tv); err != nil {
t.Fatal(err)
}
if tv.Sec == 0 && tv.Usec == 0 {
t.Fatal("Sec and Usec both zero")
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment