Most BSDs include the trailing NUL character of the socket path in the
length, however some do not (such as NetBSD 6.99). Handle this by only
subtracting the family and length bytes from the returned length, then
scanning the path and removing any terminating NUL bytes.
Fixes#6627.
R=golang-codereviews, mikioh.mikioh
CC=golang-codereviews
https://golang.org/cl/46420044
Some builders broke on this test; I'm guessing that was because
this test didn't try hard enough to find a different iteration order.
Update #6719
R=dave
CC=golang-codereviews
https://golang.org/cl/47300043
Technically the spec does not guarantee that the iteration order is random,
but it is a property that we have consciously pursued, and so it seems
right to verify that our implementation does indeed randomise.
Update #6719.
R=khr, bradfitz
CC=golang-codereviews
https://golang.org/cl/47010043
This source file, when compiled with gcc 4.4.3 on Ubuntu lucid,
corresponds instruction for instruction to the binaries in the same
directory.
Shipping this source code file resolves http://bugs.debian.org/716853
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/46780043
This change fixes a serious performance regression
with reflect.Value growing to 4 words instead of 3.
The json benchmark was ~50% slower, with this change
it is ~5% slower (and the binary is 0.5% larger).
Longer term, we probably need to rethink our copy
generation. Using REP is really expensive time-wise.
But inlining the copy grows the binary.
R=golang-codereviews, r
CC=golang-codereviews
https://golang.org/cl/44990043
Fixes#6952.
runtime.asminit was incorrectly loading runtime.goarm as a word, not a uint8 which made it subject to alignment issues on arm5 platforms.
Alignment aside, this also meant that the top 3 bytes in R11 would have been garbage and could not be assumed to be setting up the FPU reliably.
R=iant, minux.ma
CC=golang-codereviews
https://golang.org/cl/46240043
On Solaris, if you do a in-progress connect, and then the
server accepts and closes the socket, the client's later
attempt to complete the connect will fail with EINVAL. Handle
this case by assuming that the connect succeeded. This code
is weird enough that it is implemented as Solaris-only so that
it doesn't hide a real error on a different OS.
Update #6828
R=golang-codereviews, bradfitz, dave
CC=golang-codereviews
https://golang.org/cl/46160043
This avoids problems with systems that take a long time to
find out nothing is listening, while still testing for the
self-connect misfeature since a self-connect should be fast.
With this we may be able to remove the test for non-Linux
systems.
Tested (on GNU/Linux) by editing selfConnect in
tcpsock_posix.go to always return false and verifying that
TestSelfConnect then fails with and without this change.
Idea from Uros Bizjak.
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/39200044
Capture log output (and test it while at it),
and quiet unnecessary t.Logf.
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/45850043
When a connection is hijacked, release the reference to the bufio.Writer
that is used with the chunkWriter. The chunkWriter is not used after
the connection is hijacked.
Also add a test to check that double Hijack calls do something sensible.
benchmark old ns/op new ns/op delta
BenchmarkServerHijack 24137 20629 -14.53%
benchmark old allocs new allocs delta
BenchmarkServerHijack 21 19 -9.52%
benchmark old bytes new bytes delta
BenchmarkServerHijack 11774 9667 -17.90%
R=bradfitz, dave, chris.cahoon
CC=golang-codereviews
https://golang.org/cl/39440044
The last connection in the pool was not being handed out correctly.
R=golang-codereviews, gobot, bradfitz
CC=golang-codereviews
https://golang.org/cl/40410043
This was done correctly for most targets but was missing from
FreeBSD/ARM and Linux/ARM.
R=golang-codereviews, dave
CC=golang-codereviews
https://golang.org/cl/45180043