]> Cypherpunks repositories - gostls13.git/log
gostls13.git
12 years agoarchive/tar: read/write extended pax/gnu tar archives
Shane Hansen [Mon, 11 Feb 2013 00:36:29 +0000 (11:36 +1100)]
archive/tar: read/write extended pax/gnu tar archives

Support reading pax archives and applying extended attributes
like long names, subsecond mtime resolutions, etc. Default to
writing pax archives for long file and link names.
Support reading gnu archives using the ././@LongLink extended
header for file name and link target.

Fixes #3300

R=dsymonds, dave, rogpeppe, remyoudompheng, chressie, rsc
CC=golang-dev
https://golang.org/cl/6700047

12 years agocmd/8l/asm.c: Unused function arguments, suppress warnings.
Lucio De Re [Sun, 10 Feb 2013 23:15:56 +0000 (10:15 +1100)]
cmd/8l/asm.c: Unused function arguments, suppress warnings.

R=golang-dev, nigeltao
CC=golang-dev
https://golang.org/cl/7304069

12 years agodoc: move os specific build instructions to wiki
Dave Cheney [Sun, 10 Feb 2013 22:39:13 +0000 (17:39 -0500)]
doc: move os specific build instructions to wiki

Fixes #4010.

This proposal avoids cluttering the main install-source.html with OS specific instructions by linking to the wiki for details. See discussion in the comments.

R=adg, minux.ma
CC=golang-dev
https://golang.org/cl/7241068

12 years agodoc: link to wiki Projects page instead of old Project Dashboard.
Greg Ward [Sun, 10 Feb 2013 22:18:31 +0000 (09:18 +1100)]
doc: link to wiki Projects page instead of old Project Dashboard.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/7308079

12 years agoA+C: Greg Ward (individual CLA)
Andrew Gerrand [Sun, 10 Feb 2013 22:17:00 +0000 (09:17 +1100)]
A+C: Greg Ward (individual CLA)

Generated by addca.

R=gobot
CC=golang-dev
https://golang.org/cl/7303069

12 years agospec: clarify that any unsafe.Pointer type is okay in conversion
Russ Cox [Sat, 9 Feb 2013 22:36:31 +0000 (17:36 -0500)]
spec: clarify that any unsafe.Pointer type is okay in conversion

The spec is not clear about whether this is allowed or not,
but both compilers allow it, because the reflect implementation
takes advantage of it. Document current behavior.

Fixes #4679.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/7303064

12 years agonet/http: more request benchmarks
Dave Cheney [Sat, 9 Feb 2013 21:18:09 +0000 (08:18 +1100)]
net/http: more request benchmarks

Add benchmarks for common http benchmarking tools. The intent is to catch optimisations which favor synthetic benchmarks that do not show improvements for real clients like Chrome.

BenchmarkReadRequestChrome        200000             10133 ns/op          60.29 MB/s        3148 B/op         32 allocs/op
BenchmarkReadRequestCurl          500000              4314 ns/op          18.08 MB/s         905 B/op         15 allocs/op
BenchmarkReadRequestApachebench   500000              4363 ns/op          18.79 MB/s         956 B/op         16 allocs/op
BenchmarkReadRequestSiege         500000              6408 ns/op          24.19 MB/s        1397 B/op         22 allocs/op
BenchmarkReadRequestWrk          1000000              2838 ns/op          14.09 MB/s         757 B/op         11 allocs/op

R=golang-dev, bradfitz
CC=golang-dev, haimuiba
https://golang.org/cl/7300075

12 years agospec: clarify that f(g()) requires that g return >= 1 value
Russ Cox [Sat, 9 Feb 2013 19:46:55 +0000 (14:46 -0500)]
spec: clarify that f(g()) requires that g return >= 1 value

Fixes #4573.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7322043

12 years agocrypto/x509: disable SCG test with system validation.
Adam Langley [Sat, 9 Feb 2013 18:51:39 +0000 (13:51 -0500)]
crypto/x509: disable SCG test with system validation.

On Windows, CryptoAPI is finding an alternative validation path. Since
this is a little non-deterministic, this change disables that test
when using system validation.

R=golang-dev
CC=golang-dev
https://golang.org/cl/7313068

12 years agotesting: be explicit about use of b.N
Russ Cox [Sat, 9 Feb 2013 18:43:15 +0000 (13:43 -0500)]
testing: be explicit about use of b.N

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/7314071

12 years agocrypto/x509: allow MS/NS SCG key usage as ServerAuth.
Adam Langley [Sat, 9 Feb 2013 18:20:25 +0000 (13:20 -0500)]
crypto/x509: allow MS/NS SCG key usage as ServerAuth.

