1
0
mirror of https://github.com/golang/go synced 2024-10-04 16:31:22 -06:00
Commit Graph

2786 Commits

Author SHA1 Message Date
Russ Cox
a34f1bbb22 gofix: new command for updating code to new release
R=bradfitzgo, dsymonds, r, gri, adg
CC=golang-dev
https://golang.org/cl/4282044
2011-03-15 14:15:41 -04:00
Russ Cox
e72156b316 remove unused labels
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/4274052
2011-03-15 14:05:07 -04:00
Brad Fitzpatrick
f192891786 httptest: default the Recorder status code to 200 on a Write
This matches the real ResponseWriter behavior.

R=rsc
CC=golang-dev
https://golang.org/cl/4291048
2011-03-15 10:13:25 -07:00
Brad Fitzpatrick
5245b27ed8 openpgp: add PublicKey KeyId string accessors
R=agl, agl1
CC=golang-dev
https://golang.org/cl/4297041
2011-03-15 10:06:17 -07:00
Rob Pike
a569725141 rpc: add buffering to the encode path.
This reduces the number of writes by 2 (1 client, 1 server) on each round trip.
A simple test shows 24% higher throughput.

R=rsc
CC=golang-dev
https://golang.org/cl/4279057
2011-03-15 10:02:44 -07:00
Dave Cheney
43ae7da190 crypto/tls: fix compile error
Fixes #1555.

R=rsc, bradfitzgo
CC=golang-dev
https://golang.org/cl/4284047
2011-03-12 19:35:41 -08:00
Brad Fitzpatrick
3479bb6c12 ioutil: add NopCloser
R=rsc, dsymonds
CC=golang-dev
https://golang.org/cl/4278044
2011-03-12 16:05:07 -08:00
Brad Fitzpatrick
1c96562f36 http: use Header.Del not empty Set(k, "")
Also don't serialize empty headers.

R=dsymonds, rsc
CC=golang-dev
https://golang.org/cl/4275045
2011-03-12 09:58:53 -08:00
Rob Pike
a7528f1b81 runtime/proc.c: which to that
R=iant, dho
CC=golang-dev
https://golang.org/cl/4286044
2011-03-11 18:18:59 -08:00
Ian Lance Taylor
5e963a826c runtime: reduce lock contention via wakeup on scheduler unlock.
R=rsc
CC=golang-dev
https://golang.org/cl/4275043
2011-03-11 18:14:45 -08:00
Ian Lance Taylor
c01238a571 net: don't loop to drain wakeup pipe.
The loop always makes an extra system call.  It only makes a
difference if more than 100 goroutines started waiting for
something to happen on a network file descriptor since the
last time the pipe was drained, which is unlikely since we
will be woken up the first time a goroutine starts waiting.
If we don't drain the pipe this time, we'll be woken up again
right away and can drain again.

R=rsc
CC=golang-dev
https://golang.org/cl/4275042
2011-03-11 18:01:28 -08:00
Rob Pike
5df1cf0475 gob: use bufio on the decode to avoid a system call on each read.
Add a benchmark.
BenchmarkEndToEndPipe gives 14.3microseconds/op before,
13.1microseconds/op after, or about 76e3 round trips per second
through the kernel.
With a bytes buffer, and therefore no system calls for I/O, the
numbers go to 7.3microseconds/op, or about 137e3 round trips
per second.

R=rsc
CC=golang-dev
https://golang.org/cl/4279045
2011-03-11 16:24:09 -08:00
Robert Griesemer
c734b50b11 gotype: clean handling of stdin, added tests
- removed uses of global variables
- minor cleanups

R=r
CC=golang-dev
https://golang.org/cl/4277044
2011-03-11 16:15:33 -08:00
Robert Griesemer
86e35a96a7 go/typechecker: fix build
R=rsc
CC=golang-dev
https://golang.org/cl/4278043
2011-03-11 14:46:36 -08:00
Robert Griesemer
7664ec39b8 go/parser: first constant in a constant declaration must have a value
R=r, rsc1
CC=golang-dev
https://golang.org/cl/4291042
2011-03-11 14:33:31 -08:00
Russ Cox
591c74ad20 runtime: split non-debugging malloc interface out of debug.go into mem.go
R=r, dsymonds
CC=golang-dev
https://golang.org/cl/4273045
2011-03-11 15:09:21 -05:00
Russ Cox
3f915f51a8 go code: replace closed(c) with x, ok := <-c
R=golang-dev, rog, bradfitzwork, r
CC=golang-dev
https://golang.org/cl/4243072
2011-03-11 14:47:44 -05:00
Russ Cox
8bf34e3356 gc, runtime: replace closed(c) with x, ok := <-c
R=ken2, ken3
CC=golang-dev
https://golang.org/cl/4259064
2011-03-11 14:47:26 -05:00
Brad Fitzpatrick
d3d672998f http: rename interface Transport to RoundTripper
Transport.Do -> RoundTripper.RoundTrip

