1
0
mirror of https://github.com/golang/go synced 2024-10-04 12:21:26 -06:00
Commit Graph

3334 Commits

Author SHA1 Message Date
Russ Cox
16dbf2182c undo CL 4557058 / b4c2ffae7034
Using the getaddrinfo order is only okay if we
are smart enough to try multiple addresses in Dial.
Since the code does not do that, we must make
the right first choice, regardless of what getaddrinfo
does, and more often that not that means using the
IPv4 address, even on IPv6 systems.  With the CL
applied, gotest fails in package net on OS X.

helix.cam=; gotest
...
--- FAIL: net.TestDialGoogleIPv4 (1.05 seconds)
        -- 74.125.226.179:80 --
        -- www.google.com:80 --
        Dial("tcp", "", "www.google.com:80") = _, dial tcp [2001:4860:800f::69]:80: address family not supported by protocol family
        -- 74.125.226.179:http --
        -- www.google.com:http --
        Dial("tcp", "", "www.google.com:http") = _, dial tcp [2001:4860:800f::69]:80: address family not supported by protocol family
        -- 074.125.226.179:0080 --
        -- [::ffff:74.125.226.179]:80 --
        -- [::ffff:4a7d:e2b3]:80 --
        -- [0:0:0:0:0000:ffff:74.125.226.179]:80 --
        -- [0:0:0:0:000000:ffff:74.125.226.179]:80 --
        -- [0:0:0:0:0:ffff::74.125.226.179]:80 --
FAIL
gotest: "./6.out" failed: exit status 1

««« original CL description
net: name-based destination address selection

getaddrinfo() orders the addresses according to RFC 3484.

This means when IPv6 is working on a host we get results like:
    []string = {"2001:4810::110", "66.117.47.214"}

and when it's not working we get:
    []string = {"66.117.47.214", "2001:4810::110"}

thus can drop firstFavoriteAddr.

This also means /etc/gai.conf works on relevant systems.

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

»»»

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/4532101
2011-06-01 15:49:57 -04:00
Adam Langley
e0cca45fcb crypto/openpgp: add support for symmetrically encrypting files.
This mostly adds the infrastructure for writing various forms of
packets as well as reading them. Adding symmetric encryption support
was simply an easy motivation.

There's also one brown-paper-bag fix in here. Previously I had the
conditional for the MDC hash check backwards: the code was checking
that the hash was *incorrect*. This was neatly counteracted by another
bug: it was hashing the ciphertext of the OCFB prefix, not the
plaintext.

R=bradfitz
CC=golang-dev
https://golang.org/cl/4564046
2011-06-01 15:23:22 -04:00
Mikkel Krautz
2899535de5 asn1: fix marshalling of empty optional RawValues
This fixes creation of X509 certificates with
RSA keys. (Broken by e5ecc416f2fd)

R=agl
CC=golang-dev
https://golang.org/cl/4553052
2011-06-01 12:54:16 -04:00
Luuk van Dijk
2c4edb0eea gc: make merely referencing an outer variable in a closure not force heapallocation.
before: runtime_test.BenchmarkCallClosure1       20000000              135 ns/op
after:  runtime_test.BenchmarkCallClosure1      500000000                6 ns/op

R=rsc
CC=golang-dev
https://golang.org/cl/4527091
2011-06-01 17:02:43 +02:00
Rob Pike
dcbf59cb4e path/filepath: clean up a triple negative.
also make the error prints better in the test.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4556069
2011-06-01 14:17:09 +10:00
David Symonds
32e3644883 mail: new package.
Basic parsing, plus date parsing.

R=bradfitz, gary.burd, bsiegert, rsc
CC=golang-dev
https://golang.org/cl/4530079
2011-06-01 14:10:21 +10:00
Yuval Pavel Zholkover
f74f50e046 Make unix Readdir and windows Readdirnames return partially successful results on error.
Make plan 9 Readdir & Readdirnames return os.EOF at end.
Also fix typos in the unix and windows comments.