By default, crypto/x509 assumes that users wish to validate
certificates for ServerAuth. However, due to historical reasons,
COMODO's intermediates don't specify ServerAuth as an allowed key
usage.

Rather NSS and CryptoAPI both allow these SGC OIDs to be equivalent to
ServerAuth.

R=rsc
CC=golang-dev
https://golang.org/cl/7312070

12 years agobytes: annotate assembly functions with //go:noescape
Shenghou Ma [Sat, 9 Feb 2013 16:08:30 +0000 (00:08 +0800)]
bytes: annotate assembly functions with //go:noescape

R=golang-dev, agl, bradfitz, rsc
CC=golang-dev
https://golang.org/cl/7299064

12 years agolog/syslog: remove socket files after tests
Shenghou Ma [Sat, 9 Feb 2013 00:19:09 +0000 (08:19 +0800)]
log/syslog: remove socket files after tests

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/7305065

12 years agonet: fix unixgram
Mikio Hara [Fri, 8 Feb 2013 23:18:32 +0000 (08:18 +0900)]
net: fix unixgram

The socket for AF_UNIX domain with SOCK_DGARM type isn't
allowed to work with syscall listen.

R=rsc
CC=golang-dev
https://golang.org/cl/7310068

12 years agocmd/go: indicate that flags unrecognized by 'go test' must follow package specification
Robert Daniel Kortschak [Fri, 8 Feb 2013 21:00:59 +0000 (16:00 -0500)]
cmd/go: indicate that flags unrecognized by 'go test' must follow package specification

R=rsc, minux.ma
CC=golang-dev
https://golang.org/cl/7300063

12 years agoruntime: precise garbage collection of hashmaps
Jan Ziak [Fri, 8 Feb 2013 21:00:33 +0000 (16:00 -0500)]
runtime: precise garbage collection of hashmaps

R=golang-dev, rsc
CC=dave, dvyukov, golang-dev, minux.ma, remyoudompheng
https://golang.org/cl/7252047

12 years agonet/http: add BenchmarkReadRequest
Dave Cheney [Fri, 8 Feb 2013 20:04:07 +0000 (07:04 +1100)]
net/http: add BenchmarkReadRequest

Add benchmark for request parsing. Fixture data is taken from https://github.com/felixge/node-http-perf

% go version
go version devel +28966b7b2f0c Thu Feb 07 20:26:12 2013 -0800 linux/amd64

% go test -run=nil -bench=ReadRequest -benchtime=10s
PASS
BenchmarkReadRequest     2000000   9900 ns/op   61.71 MB/s   3148 B/op   32 allocs/op
ok      net/http        12.180s

R=golang-dev, bradfitz, minux.ma, haimuiba
CC=golang-dev
https://golang.org/cl/7313048

12 years agosyscall: check for invalid characters in Setenv on Unix
Péter Surányi [Fri, 8 Feb 2013 18:45:46 +0000 (10:45 -0800)]
syscall: check for invalid characters in Setenv on Unix

On POSIX, '=' in key is explicitly invalid, and '\x00' in key/value is implicitly invalid.

R=golang-dev, iant, bradfitz
CC=golang-dev
https://golang.org/cl/7311061

12 years agonet/http/httptest: add examples
Kamil Kisiel [Fri, 8 Feb 2013 17:20:05 +0000 (09:20 -0800)]
net/http/httptest: add examples

R=golang-dev, adg, bradfitz
CC=golang-dev
https://golang.org/cl/7314046

12 years agoexp/ssa/interp: fix MS Windows breakage.
Alan Donovan [Fri, 8 Feb 2013 16:58:24 +0000 (11:58 -0500)]
exp/ssa/interp: fix MS Windows breakage.

syscall.{Kill,Write} are not portable to MS Windows, so we
disable them for now.

R=iant, rsc
CC=golang-dev
https://golang.org/cl/7312066