This makes way for a subsequent CL to export the
currently private RoundTripper implementation
as struct Transport.

R=rsc, r
CC=golang-dev
https://golang.org/cl/4286043
2011-03-11 11:32:33 -08:00
Robert Griesemer
dbff0adaa7 gotype: commandline tool to typecheck go programs
First version. Handles scope analysis only at the
moment.

R=rsc, r, eds
CC=golang-dev
https://golang.org/cl/4259065
2011-03-11 10:27:25 -08:00
Brad Fitzpatrick
9554e67188 http: fix transport crash when request URL is nil
Fixes #1602

R=rsc, petar-m
CC=golang-dev
https://golang.org/cl/4284043
2011-03-11 09:54:31 -08:00
Robert Griesemer
478f08a517 io/ioutil: clean-up of ReadAll and ReadFile
Make ReadAll use the same mechanism as ReadFile.

R=r
CC=golang-dev
https://golang.org/cl/4279041
2011-03-10 16:41:54 -08:00
Robert Griesemer
2e8b375e0e go/ast: fix printing of maps
Print a newline after each map entry;
similar to the style used for slices
and structs.

R=r, r2
CC=golang-dev
https://golang.org/cl/4274042
2011-03-10 16:00:39 -08:00
Robert Griesemer
f1fee448bc go/ast: ast.Print needs a file set to print position values nicely
Also removed a TODO (AST nodes have been restructured a while ago).

R=r
CC=golang-dev
https://golang.org/cl/4245077
2011-03-10 12:54:33 -08:00
Rob Pike
034ca39e56 flag: visit the flags in sorted order, for better messages.
Fixes #1601.

R=rsc
CC=golang-dev
https://golang.org/cl/4249070
2011-03-10 12:42:31 -08:00
Brad Fitzpatrick
bbad6900ce http: run tests even with DISABLE_NET_TESTS=1
All tests are now localhost only.

R=rsc
CC=golang-dev
https://golang.org/cl/4271042
2011-03-10 10:19:11 -08:00
Brad Fitzpatrick
8e1fa76047 http: don't hit external network in client_test.go
More reliable.

R=rsc
CC=golang-dev
https://golang.org/cl/4249068
2011-03-10 08:46:57 -08:00
Brad Fitzpatrick
aae7b695ac http: move RemoteAddr & UsingTLS from ResponseWriter to Request
ResponseWriter.RemoteAddr() string -> Request.RemoteAddr string
ResponseWriter.UsingTLS() bool -> Request.TLS *tls.ConnectionState

R=rsc, bradfitzwork
CC=gburd, golang-dev
https://golang.org/cl/4248075
2011-03-10 08:17:22 -08:00
Adam Langley
ee23ab16da crypto/openpgp: s/serialise/serialize/
(No code changes, Americanization only.)

R=rsc, bradfitzwork
CC=golang-dev
https://golang.org/cl/4250075
2011-03-10 10:36:04 -05:00
Brad Fitzpatrick
dc06ad5ad7 tls: move PeerCertificates to ConnectionState
R=agl, agl1
CC=golang-dev, rsc
https://golang.org/cl/4248078
2011-03-10 07:22:53 -08:00
Adam Langley
dd5adcc3c3 crypto/openpgp: bug fixes and fix misnamed function.
R=rsc, bradfitzwork
CC=golang-dev
https://golang.org/cl/4244066
2011-03-10 10:14:31 -05:00
Adam Langley
daf33c3ebe crypto/elliptic: add the N value of each curve.
R=rsc
CC=golang-dev
https://golang.org/cl/4240104
2011-03-10 10:04:06 -05:00
Adam Langley
f422242065 crypto/ecdsa: add package.
R=rsc, cw
CC=golang-dev
https://golang.org/cl/4253073
2011-03-10 09:42:34 -05:00
Rob Pike
f8f3145a08 gob: turn two panics into errors because they can be triggered
by bogus data, or are in any case recoverable.

Fixes #1598.

R=rsc
CC=golang-dev
https://golang.org/cl/4240101
2011-03-09 17:30:27 -08:00
Rob Pike
a16af59fd1 fmt: heaven forfend we export EOF = -1
R=adg
CC=golang-dev
https://golang.org/cl/4248076
2011-03-09 16:53:32 -08:00
Ian Lance Taylor
8206cce117 syslog: split Unix domain support from network support.
This is to make it easier to support Solaris syslog.  On
Solaris syslog messages are sent via STREAMS using putmsg to
/dev/conslog.  The putmsg call uses a a control buffer of type
log_cdtl and a data buffer which is the message, and it is in
general a big mess.  This CL just splits out the Unix domain
support so that Solaris can use a different mechanism.  I do
not propose to implement the Solaris support today.  This
split will make it possible for gccgo to just call the libc
function for now.

R=r, rsc
CC=golang-dev
https://golang.org/cl/4261061
2011-03-09 13:15:46 -08:00
Brad Fitzpatrick
ec5c475919 http: add Flusher type; remove Flush from ResponseWriter
The Flush functionality wasn't removed, but now you have
to test if your ResponseWriter is also a Flusher:

func ServeHTTP(rw http.ResponseWriter, req *http.Request) {
   if f, ok := rw.(http.Flusher); ok {
       f.Flush()
   }
}

R=rsc, bradfitzwork
CC=gburd, golang-dev
https://golang.org/cl/4239077
2011-03-09 10:24:50 -08:00
Rob Pike
2ac4d5270f rpc: delete unused field from InvalidRequest struct.
Was a mysterious holdover from an attempt to fix a problem
long-resolved, I think.

R=rsc, r2
CC=golang-dev
https://golang.org/cl/4243066
2011-03-09 10:02:17 -08:00
Roger Peppe
3a95587e01 fmt: make ScanState.Token more general.
When writing custom scanners, I found that
Token itself was rarely useful, as I did not always
want to stop at white space. This change makes
it possible to stop at any class of characters
while reusing the buffer within State.
(also fix a bug in Token)

R=r, r2
CC=golang-dev
https://golang.org/cl/4243055
2011-03-09 10:01:47 -08:00
Brad Fitzpatrick
2c420ece67 http: change ResponseWriter.SetHeader(k,v) to Header() accessor
Caller code needs to change:

rw.SetHeader("Content-Type", "text/plain")
to:
rw.Header().Set("Content-Type", "text/plain")

This now permits returning multiple headers
with the same name using Add:

rw.Header().Add("Set-Cookie", "..")
rw.Header().Add("Set-Cookie", "..")

This patch also fixes serialization of headers, removing newline characters.

Fixes #488
Fixes #914

R=rsc
CC=gburd, golang-dev
https://golang.org/cl/4239076
2011-03-09 09:41:01 -08:00
David Anderson
ad102e143c syscall: implement Mount and Unmount for linux.
Note that, while the final argument of mount(2) is a void*, in
practice all filesystem implementations treat it as a string
of comma-separated mount options.

R=bradfitzgo, bradfitzwork
CC=golang-dev
https://golang.org/cl/4247070
2011-03-09 05:58:47 -08:00
David Anderson
05660b79ea syscall: implement Reboot for linux.
The published interface is the simple version of the syscall,
allowing all reboot functions except for the esoteric
LINUX_REBOOT_CMD_RESTART2.

R=golang-dev, bradfitzgo, bradfitzwork
CC=golang-dev
https://golang.org/cl/4256060
2011-03-09 05:45:08 -08:00
Nigel Tao
78879b3b8b compress/lzw: benchmark a range of input sizes.
R=rsc, nigeltao_gnome
CC=golang-dev
https://golang.org/cl/4240096
2011-03-09 16:32:02 +11:00
Robert Griesemer
758d05551d big: implemented custom Gob(En/De)coder for Int type
- factored implementation of Int.Bytes, Int.SetBytes
  and replaced existing code with much simpler cores
- use the shared bytes, setBytes routines for Gob
  (en/de)coding

Fixes #1496.

R=r, eds
CC=golang-dev
https://golang.org/cl/4249063
2011-03-08 17:27:44 -08:00
Rob Pike
8138654aa8 govet: handle '*' in print format strings.
While we're on govet, fix a couple of mistakes in a test.

Fixes #1592.

R=rsc
CC=golang-dev
https://golang.org/cl/4239071
2011-03-08 14:36:56 -08:00
Brad Fitzpatrick
64f75f1034 strings: better benchmark names; add BenchmarkIndex
R=dsymonds
CC=golang-dev
https://golang.org/cl/4264052
2011-03-08 09:58:18 -08:00
Brad Fitzpatrick
145108ed36 strings: add IndexRune tests, ASCII fast path
$ gotest -test.v -test.run=IndexRune -test.bench=.*
=== RUN  strings_test.TestIndexRune
--- PASS: strings_test.TestIndexRune (0.0 seconds)
PASS
strings_test.BenchmarkIndexRune	20000000   105 ns/op
strings_test.BenchmarkIndexByte	50000000    48 ns/op

R=rsc, dsymonds
CC=golang-dev
https://golang.org/cl/4267050
2011-03-08 09:41:12 -08:00
Peter Mundy
87aa93457e time: fix Time.ZoneOffset documentation
R=rsc
CC=golang-dev
https://golang.org/cl/4240090
2011-03-08 12:33:49 -05:00
Brad Fitzpatrick
d64a18a27e cgi: child support (e.g. Go CGI under Apache)
The http/cgi package now supports both being
a CGI host or being a CGI child process.

R=rsc, adg, bradfitzwork
CC=golang-dev
https://golang.org/cl/4245070
2011-03-08 08:01:19 -08:00
Rob Pike
8c76218f89 gob: finish up GobEncoder/Decoder by providing indirection
to the receiver. Remove lots of TODOS.

R=rsc
CC=golang-dev
https://golang.org/cl/4257057
2011-03-08 00:02:07 -08:00