R=golang-dev, fshahriar, bradfitz, rsc, r
CC=golang-dev
https://golang.org/cl/4557053
2011-06-01 13:12:37 +10:00
Rob Pike
73d57642a4 filepath: remove string constants. They are unnecessary.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4527090
2011-06-01 13:06:04 +10:00
Rob Pike
9ec0c01e19 unicode: guarantee that the 32-bit range tables contain only
values >= 16 bits, so the lookup code can be smaller in the
common case.
Also make CaseRange uint32s rather than ints, so if we go to
64-bit ints we don't waste more space.

R=rsc
CC=golang-dev
https://golang.org/cl/4550094
2011-06-01 09:49:51 +10:00
William Chan
fecab40586 http/spdy: fix data race in header decompression.
flate's reader greedily reads from the shared io.Reader in Framer. This leads to a data race on Framer.r. Fix this by providing a corkedReader to zlib.NewReaderDict(). We uncork the reader and allow it to read the number of bytes in the compressed payload.

Fixes #1884.

R=bradfitz, rsc, go.peter.90
CC=golang-dev
https://golang.org/cl/4530089
2011-05-31 14:05:35 -07:00
Russ Cox
4706ce309f net: stop Mac popups
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/4559059
2011-05-31 16:15:23 -04:00
Adam Langley
c72dbaf312 encoding/hex: don't try to print DEL.
R=agl
CC=golang-dev
https://golang.org/cl/4551081
2011-05-31 15:40:33 -04:00
Luuk van Dijk
9b82408f6d gc: elide call to runtime.closure for function literals called in-place.
before:
runtime_test.BenchmarkCallClosure        5000000               499 ns/op
runtime_test.BenchmarkCallClosure1       5000000               681 ns/op

after:
runtime_test.BenchmarkCallClosure       500000000                5 ns/op
runtime_test.BenchmarkCallClosure1       10000000              160 ns/op

R=rsc
CC=golang-dev
https://golang.org/cl/4515167
2011-05-31 20:52:21 +02:00
Russ Cox
2261021be1 undo CL 4515163 / 42c3cfa4d64f
breaks Mac build

««« original CL description
runtime: use HOST_CC to compile mkversion

HOST_CC is set in Make.inc, so use that rather
than hardcoding quietgcc

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

»»»

R=iant
CC=golang-dev
https://golang.org/cl/4515168
2011-05-31 14:24:21 -04:00
Dave Cheney
fd0cf08748 runtime: use HOST_CC to compile mkversion
HOST_CC is set in Make.inc, so use that rather
than hardcoding quietgcc

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/4515163
2011-05-31 10:46:11 -07:00
Adam Langley
de15f6165e encoding/hex: add hex dumping.
I found this useful, esp with an io.MultiWriter. But I fear that
it may be bloat in such a low-level package so please feel free to
decline if you feel likewise.

R=rsc, ality
CC=golang-dev
https://golang.org/cl/4530088
2011-05-31 12:58:09 -04:00
Brad Fitzpatrick
219805066e http: have client set Content-Length when possible
Also some cleanup, removing redundant code. Make more
things use NewRequest. Add some tests, docs.

R=golang-dev, adg, rsc
CC=golang-dev
https://golang.org/cl/4561047
2011-05-31 08:47:03 -07:00
Christopher Wedgwood
50effb654c net: name-based destination address selection
getaddrinfo() orders the addresses according to RFC 3484.

This means when IPv6 is working on a host we get results like:
    []string = {"2001:4810::110", "66.117.47.214"}

and when it's not working we get:
    []string = {"66.117.47.214", "2001:4810::110"}

thus can drop firstFavoriteAddr.

This also means /etc/gai.conf works on relevant systems.

R=rsc, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/4557058
2011-05-31 11:40:11 -04:00
Dmitriy Vyukov
91cc1e6b77 runtime: reset GOMAXPROCS during tests
Fix the fact that the test leaves GOMAXPROCS=3
and a running goroutine behind.