12 years agoexp/ssa: (#5 of 5): the SSA interpreter and 'ssadump' tool.
Alan Donovan [Fri, 8 Feb 2013 15:43:53 +0000 (10:43 -0500)]
exp/ssa: (#5 of 5): the SSA interpreter and 'ssadump' tool.

R=gri, iant
CC=golang-dev
https://golang.org/cl/7226065

12 years agoruntime/race: deflake tests
Dmitriy Vyukov [Fri, 8 Feb 2013 15:24:50 +0000 (19:24 +0400)]
runtime/race: deflake tests
With the new scheduler races in the tests are reported during execution of other tests.
The change joins goroutines started during the tests.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7310066

12 years agoruntime: fix integer overflow
Dmitriy Vyukov [Fri, 8 Feb 2013 15:05:19 +0000 (19:05 +0400)]
runtime: fix integer overflow
The problem happens when end=0, then end-1 is very big number.
Observed with the new scheduler.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/7307073

12 years agonet: simplify Dial, Listen, ListenPacket and those helpers
Mikio Hara [Fri, 8 Feb 2013 12:53:10 +0000 (21:53 +0900)]
net: simplify Dial, Listen, ListenPacket and those helpers

R=golang-dev, dave, bradfitz
CC=golang-dev
https://golang.org/cl/7300065

12 years agonet: delete duplicate listenerSockaddr
Mikio Hara [Fri, 8 Feb 2013 08:02:08 +0000 (17:02 +0900)]
net: delete duplicate listenerSockaddr

R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/7299067

12 years agocmd/5g: add missing splitclean.
Rémy Oudompheng [Fri, 8 Feb 2013 07:19:47 +0000 (08:19 +0100)]
cmd/5g: add missing splitclean.

See issue 887 for the 8g analogue.

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/7306069

12 years agoruntime: fix build for Linux/ARM
Shenghou Ma [Fri, 8 Feb 2013 05:24:38 +0000 (13:24 +0800)]
runtime: fix build for Linux/ARM

R=dave, rsc
CC=golang-dev
https://golang.org/cl/7299055

12 years agoio: Simplify CopyN implementation by delegating to Copy.
Jeremy Schlatter [Fri, 8 Feb 2013 04:26:12 +0000 (20:26 -0800)]
io: Simplify CopyN implementation by delegating to Copy.

R=golang-dev, dave, minux.ma, bradfitz, rsc
CC=golang-dev
https://golang.org/cl/7312055

12 years agoC: add Jeremy Schlatter (Google CLA)
Brad Fitzpatrick [Fri, 8 Feb 2013 04:25:10 +0000 (20:25 -0800)]
C: add Jeremy Schlatter (Google CLA)

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/7307070

12 years agocodereview: use hgapplydiff instead of hgpatch
Russ Cox [Fri, 8 Feb 2013 04:15:08 +0000 (23:15 -0500)]
codereview: use hgapplydiff instead of hgpatch

Depends on https://golang.org/cl/7308067

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7312064

12 years agonet: do not use RLock around Accept
Russ Cox [Fri, 8 Feb 2013 03:45:12 +0000 (22:45 -0500)]
net: do not use RLock around Accept

It might be non-blocking, but it also might be blocking.
Cannot take the chance, as Accept might block indefinitely
and make it impossible to acquire ForkLock exclusively
(during fork+exec).

Fixes #4737.

R=golang-dev, dave, iant, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/7309050

12 years agocmd/godoc: fix format strings.
David Symonds [Fri, 8 Feb 2013 01:00:35 +0000 (12:00 +1100)]
cmd/godoc: fix format strings.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7309061

12 years agobytes: minor optimization to lastIndexFunc
Brad Fitzpatrick [Fri, 8 Feb 2013 00:00:06 +0000 (16:00 -0800)]
bytes: minor optimization to lastIndexFunc

Before and after:
BenchmarkTrimSpace  20000000   81.3 ns/op
BenchmarkTrimSpace  50000000   58.0 ns/op

(most whitespace trimming is ASCII whitespace)

Same optimization appeared a handful of other places
in this file, but not here.

R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/7305063

12 years agocmd/8g: add a few missing splitclean
Russ Cox [Thu, 7 Feb 2013 22:55:25 +0000 (17:55 -0500)]
cmd/8g: add a few missing splitclean

Fixes #887.

R=ken2
CC=golang-dev
https://golang.org/cl/7303061

12 years agocrypto/md5: fix for big-endian processors
Ian Lance Taylor [Thu, 7 Feb 2013 21:31:53 +0000 (13:31 -0800)]
crypto/md5: fix for big-endian processors

R=golang-dev, minux.ma, agl
CC=golang-dev
https://golang.org/cl/7305059

12 years agonet: skip TestMulticastListener on Solaris
Ian Lance Taylor [Thu, 7 Feb 2013 17:58:42 +0000 (09:58 -0800)]
net: skip TestMulticastListener on Solaris

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/7308060

12 years agoos/exec: LookPath on Unix shouldn't look in cwd when PATH is empty
Péter Surányi [Thu, 7 Feb 2013 14:41:35 +0000 (06:41 -0800)]
os/exec: LookPath on Unix shouldn't look in cwd when PATH is empty

R=golang-dev, dave, bradfitz
CC=golang-dev
https://golang.org/cl/7305053

12 years agocrypto/rc4: naïve ARM assembly implementation
Shenghou Ma [Thu, 7 Feb 2013 10:54:21 +0000 (18:54 +0800)]
crypto/rc4: naïve ARM assembly implementation

On 800MHz Cortex-A8:
benchmark           old ns/op    new ns/op    delta
BenchmarkRC4_128         9395         2838  -69.79%
BenchmarkRC4_1K         74497        22120  -70.31%
BenchmarkRC4_8K        587243       171435  -70.81%

benchmark            old MB/s     new MB/s  speedup
BenchmarkRC4_128        13.62        45.09    3.31x
BenchmarkRC4_1K         13.75        46.29    3.37x
BenchmarkRC4_8K         13.79        47.22    3.42x

Result for "OpenSSL 1.0.1c 10 May 2012" from Debian/armhf sid:
type             16 bytes     64 bytes    256 bytes   1024 bytes   8192 bytes
rc4              39553.81k    46522.39k    49336.11k    50085.63k    50258.06k

R=golang-dev, agl, dave
CC=golang-dev
https://golang.org/cl/7310051

12 years agonet: permit pollster DelFD to return whether to call Wakeup
Ian Lance Taylor [Thu, 7 Feb 2013 01:18:53 +0000 (17:18 -0800)]
net: permit pollster DelFD to return whether to call Wakeup

This is necessary for systems that use select as the pollster,
such as Solaris (supported by gccgo).  It corresponds to the
bool returned by AddFD.  In general it's not clearly defined
what happens when a descriptor used in a select is closed, and
different systems behave differently.  Waking up the select
will cause the right thing to happen: the closed descriptor
will be dropped from the next iteration.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7303056

12 years agosync: improve WaitGroup example by putting the call to Done in a
Gaal Yahas [Wed, 6 Feb 2013 16:39:52 +0000 (00:39 +0800)]
sync: improve WaitGroup example by putting the call to Done in a
deferred block. This makes hangs in the waiting code less likely
if a goroutine exits abnormally.

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/7306052

12 years agoCONTRIBUTORS: add Gaal Yahas (Google CLA)
Ian Lance Taylor [Wed, 6 Feb 2013 16:21:03 +0000 (08:21 -0800)]
CONTRIBUTORS: add Gaal Yahas (Google CLA)

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/7311053

12 years agosyscall, net: Fix unix socket autobind on Linux.
Albert Strasheim [Wed, 6 Feb 2013 14:45:57 +0000 (06:45 -0800)]
syscall, net: Fix unix socket autobind on Linux.

R=rsc, iant, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/7300047

12 years agoexp/cookiejar: infrastructure for upcoming implementation
Volker Dobler [Wed, 6 Feb 2013 11:37:34 +0000 (22:37 +1100)]
exp/cookiejar: infrastructure for upcoming implementation

This CL is the first of a handful of CLs which will provide
the implementation of cookiejar. It contains several helper
functions and the skeleton of Cookies and SetCookies.

Proper host name handling requires the ToASCII transformation
from package idna which currently lives in the go.net
subrepo. This CL thus contains just a TODO for this issue.

R=nigeltao, rsc, bradfitz
CC=golang-dev
https://golang.org/cl/7287046

12 years agodoc/articles/error_handling: no more os.Error
Shenghou Ma [Wed, 6 Feb 2013 10:32:54 +0000 (18:32 +0800)]
doc/articles/error_handling: no more os.Error

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/7304053

12 years agoruntime/race: switch to explicit race context instead of goroutine id's
Dmitriy Vyukov [Wed, 6 Feb 2013 07:40:54 +0000 (11:40 +0400)]
runtime/race: switch to explicit race context instead of goroutine id's
Removes limit on maximum number of goroutines ever existed.
code.google.com/p/goexecutor tests now pass successfully.
Also slightly improves performance.
Before: $ time ./flate.test -test.short
real 0m9.314s
After:  $ time ./flate.test -test.short
real 0m8.958s
Fixes #4286.
The runtime is built from llvm rev 174312.

R=rsc
CC=golang-dev
https://golang.org/cl/7218044

12 years agolog/syslog: retry once if write fails
Jeff R. Allen [Tue, 5 Feb 2013 17:54:01 +0000 (09:54 -0800)]
log/syslog: retry once if write fails

Implements deferred connections + single-attempt automatic
retry. Based on CL 5078042 from kuroneko.

Fixes #2264.

R=mikioh.mikioh, rsc, bradfitz
CC=golang-dev
https://golang.org/cl/6782140

12 years agoruntime: save LR to stack when panicking to handle leaf function traceback
Shenghou Ma [Tue, 5 Feb 2013 17:18:37 +0000 (01:18 +0800)]
runtime: save LR to stack when panicking to handle leaf function traceback

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/7289047

12 years agolib9: fix build for windows
Shenghou Ma [Tue, 5 Feb 2013 16:33:25 +0000 (00:33 +0800)]
lib9: fix build for windows

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/7311044

12 years agoexp/inotify: close event channel before file descriptor
Ian Lance Taylor [Tue, 5 Feb 2013 14:11:10 +0000 (06:11 -0800)]
exp/inotify: close event channel before file descriptor

Closing the inotify file descriptor can take over a second
when running on Ubuntu Precise in an NFS directory, leading to
the test error in issue 3132.  Closing the event channel first
lets a client that does not care about the error channel move
on.

Fixes #3132.

R=golang-dev, dave, rsc
CC=golang-dev
https://golang.org/cl/7300045

12 years agocmd/dist: add -Wstrict-prototypes to CFLAGS and fix all the compiler errors
Shenghou Ma [Tue, 5 Feb 2013 13:43:04 +0000 (21:43 +0800)]
cmd/dist: add -Wstrict-prototypes to CFLAGS and fix all the compiler errors
Plan 9 compilers insist this but as we don't have Plan 9
builders, we'd better let gcc check the prototypes.

Inspired by CL 7289050.

R=golang-dev, seed, dave, rsc, lucio.dere
CC=akumar, golang-dev
https://golang.org/cl/7288056

12 years agocontainer/heap: fix comment typo in example test
Caleb Spare [Tue, 5 Feb 2013 12:06:00 +0000 (07:06 -0500)]
container/heap: fix comment typo in example test

This updates a bad reference to a method name in the example priority queue test.

The error was introduced in the example refactoring in rev. 2ea8f07b2ffe.

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/7279045

12 years agocmd/gc: add way to specify 'noescape' for extern funcs
Russ Cox [Tue, 5 Feb 2013 12:00:38 +0000 (07:00 -0500)]
cmd/gc: add way to specify 'noescape' for extern funcs

A new comment directive //go:noescape instructs the compiler
that the following external (no body) func declaration should be
treated as if none of its arguments escape to the heap.

Fixes #4099.

R=golang-dev, dave, minux.ma, daniel.morsing, remyoudompheng, adg, agl, iant
CC=golang-dev
https://golang.org/cl/7289048

12 years agomisc/dashboard/app: trim old builds from the history
Dave Cheney [Tue, 5 Feb 2013 09:50:20 +0000 (20:50 +1100)]
misc/dashboard/app: trim old builds from the history

The dashboard is currently failing to store results of new builds for some keys, notable the go.codereview sub repository. This is causing the builders to mark the entire triggering commit as failed. With the help of David Symonds we think it is because the results value has breached the 1mb datastore limit on AppEngine.

R=dsymonds, adg
CC=golang-dev
https://golang.org/cl/6858094

12 years agoruntime/race: do not include pthread.h
Dmitriy Vyukov [Tue, 5 Feb 2013 09:08:07 +0000 (13:08 +0400)]
runtime/race: do not include pthread.h
Fixes #4721.

R=alex.brainman, minux.ma
CC=golang-dev
https://golang.org/cl/7275048

12 years agoarchive/tar: small simplification using FileMode.
David Symonds [Tue, 5 Feb 2013 04:39:55 +0000 (15:39 +1100)]
archive/tar: small simplification using FileMode.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7305043

12 years agonet/http: fix Server blocking after a Handler's Write fails
Brad Fitzpatrick [Tue, 5 Feb 2013 04:26:25 +0000 (20:26 -0800)]
net/http: fix Server blocking after a Handler's Write fails

If a Handle's Write to a ResponseWriter fails (e.g. via a
net.Conn WriteDeadline via WriteTimeout on the Server), the
Server was blocking forever waiting for reads on that
net.Conn, even after a Write failed.

Instead, once we see a Write fail, close the connection,
since it's then dead to us anyway.

Fixes #4741

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/7301043

12 years agopath/filepath: document that Walk does not follow symlinks
Russ Cox [Tue, 5 Feb 2013 03:59:30 +0000 (22:59 -0500)]
path/filepath: document that Walk does not follow symlinks

Fixes #4759.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7304043

12 years agocmd/gc: fix escape analysis
Russ Cox [Tue, 5 Feb 2013 03:48:31 +0000 (22:48 -0500)]
cmd/gc: fix escape analysis

If the analysis reached a node twice, then the analysis was cut off.
However, if the second arrival is at a lower depth (closer to escaping)
then it is important to repeat the traversal.

The repeating must be cut off at some point to avoid the occasional
infinite recursion. This CL cuts it off as soon as possible while still
passing all tests.

Fixes #4751.

R=ken2
CC=golang-dev, lvd
https://golang.org/cl/7303043

12 years agosyscall: fix marshaling of stat messages on Plan 9
Anthony Martin [Tue, 5 Feb 2013 03:47:23 +0000 (19:47 -0800)]
syscall: fix marshaling of stat messages on Plan 9

The order of the Qid fields was reversed. Mea culpa.

R=seed
CC=golang-dev
https://golang.org/cl/7231062

12 years agonet/http: add Next Protocol Negotation upgrade support to the Server
Brad Fitzpatrick [Mon, 4 Feb 2013 21:55:38 +0000 (13:55 -0800)]
net/http: add Next Protocol Negotation upgrade support to the Server

This provides the mechanism to connect SPDY support to the http
package, without pulling SPDY into the standard library.

R=rsc, agl, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/7287045

12 years agosyscall: regenerate ztype files for linux
Mikio Hara [Mon, 4 Feb 2013 21:53:58 +0000 (06:53 +0900)]
syscall: regenerate ztype files for linux

This CL adds TCPInfo struct to linux/386,arm.
It's already added to linux/amd64.

Note that not sure the reason but cgo godefs w/ latest gcc
translates a flexible array member in structures correctly,
handles it as a non-incomplete, non-opaque type, on Go 1.
This CL reverts such changes by hand for the Go 1 contract.

R=minux.ma, bradfitz, rsc
CC=golang-dev
https://golang.org/cl/7197046

12 years agonet/http: fix when server deadlines get extended
Brad Fitzpatrick [Mon, 4 Feb 2013 21:52:45 +0000 (13:52 -0800)]
net/http: fix when server deadlines get extended

Deadlines should be extended at the beginning of
a request, not at the beginning of a connection.

Fixes #4676

R=golang-dev, fullung, patrick.allen.higgins, adg
CC=golang-dev
https://golang.org/cl/7220076

12 years agocmd/go: update doc.go
Shenghou Ma [Mon, 4 Feb 2013 21:45:35 +0000 (05:45 +0800)]
cmd/go: update doc.go

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/7279047

12 years agoexp/ssa: (#4 of 5): the SSA builder.
Alan Donovan [Mon, 4 Feb 2013 17:22:35 +0000 (12:22 -0500)]
exp/ssa: (#4 of 5): the SSA builder.

R=iant, gri, iant, rogpeppe
CC=golang-dev
https://golang.org/cl/7196053

12 years agocmd/gc: fix &^ code generation bug
Russ Cox [Mon, 4 Feb 2013 05:21:44 +0000 (00:21 -0500)]
cmd/gc: fix &^ code generation bug

Was not re-walking the new AND node, so that its ullman
count was wrong, so that the code generator attempted to
store values in registers across the call.

Fixes #4752.

R=ken2
CC=golang-dev
https://golang.org/cl/7288054

12 years agonet: use windows sysSocket everywhere
Alex Brainman [Mon, 4 Feb 2013 05:03:41 +0000 (16:03 +1100)]
net: use windows sysSocket everywhere

R=golang-dev, bradfitz, dave
CC=golang-dev
https://golang.org/cl/7273046

12 years agoruntime/debug: add controls for garbage collector
Russ Cox [Mon, 4 Feb 2013 05:00:55 +0000 (00:00 -0500)]
runtime/debug: add controls for garbage collector

Fixes #4090.

R=golang-dev, iant, bradfitz, dsymonds
CC=golang-dev
https://golang.org/cl/7229070

12 years agotime: fix error message from Parse
Russ Cox [Mon, 4 Feb 2013 05:00:36 +0000 (00:00 -0500)]
time: fix error message from Parse

Was incorrectly discarding the offending text in some cases.

Fixes #4493.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7277050

12 years agoregexp: update comment on (*Regexp).Longest
Andrew Gerrand [Mon, 4 Feb 2013 04:57:32 +0000 (15:57 +1100)]
regexp: update comment on (*Regexp).Longest

Missed this review comment.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/7229084

12 years agocmd/go, testing: revise docs for test flags
Russ Cox [Mon, 4 Feb 2013 04:47:03 +0000 (23:47 -0500)]
cmd/go, testing: revise docs for test flags

In cmd/go's 'go help testflag':
* Rewrite list of flags to drop test. prefix on every name.
* Sort list of flags.
* Add example of using -bench to match all benchmarks.

In testing:
* Remove mention of undefined 'CPU group' concept.

Fixes #4488.
Fixes #4508.

R=adg
CC=golang-dev
https://golang.org/cl/7288053

12 years agocontainer/heap: fix package doc comment about ordering.
Nigel Tao [Mon, 4 Feb 2013 04:30:41 +0000 (15:30 +1100)]
container/heap: fix package doc comment about ordering.

R=gri, rsc
CC=golang-dev
https://golang.org/cl/7280044

12 years agoregexp: add (*Regexp).Longest
Andrew Gerrand [Mon, 4 Feb 2013 04:28:55 +0000 (15:28 +1100)]
regexp: add (*Regexp).Longest

Fixes #3696.

R=rsc
CC=golang-dev
https://golang.org/cl/7133051

12 years agotime: deal a bit better with time zones in Parse
Russ Cox [Mon, 4 Feb 2013 04:02:12 +0000 (23:02 -0500)]
time: deal a bit better with time zones in Parse

* Document Parse's zone interpretation.
* Add ParseInLocation (API change).
* Recognize "wrong" time zone names, like daylight savings time in winter.
* Disambiguate time zone names using offset (like winter EST vs summer EST in Sydney).

The final two are backwards-incompatible changes, but I believe
they are both buggy behavior in the Go 1.0 versions; the old results
were more wrong than the new ones.

Fixes #3604.
Fixes #3653.
Fixes #4001.

R=adg
CC=golang-dev
https://golang.org/cl/7288052

12 years agoC: add Alex Bramley (Google CLA)
Russ Cox [Mon, 4 Feb 2013 03:41:24 +0000 (22:41 -0500)]
C: add Alex Bramley (Google CLA)

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7284047

12 years agotime: handle zone file with no transitions
Russ Cox [Mon, 4 Feb 2013 03:41:00 +0000 (22:41 -0500)]
time: handle zone file with no transitions

Code fix by Alex Bramley.

Fixes #4064.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/7289049

12 years agoarchive/tar: add Copyright notice to example_test.go
Andrew Gerrand [Mon, 4 Feb 2013 03:34:35 +0000 (14:34 +1100)]
archive/tar: add Copyright notice to example_test.go

R=golang-dev, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/7278050

12 years agonet: prevent races during windows lookup calls
Alex Brainman [Mon, 4 Feb 2013 02:05:20 +0000 (13:05 +1100)]
net: prevent races during windows lookup calls

This only affects code (with exception of lookupProtocol)
that is only executed on older versions of Windows.

R=rsc, bradfitz
CC=golang-dev
https://golang.org/cl/7293043

12 years agoarchive/tar: Add reader and writer code example.
Robin Eklind [Mon, 4 Feb 2013 01:37:18 +0000 (12:37 +1100)]
archive/tar: Add reader and writer code example.

Remove the previous comment examples.

R=golang-dev, minux.ma, adg
CC=golang-dev
https://golang.org/cl/7220048

12 years agocmd/gc: slightly better code generation
Russ Cox [Sun, 3 Feb 2013 19:51:21 +0000 (14:51 -0500)]
cmd/gc: slightly better code generation

* Avoid treating CALL fn(SB) as justification for introducing
and tracking a registerized variable for fn(SB).

* Remove USED(n) after declaration and zeroing of n.
It was left over from when the compiler emitted more
aggressive set and not used errors, and it was keeping
the optimizer from removing a redundant zeroing of n
when n was a pointer or integer variable.

Update #597.

R=ken2
CC=golang-dev
https://golang.org/cl/7277048

12 years agoA+C: add Yusuke Kagiwada (Individual CLA)
Brad Fitzpatrick [Sun, 3 Feb 2013 19:42:51 +0000 (11:42 -0800)]
A+C: add Yusuke Kagiwada (Individual CLA)

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/7292043

12 years agocmd/gc: implement latest rules for checking make sizes
Russ Cox [Sun, 3 Feb 2013 19:28:44 +0000 (14:28 -0500)]
cmd/gc: implement latest rules for checking make sizes

Fixes #4085.

R=ken2
CC=golang-dev
https://golang.org/cl/7277047

12 years agocmd/go: update 'go get' help message
Russ Cox [Sun, 3 Feb 2013 18:08:23 +0000 (13:08 -0500)]
cmd/go: update 'go get' help message

It accepts all the build flags.
Say that instead of making a copy that will go stale.

Fixes #4742.

R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/7229081

12 years agocmd/5l, cmd/ld: support generating ELF binaries for NetBSD/ARM
Shenghou Ma [Sun, 3 Feb 2013 16:40:11 +0000 (00:40 +0800)]
cmd/5l, cmd/ld: support generating ELF binaries for NetBSD/ARM

R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/7261043

12 years agoxml: omit newline at beginning of MarshalIndent output
Shivakumar GN [Sun, 3 Feb 2013 16:21:07 +0000 (11:21 -0500)]
xml: omit newline at beginning of MarshalIndent output

(Still valid XML.)

Fixes #3354.

R=golang-dev, dave
CC=golang-dev
https://golang.org/cl/7288047

12 years agocmd/gc: make inlined labels distinct
Russ Cox [Sun, 3 Feb 2013 16:19:22 +0000 (11:19 -0500)]
cmd/gc: make inlined labels distinct

Fixes #4748.

R=ken2
CC=golang-dev
https://golang.org/cl/7261044

12 years agocmd/gc: clean up string index errors
Russ Cox [Sun, 3 Feb 2013 07:01:05 +0000 (02:01 -0500)]
cmd/gc: clean up string index errors

Unify with array/slice errors, which were already good.

Fixes #4232.

R=ken2
CC=golang-dev
https://golang.org/cl/7271046

12 years agocmd/gc: update ideal bool rules to match latest spec
Russ Cox [Sun, 3 Feb 2013 06:44:03 +0000 (01:44 -0500)]
cmd/gc: update ideal bool rules to match latest spec

Fixes #3915.
Fixes #3923.

R=ken2
CC=golang-dev
https://golang.org/cl/7281044

12 years agoexp/gotype: disable broken test
Russ Cox [Sun, 3 Feb 2013 06:25:58 +0000 (01:25 -0500)]
exp/gotype: disable broken test

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/7275045

12 years agocmd/gc: remove reference to ? and @ symbols in error message
Russ Cox [Sun, 3 Feb 2013 06:25:47 +0000 (01:25 -0500)]
cmd/gc: remove reference to ? and @ symbols in error message

Those symbols are only allowed during imports;
the parser may expect them but saying that doesn't help users.

Fixes #3434.

R=ken2
CC=golang-dev
https://golang.org/cl/7277045

12 years agocmd/gc: elide self-assignment during return
Russ Cox [Sun, 3 Feb 2013 06:18:28 +0000 (01:18 -0500)]
cmd/gc: elide self-assignment during return

More efficient, less racy code.

Fixes #4014.

R=ken2, ken
CC=golang-dev
https://golang.org/cl/7275047

12 years agocmd/gc: allow new conversion syntax
Russ Cox [Sun, 3 Feb 2013 05:03:10 +0000 (00:03 -0500)]
cmd/gc: allow new conversion syntax

For consistency with conversions that look like function calls,
conversions that don't look like function calls now allow an
optional trailing comma.

That is, int(x,) has always been syntactically valid.
Now []int(x,) is valid too.

Fixes #4162.

R=ken2
CC=golang-dev
https://golang.org/cl/7288045

12 years agocmd/gc: treat &T{} like new(T): allocate on stack if possible
Russ Cox [Sun, 3 Feb 2013 04:54:21 +0000 (23:54 -0500)]
cmd/gc: treat &T{} like new(T): allocate on stack if possible

Fixes #4618.

R=ken2
CC=golang-dev
https://golang.org/cl/7278048

12 years agocmd/gc: avoid duplicate allocation during inlining
Russ Cox [Sun, 3 Feb 2013 04:17:25 +0000 (23:17 -0500)]
cmd/gc: avoid duplicate allocation during inlining

Fixes #4667.

R=ken2
CC=golang-dev
https://golang.org/cl/7275046

12 years agocmd/gc: remove spurious newline from node dump
Russ Cox [Sun, 3 Feb 2013 04:09:49 +0000 (23:09 -0500)]
cmd/gc: remove spurious newline from node dump

R=ken2
CC=golang-dev
https://golang.org/cl/7276048

12 years agotesting: add AllocsPerRun
Kyle Lemons [Sun, 3 Feb 2013 03:52:29 +0000 (22:52 -0500)]
testing: add AllocsPerRun

This CL also replaces similar loops in other stdlib
package tests with calls to AllocsPerRun.

Fixes #4461.

R=minux.ma, rsc
CC=golang-dev
https://golang.org/cl/7002055

12 years agolib9/main.c: don't show the crash dialog on windows
Shenghou Ma [Sat, 2 Feb 2013 22:11:25 +0000 (06:11 +0800)]
lib9/main.c: don't show the crash dialog on windows
Fixes #3202. (Or rather, work around issue 3202)

R=alex.brainman, rsc
CC=golang-dev
https://golang.org/cl/7202053

12 years agocmd/go: run examples in source order, not name order
Russ Cox [Sat, 2 Feb 2013 21:26:12 +0000 (16:26 -0500)]
cmd/go: run examples in source order, not name order

Add Order field to doc.Example and write doc comments there.

Fixes #4662.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/7229071

12 years agoruntime: fix windows build
Ian Lance Taylor [Sat, 2 Feb 2013 19:41:04 +0000 (11:41 -0800)]
runtime: fix windows build

Fixes #4743.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7284044

12 years agosyscall: (*Proc).Call should return nil error when no error occurs
Shenghou Ma [Sat, 2 Feb 2013 17:42:17 +0000 (01:42 +0800)]
syscall: (*Proc).Call should return nil error when no error occurs
Fixes #4686.

R=alex.brainman, rsc
CC=golang-dev
https://golang.org/cl/7174047

12 years agosrc: add race.bat
Shenghou Ma [Sat, 2 Feb 2013 16:49:37 +0000 (00:49 +0800)]
src: add race.bat

R=golang-dev, dave, alex.brainman
CC=golang-dev
https://golang.org/cl/7133064