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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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