R=golang-dev, rsc
CC=dvyukov, golang-dev
https://golang.org/cl/4517121
2011-05-31 10:38:51 -04:00
Vincent Vanackere
f18a4e9609 syscall : add ProcAttr field to pass an unescaped command line on windows
On windows, the command line is passed as a single null-terminated string. While the automatic parameter escaping done by syscall.StartProcess works fine with most Windows programs, some applications do their own custom parsing of the command line, in which case the automatic escaping becomes harmful.
This CL adds a new extra CmdLine field to syscall.ProcAttr that will be used as the raw/unescaped command line if not empty.
Fixes #1849.

R=golang-dev, alex.brainman, bradfitz, rsc
CC=golang-dev
https://golang.org/cl/4548050
2011-05-31 10:21:38 -04:00
Alexey Borzenkov
c4206cb231 runtime: save cdecl registers in Windows SEH handler
Fixes #1779

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4566041
2011-05-31 10:11:47 -04:00
Gustavo Niemeyer
463f478dbb filepath: Abs must always return a clean path
When I was first coding Abs, I wondered if people wouldn't
expect the path to be consistently clean, even if the path
passed in was already absolute.

CL 4524078 has a potential problem based on exactly that
assumption, so it feels like this behavior is indeed the
most useful and least surprising.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/4548074
2011-05-30 22:28:59 -03:00
Rob Pike
0de328edd6 unicode: make the tables smaller.
By splitting the ranges into 16-bit values and 32-bit values,
we can reduce about 3000 entries by 48 bits per entry, or about
16KB, at the cost of a little more complexity in the code.

R=iant, bradfitz, rsc, r
CC=golang-dev
https://golang.org/cl/4547066
2011-05-31 09:58:07 +10:00
Gustavo Niemeyer
87dbec54bb template: fix and clean interaction between quotes and formatters
Fixes issue #1897.

R=r, gustavo, r
CC=golang-dev
https://golang.org/cl/4561049
2011-05-30 11:53:09 -03:00
Robert Hencke
3fbd478a8a pkg: spelling tweaks, I-Z
also, a few miscellaneous fixes to files outside pkg

R=golang-dev, dsymonds, mikioh.mikioh, r
CC=golang-dev
https://golang.org/cl/4517116
2011-05-30 18:02:59 +10:00
Nigel Tao
a479bc8d02 image/png: fix encoding of images that don't start at (0, 0).
R=r
CC=golang-dev
https://golang.org/cl/4560049
2011-05-30 10:55:37 +10:00
David Symonds
5d5d84f3df gob: fix documentation on Decoder.Decode.
R=r, adg
CC=golang-dev
https://golang.org/cl/4515159
2011-05-30 10:48:08 +10:00
Brad Fitzpatrick
da32ed7bf1 http: let Transport use a custom net.Dial function
Permits the use of SOCKS proxy dialer with
the transport.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/4536091
2011-05-29 09:32:36 -07:00
Rob Pike
62943df829 template: cosmetic cleanups.
Remove the idea of space being white.  Sometimes space is green.
Simplify a comment and remove the Latin.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4532096
2011-05-29 16:13:41 +10:00
Gustavo Niemeyer
e11d94fcd7 template: fix quote-handling with formatters
Fixes issue #1896.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4539093
2011-05-29 00:23:32 -03:00
Yasuhiro Matsumoto
0f4510b370 os: fix os.MkdirAll with backslash path separator.
MkdirAll() need to use isSeparator().
Move primary defines of filepath.Separator/filepath.ListSeparator
 to os.PathSeparator/os.PathListSeparator.
Move filepath.isSeparator() to os.IsPathSeparator().
filepath package refer them from os package.
Fixes #1831.

R=rsc, alex.brainman
CC=golang-dev
https://golang.org/cl/4535100
2011-05-29 13:03:49 +10:00
Alex Brainman
505f0bb3ce os: fix windows version of Readdir(0)
Fixes #1893.

R=golang-dev
CC=bradfitz, golang-dev
https://golang.org/cl/4528106
2011-05-29 11:59:35 +10:00
Alex Brainman
b7582852f6 gotest, pkg/exec: use bash instead of sh to execute shell scripts on windows
As suggested by dho, iant2.

R=golang-dev, rsc
CC=devon.odell, golang-dev, iant
https://golang.org/cl/4515147
2011-05-28 21:26:03 +10:00
Evan Shaw
f369fc09f4 go/scanner: don't allow "0x" and "0X" as integers
R=gri
CC=golang-dev
https://golang.org/cl/4560047
2011-05-27 16:47:26 -07:00
Brad Fitzpatrick
399a311e64 http: client+server benchmark
baseline runs: (6g, gopher.mtv)

http_test.BenchmarkClientServer  5000  412588 ns/op
http_test.BenchmarkClientServer  5000  403346 ns/op
http_test.BenchmarkClientServer  5000  413936 ns/op
http_test.BenchmarkClientServer  5000  410287 ns/op
http_test.BenchmarkClientServer  5000  388037 ns/op
http_test.BenchmarkClientServer  5000  405545 ns/op
http_test.BenchmarkClientServer  5000  405179 ns/op
http_test.BenchmarkClientServer  5000  413827 ns/op
http_test.BenchmarkClientServer  5000  392723 ns/op

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4515155
2011-05-27 16:43:02 -07:00
Brad Fitzpatrick
f7a266a5aa encoding/binary: add a non-reflect fast path for Write
before/after:
binary.BenchmarkWrite	  100000	     18312 ns/op
binary.BenchmarkWrite	  500000	      4468 ns/op

R=rsc, gri
CC=golang-dev
https://golang.org/cl/4515154
2011-05-27 16:29:33 -07:00
Evan Shaw
3b980579b4 big: make Int and Rat implement fmt.Scanner
R=gri
CC=golang-dev
https://golang.org/cl/4552056
2011-05-27 15:51:00 -07:00
Rob Pike
5a35757f3f time: midnight is 12AM.
This is the other half of the problem fixed at noon by the previous change.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/4515150
2011-05-28 07:06:53 +10:00
Brad Fitzpatrick
685a8157e6 os: yet more Readdir tests and fix earlier regression
R=golang-dev, fshahriar
CC=golang-dev
https://golang.org/cl/4548068
2011-05-27 12:58:59 -07:00
Brad Fitzpatrick
0e865ab8e7 os: improve Readdir test coverage, fix Readdir(0) on EOF
Adds tests for Readdir and Readdirnames with different n
values.  No good way to inject faults during full reads,
though.

Also fixes bug report from fshahriar:
Readdir(0) wasn't behaving like Readdir(-1).

R=rsc, fshahriar
CC=golang-dev
https://golang.org/cl/4529092
2011-05-27 12:14:48 -07:00
Brad Fitzpatrick
0b204e4625 http: propagate Set-Cookie in reverse proxy
Also adds Host header tests.

Fixes #1886

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4556063
2011-05-27 11:06:53 -07:00
Brad Fitzpatrick
b88be14982 http/spdy: temporarily disable some failing tests
Issue 1886 has details

R=golang-dev, willchan
CC=golang-dev
https://golang.org/cl/4527083
2011-05-27 10:08:31 -07:00
Rob Pike
406d73876d time: fix Format bug: noon is 12PM, not 0PM.
Fixes #1882.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4556062
2011-05-27 23:24:39 +10:00
Rob Pike
a1d2cbf645 crypto/tls/generate_cert.go: fix misspelling of O_CREATE.
Fixes #1888.

R=ken
CC=golang-dev
https://golang.org/cl/4515148
2011-05-27 21:06:50 +10:00
Alex Brainman
cb96d98b06 os: another attempt to handle OpenFile flag parameter properly on Windows
Fixes #1791.

R=rsc, r, r, iant
CC=golang-dev
https://golang.org/cl/4551046
2011-05-27 17:02:24 +10:00
Dmitry Chestnykh
e4492ce3c3 runtime: fix mmap error return on linux.
Fixes #1511 again.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/4527070
2011-05-26 21:43:27 -07:00
Mikio Hara
12376c93ef syscall: add routing messages support for BSD variants
R=rsc
CC=golang-dev
https://golang.org/cl/4539084
2011-05-26 20:02:03 -04:00
Alex Brainman
86327cdcf5 os: TestMkdirAll should not fail to delete _test/_TestMkdirAll_ on Windows
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4515142
2011-05-27 09:52:15 +10:00
Mikio Hara
4d118835ab syscall: add routing messages support for Linux
R=rsc
CC=golang-dev
https://golang.org/cl/4515135
2011-05-26 17:04:58 -04:00
Ivan Krasin
1b5d04c5ae compress/flate: fix Huffman tree bug
Incorporate refactoring and a regression test from https://golang.org/cl/4538090/

R=rsc, go.peter.90, imkrasin
CC=golang-dev, mirtchovski
https://golang.org/cl/4524070
2011-05-26 17:02:11 -04:00
Robert Griesemer
e8c87a7ddd fix build: temporarily disable the use of strings.Reader UnreadRune in fmt
R=r
CC=golang-dev
https://golang.org/cl/4532090
2011-05-26 11:54:10 -07:00
Robert Griesemer
5b1fb9d5c6 io: add ByteScanner, RuneScanner interfaces
R=r, rsc
CC=golang-dev
https://golang.org/cl/4530069
2011-05-26 11:03:52 -07:00
Robert Griesemer
9cd3372f9b strings: implement UnreadByte, UnreadRune
Added corresponding tests.

R=rsc
CC=golang-dev
https://golang.org/cl/4560045
2011-05-26 11:02:07 -07:00
William Chan
abb970ef57 http/spdy: redo interfaces, flesh out implementation & frame types
Added a new Framer to handle reading/writing Frames. This is necessary since we have to maintain a compression context across streams.

TODO:
* Separate the types and read/write routines into different files.
* Improve error handling.

R=bradfitz, rsc
CC=golang-dev
https://golang.org/cl/4503042
2011-05-26 09:54:54 -07:00
Brad Fitzpatrick
3648a03b3a encoding/binary: add a non-reflect fast path for Read
before/after:
binary.BenchmarkRead  200000     10860 ns/op
binary.BenchmarkRead  500000      2846 ns/op

R=rsc
CC=golang-dev
https://golang.org/cl/4547062
2011-05-26 09:01:05 -07:00
Yasuhiro Matsumoto
c0decc35ae exp/eval: fix compile error.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4550086
2011-05-26 22:05:25 +10:00
Brad Fitzpatrick
4923ba9155 mime/multipart: misc code/doc fixes
R=rsc
CC=golang-dev
https://golang.org/cl/4532089
2011-05-25 19:21:05 -07:00
Brad Fitzpatrick
0836b86e8b http: Transport hook to register non-http(s) protocols
This permits external packages implementing e.g.
FTP or gopher to register themselves with the
http.DefaultClient:

package ftp
func init() {
    http.DefaultTransport.RegisterProtocol("ftp", &ftp{})
}

Client code would look like:

import (
    _ "github.com/exampleuser/go/gopher"
    _ "github.com/exampleuser/go/ftp"
)

func main() {
    resp, err := http.Get("ftp://example.com/path.txt")
    ...
}

R=dsymonds, rsc
CC=golang-dev
https://golang.org/cl/4526077
2011-05-25 12:31:11 -07:00
Brad Fitzpatrick
1b6bf88767 encoding/base64: add DecodeString and EncodeToString
... like encoding/hex. Same signatures.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4530070
2011-05-25 12:24:36 -07:00
Ian Lance Taylor
0b8f1ac802 net: If we stop polling, remove any pending events for the socket
Fixes #1872.

R=rsc
CC=golang-dev, lars.pensjo
https://golang.org/cl/4559046
2011-05-25 12:21:10 -07:00
Robert Griesemer
a1c92c612f go/scanner: use strconv.QuoteRune now that it is available
R=r, rsc
CC=golang-dev
https://golang.org/cl/4538096
2011-05-25 11:16:17 -07:00
Brad Fitzpatrick
b0f39cc27c io, net, http: sendfile support
Speeds up static fileserver, avoiding kernel/userspace copies.

Numbers: downloading 14 MB AppEngine Go SDK with ab (Apache Bench)
with 5 threads:

Before/after numbers:

CPU:
user    0m3.910s
sys     0m23.650s
->
user    0m0.720s
sys     0m4.890s

Time taken for tests:   8.906 seconds
->
Time taken for tests:   8.545 seconds

Percentage of the requests served within a certain time (ms)
50%     44
66%     45
75%     46
80%     46
90%     48
95%     51
98%     59
99%     71
100     74 (longest request)
->
50%     42
66%     43
75%     43
80%     44
90%     46
95%     57
98%     62
99%     63
100%    64 (longest request)

R=iant, gary.burd, rsc, bradfitz
CC=golang-dev
https://golang.org/cl/4543071
2011-05-25 10:15:26 -07:00
Rob Pike
7b03f2a990 fmt: make %q work for integers, printing a quoted character literal.
R=rsc
CC=golang-dev
https://golang.org/cl/4556060
2011-05-25 21:25:15 +10:00
Ian Lance Taylor
ddcdbd4470 os: Fix test to work on Solaris.
On Solaris /bin is a symlink to /usr/bin, so running "pwd" in
the directory "/bin" prints out "/usr/bin".

R=rsc, r, bradfitz
CC=golang-dev
https://golang.org/cl/4559043
2011-05-24 22:53:37 -07:00
Rob Pike
c4918db8b9 strconv: add QuoteRune, which is analogous to Quote, but for runes rather than strings.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4556059
2011-05-25 15:04:07 +10:00
Robert Griesemer
3857747dce go/scanner: remove some code
R=r
CC=golang-dev
https://golang.org/cl/4550077
2011-05-24 15:00:42 -07:00
Robert Griesemer
3c7271f057 go spec: be precise with the use of the informal ellipsis … and the Go token ...
Fixes #1867.

R=r
CC=golang-dev
https://golang.org/cl/4538092
2011-05-24 14:18:44 -07:00
Brad Fitzpatrick
b32ad8bff5 http: Client test for streaming responses (no code changes)
I had a report that this was broken. It seems fine.

I think the reporter was just never flushing their response
headers.  If I omit the test server's initial Flush I get the
same behavior as reported. (a hang at Client.Get)

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4552062
2011-05-24 09:02:01 -07:00
Brad Fitzpatrick
3933cb2371 http: fix Set-Cookie date parsing
Fixes #1855

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4527073
2011-05-24 08:31:43 -07:00
Rob Pike
b3d3762b2e encoding/line: delete package.
Its functionality is now in bufio.
Fixes #1869.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/4553061
2011-05-24 16:05:26 +10:00
Rob Pike
4c945c2cfc image/gif: simplify blockReader.Read.
Inverting the tests avoids recursion and simplifies the flow.

R=nigeltao
CC=golang-dev
https://golang.org/cl/4551057
2011-05-24 11:02:44 +10:00
Kyle Consalus
78a7dda739 time: Remove unnecessary call to Nanoseconds() in after().
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/4528091
2011-05-23 12:38:51 -07:00
Brad Fitzpatrick
ccafd53ed3 http: add docs/warning on incorrect use of NewChunkedWriter
R=golang-dev, adg, r
CC=golang-dev
https://golang.org/cl/4536075
2011-05-22 18:46:48 -07:00
Mikio Hara
12104807de syscall: add IPv6 scope zone ID support
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/4515124
2011-05-22 10:09:07 -07:00
Mikio Hara
8c6dc5fea5 net: re-enable wildcard listening
Fixes #1854.

R=bradfitz, golang-dev
CC=golang-dev
https://golang.org/cl/4550062
2011-05-22 09:48:04 -07:00
Dave Cheney
d4a9bce70a runtime: fix function args not checked warning on arm
This tiny nit was driving me nuts

R=rsc, ken, r
CC=golang-dev
https://golang.org/cl/4550069
2011-05-22 14:59:25 +10:00
Andrew Gerrand
3975b9910c flag: fix build
R=r
CC=golang-dev
https://golang.org/cl/4543064
2011-05-22 11:55:02 +10:00
Robert Hencke
6dced6d992 crypto/x509: fix incorrect prints found by govet
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4526073
2011-05-22 09:23:22 +10:00
Rob Pike
f4fe688b09 flags: allow distinct sets of flags.
A FlagSet is an independent set of flags that may be used,
for example, to provide flag processing for subcommands
in a CLI.  The standard, os.Args-derived set of flags is a
global but non-exported FlagSet and the standard functions
are wrappers for methods of that FlagSet.

Allow the programmer to control whether the program
exits if there is a parse error.  For the default set, the behavior
remains to exit on error.

The handling of Usage is odd due to backward compatibility.

R=golang-dev, bradfitz, r, bradfitz
CC=golang-dev
https://golang.org/cl/4517092
2011-05-22 09:22:00 +10:00
Brad Fitzpatrick
e4b942245a http: include Host header in requests, even with proxies
A user pointed out that Go didn't work with their
corp proxy, always throwing 400 Bad Request errors.

Looking at the RFC 2616, Host is always required,
even with proxies.

The old code assumed that writing an absolute URL
in the first line of an HTTP request implied
that the Host header was no longer necessary.

Double-checked behavior with curl.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/4539075
2011-05-20 19:40:23 -07:00
Evan Shaw
3230fd1469 fmt: scanning doc fix
R=r
CC=golang-dev
https://golang.org/cl/4539073
2011-05-21 07:38:01 +10:00
Brad Fitzpatrick
bf73ca88a6 syscall: sendfile
R=iant
CC=golang-dev
https://golang.org/cl/4553051
2011-05-20 11:51:31 -07:00
Adam Langley
7f099cdc76 asn1: add big support.
Initially I wanted to minimise dependencies but it's become clear that
big int support in ASN.1 is a common need and that it should be part
of the core.

R=bradfitz
CC=golang-dev
https://golang.org/cl/4550063
2011-05-20 10:20:08 -07:00
Adam Langley
4fdcb7b684 crypto/openpgp: add key generation support.
This change adds a function for generating new Entities and inchoate
support for reserialising Entities.

R=bradfitz, r, bradfitz
CC=golang-dev
https://golang.org/cl/4551044
2011-05-20 09:36:20 -07:00
Brad Fitzpatrick
b22151f7dc mime/multipart: add a multipart Writer
Fixes #1823

R=golang-dev, adg, robert.hencke
CC=golang-dev
https://golang.org/cl/4530054
2011-05-20 09:03:43 -07:00
Robert Griesemer
b790ae2efb go/printer, gofmt: fix formatting of expression lists (missing blank)
This appears to have been a long-standing formatting bug.
The test cases has misformatted golden files.

Applied gofmt -w src misc .

Fixes #1839.

R=iant
CC=golang-dev
https://golang.org/cl/4515113
2011-05-19 17:05:35 -07:00
Gustavo Niemeyer
29b246c644 template: support string, int and float literals
This enables customizing the behavior of formatters
with logic such as {"template"|import} or even
{Field1 Field2 "%.2f 0x%X"|printf}

Thanks to Roger Peppe for some debate on this.

R=golang-dev, r, r
CC=golang-dev
https://golang.org/cl/4536059
2011-05-19 09:24:27 -03:00
David Symonds
bddd092dc3 flag: fix docs on flag.Var.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4539067
2011-05-19 14:53:26 +10:00
Anthony Martin
24b2f48a4a crypto/rand: add utility functions for number generation
This code is extracted from crypto/rsa with
a few variables renamed and a comment fixed.

R=agl, rsc, agl
CC=golang-dev
https://golang.org/cl/4446068
2011-05-18 18:55:06 -07:00
Brad Fitzpatrick
4ffff35abd http: Client.Do should follow redirects for GET and HEAD
It's documented as such, but it was never wired up
after Transport went in and Head was fixed.

If people don't want redirects, that's what RoundTripper/
Transport are for.  Or a custom redirect policy.

R=golang-dev, kevlar
CC=golang-dev
https://golang.org/cl/4526065
2011-05-18 17:17:26 -07:00
Mikio Hara
1d550bdedf syscall: add netlink support for linux/386, linux/amd64, linux/arm
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/4535078
2011-05-18 16:33:41 -07:00
Nigel Tao
0a2650f398 image/jpeg: small memory layout optimization for encoding.
Before:
jpeg.BenchmarkEncodeRGBOpaque ... 23.29 MB/s
jpeg.BenchmarkEncodeRGBOpaque ... 23.27 MB/s
jpeg.BenchmarkEncodeRGBOpaque ... 23.17 MB/s

After:
jpeg.BenchmarkEncodeRGBOpaque ... 23.42 MB/s
jpeg.BenchmarkEncodeRGBOpaque ... 23.34 MB/s
jpeg.BenchmarkEncodeRGBOpaque ... 23.33 MB/s

R=rsc
CC=golang-dev
https://golang.org/cl/4538077
2011-05-18 14:39:37 -07:00
Jonathan Allie
e7db6d78a2 crypto/x509: add support for parsing and verifying DSA signatures
(DSA with SHA1, DSA with SHA256). Cleanup getSignatureFromOID
function.

R=agl, agl, rsc
CC=golang-dev
https://golang.org/cl/4530055
2011-05-18 12:59:04 -07:00
Robert Griesemer
bda36cf3ab fmt: fix minor documentation nits
R=r, rsc
CC=golang-dev
https://golang.org/cl/4556041
2011-05-18 11:34:19 -07:00
Robert Griesemer
82ddf97094 big: support %v and # modifier, better handling of unknown formats
R=r
CC=golang-dev
https://golang.org/cl/4536065
2011-05-18 11:02:08 -07:00
Nigel Tao
8e26a644ca image/jpeg: make writeDQT do fewer array copies.
R=rsc, r
CC=golang-dev
https://golang.org/cl/4536069
2011-05-18 10:56:20 -07:00
Mikio Hara
9cd674be93 syscall: adjust freebsd syscalls.master URL properly
R=golang-dev, devon.odell
CC=golang-dev
https://golang.org/cl/4552051
2011-05-18 13:28:01 -04:00
Robert Hencke
c8727c81bb pkg: spelling tweaks, A-H
R=ality, bradfitz, rsc, dsymonds, adg, qyzhai, dchest
CC=golang-dev
https://golang.org/cl/4536063
2011-05-18 13:14:56 -04:00
Brad Fitzpatrick
feca99fd6f http: add Transport.ProxySelector
R=mattn.jp, rsc
CC=golang-dev
https://golang.org/cl/4528077
2011-05-18 09:23:29 -07:00
Mikio Hara
cef64d8e2b syscall: add TODO about required manual corrections
R=golang-dev, dave, rsc
CC=golang-dev
https://golang.org/cl/4553042
2011-05-18 10:51:45 -04:00