Commit Graph

10029 Commits

Author SHA1 Message Date
Adam Langley
7bc4f8de0f exp/terminal: split terminal handling from exp/ssh
This change splits terminal handling from exp/ssh, as suggested
several times in the ssh code review.

shell.go and shell_test.go are copies from exp/ssh with minimal
changes, so don't need another full review. A future CL will remove
that code from exp/ssh.

R=bradfitz, r, dave, rsc
CC=golang-dev
https://golang.org/cl/5278049
2011-10-18 12:58:57 -04:00
Dave Cheney
ec158f77bd exp/ssh: general cleanups for client support
common.go:
* simplify findAgreedAlgorithms.
* add channelExtendedData support.

messages.go:
* add clientExtendedData.

server.go:
*  use simplified findAgreedAlgorithms.

server_shell.go:
* fix shadowed err return value.

transport.go:
* introduce separate cipher, mac and compression for each direction.
* added filteredConn and packetWriter interfaces.
* newTransport requires a source of randomness.

R=golang-dev, agl, rsc
CC=golang-dev
https://golang.org/cl/5285044
2011-10-18 12:54:48 -04:00
Robert Griesemer
1db31f8933 big: more explicit documentation for div/mod/quo/rem
Fixes #2380.

R=rsc, rogpeppe
CC=golang-dev
https://golang.org/cl/5313041
2011-10-18 09:45:38 -07:00
Russ Cox
4e7aac5413 reflect: make unsafe use of SliceHeader gc-friendly
Revert workaround in compiler and
revert test for compiler workaround.

Tested that the 386 build continues to fail if
the gc change is made without the reflect change.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5312041
2011-10-18 10:03:37 -04:00
Russ Cox
313c8224d5 gofix -r mapdelete
R=golang-dev, r, adg, r, cw
CC=golang-dev
https://golang.org/cl/5266045
2011-10-18 09:56:34 -04:00
Russ Cox
7242052bc7 gofix: add mapdelete
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5286043
2011-10-18 09:45:36 -04:00
Russ Cox
1d687c742d gc: add delete(m, x) but leave in m[x] = 0, false.
The old m[x] = 0, false syntax will be deleted
in a month or so, once people have had time to
change their code (there is a gofix in a separate CL).

R=ken2
CC=golang-dev
https://golang.org/cl/5265048
2011-10-18 09:41:32 -04:00
Joe Poirier
1095305232 misc/windows: automated toolchain packager
A first run at fully automating the process.
This CL supersedes https://golang.org/cl/4634114/
which I seemed to have lost.

R=golang-dev, alex.brainman, adg
CC=golang-dev
https://golang.org/cl/5273041
2011-10-18 15:51:45 +11:00
Mikkel Krautz
c9bf048337 ld: bump pe linker version to 3.0 to allow code signing
The Windows signtool.exe thinks our binaries are 'invalid
Win32 programs' unless the PE linker version field is 3.0
or greater.

This minor change makes it possible to successfully sign
gc-built binaries on Windows.

R=golang-dev, alex.brainman, rsc
CC=golang-dev
https://golang.org/cl/5268045
2011-10-18 15:31:55 +11:00
Andrew Gerrand
82704f04ef tag release.r58.2
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5299041
2011-10-18 14:10:41 +11:00
David Symonds
9049abbd2d reflect: make map test independent of map iteration order.
This should fix the 386 builds.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5298042
2011-10-18 12:47:34 +11:00
David Symonds
fdc6376c00 reflect: fix test failure reporting.
There's a problem that is manifesting on the 386 builders,
but this test bug is masking it.

R=adg
CC=golang-dev
https://golang.org/cl/5295042
2011-10-18 12:26:09 +11:00
David Symonds
e45e324420 fmt: fix test relying on map iteration order.
This fixes the 386 builds.

R=golang-dev, adg, r
CC=golang-dev
https://golang.org/cl/5293043
2011-10-18 11:47:11 +11:00
Andrew Gerrand
07a34495cf tag release.r60.3
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5298041
2011-10-18 11:35:58 +11:00
Anthony Martin
0a4ec755e0 misc/swig: delete binaries
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/5273045
2011-10-17 16:47:52 -07:00
Andrew Gerrand
6989b0db60 doc: document release.r60.3
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5267049
2011-10-18 10:43:22 +11:00
Robert Griesemer
df219d5197 scanner: invalidate scanner.Position when no token is present
scanner.Position is the position of the most recently
scanned token. Make sure it is invalid if there is no
token scanned and update corresponding comment. This
is particularly important when reporting errors.

Fixes #2371.

R=r
CC=golang-dev
https://golang.org/cl/5294041
2011-10-17 16:35:12 -07:00
Russ Cox
e40d6e066a runtime: random offset for map iteration
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5285042
2011-10-17 18:49:02 -04:00
Russ Cox
304cf4dc9b reflect: disallow Interface method on Value obtained via unexported name
Had been allowing it for use by fmt, but it is too hard to lock down.
Fix other packages not to depend on it.

R=r, r
CC=golang-dev
https://golang.org/cl/5266054
2011-10-17 18:48:45 -04:00
Nigel Tao
e5f3dc8bc5 html: refactor the tokenizer; parse "</>" correctly.
Previously, Next would call either nextText or nextTag, but nextTag
could also call nextText. Both nextText and nextTag were responsible
for detecting "</a" end tags and "<!" comments. This change simplifies
the call chain and puts that responsibility in a single place.

R=andybalholm
CC=golang-dev
https://golang.org/cl/5263050
2011-10-18 09:42:16 +11:00
Russ Cox
d2b73730b7 exp/template/html: do not depend on reflection on internal fields
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5286049
2011-10-17 18:23:59 -04:00
Anthony Martin
95b4f8284f build: add missing nuke target
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5266046
2011-10-17 14:18:21 -07:00
Robert Griesemer
c5a6b05ba4 go spec: clarifying variable declaractions w/ constants
Fixes #2377.

R=r, rsc
CC=golang-dev
https://golang.org/cl/5267048
2011-10-17 12:54:18 -07:00
Robert Griesemer
3e0c0a8add go spec: "delete" built-in function
R=golang-dev, r, rsc
CC=golang-dev
https://golang.org/cl/5272045
2011-10-17 12:53:10 -07:00
Dmitriy Vyukov
b0c674b65d gc: treat uintptr as potentially containing a pointer
Fixes #2376

R=golang-dev, lvd, rsc
CC=golang-dev
https://golang.org/cl/5278048
2011-10-17 15:14:07 -04:00
Russ Cox
bdf66114c7 http: do not depend on map iteration order
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5284050
2011-10-17 14:51:54 -04:00
Russ Cox
9a7dd71944 template: do not depend on map iteration order
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5268048
2011-10-17 14:51:45 -04:00
Paul Borman
eea86de656 csv: fix issue 2366 - overly aggressive TrimLeadingSpace
Address the issue coalescing two records together when TrimLeadingSpace
is set to true.

The input

        a,b,
        c,d,e

Would result with a singled a,b,c,d,e record.
With TrailingComma set to true it should give two records.
With TrailingComma set to false it should be an error.

Fixes #2366.

R=golang-dev, go.peter.90, r
CC=golang-dev
https://golang.org/cl/5284046
2011-10-17 11:10:39 -07:00
Andrew Gerrand
64471ae762 http: fix panic when recovering from hijacked connection panic
Fixes #2375.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5279049
2011-10-17 15:54:36 +11:00
Esko Luontola
edd1c9111d gotest: avoid conflicts with the name of the tested package
Uses a generic solution of renaming the tested package, instead of
using cryptic names for all other imports, variables and methods
in the generated _testmain.go file.

Fixes #2346.

R=golang-dev, r, adg
CC=golang-dev, rsc
https://golang.org/cl/5254061
2011-10-17 14:19:02 +11:00
Andrew Gerrand
aeacd9df77 A+C: Esko Luontola
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5275050
2011-10-17 14:18:04 +11:00
Nigel Tao
1887907fee html: tokenize "a < b" as one whole text token.
R=andybalholm
CC=golang-dev
https://golang.org/cl/5284042
2011-10-16 20:50:11 +11:00
Dmitriy Vyukov
1135fc3978 runtime: fix crash if user sets MemProfileRate=0
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5284044
2011-10-16 10:49:24 +03:00
Anthony Martin
fc61ea3ba3 goyacc: clean up after units
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5286047
2011-10-15 07:12:10 -07:00
Alex Brainman
78479163cb syscall: dll function load and calling changes
New DLL and Proc types to manage and call dll functions. These were
used to simplify syscall tests in runtime package. They were also
used to implement LazyDLL and LazyProc.

LazyProc, like Proc, now have Call function, that just a wrapper for
SyscallN. It is not as efficient as Syscall, but easier to use.

NewLazyDLL now supports non-ascii filenames.

LazyDLL and LazyProc now have Load and Find methods. These can be used
during runtime to discover if some dll functions are not present.

All dll functions now return errors that fit os.Error interface. They
also contain Windows error number.

Some of these changes are suggested by jp.

R=golang-dev, jp, rsc
CC=golang-dev
https://golang.org/cl/5272042
2011-10-15 17:29:25 +11:00
Andrew Balholm
b770c9e9a2 html: improve parsing of comments and "bogus comments"
R=nigeltao
CC=golang-dev
https://golang.org/cl/5279044
2011-10-15 12:22:08 +11:00
Brad Fitzpatrick
5079129deb http: DoS protection: cap non-Handler Request.Body reads
Previously, if an http.Handler didn't fully consume a
Request.Body before returning and the request and the response
from the handler indicated no reason to close the connection,
the server would read an unbounded amount of the request's
unread body to advance past the request message to find the
next request's header. That was a potential DoS.

With this CL there's a threshold under which we read
(currently 256KB) in order to keep the connection in
keep-alive mode, but once we hit that, we instead
switch into a "Connection: close" response and don't
read the request body.

Fixes #2093 (along with number of earlier CLs)

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5268043
2011-10-14 17:34:07 -07:00
Anthony Martin
b5077f82fa http: avoid panic caused by nil URL
The current code will panic if an invalid
request (one with a nil URL) is passed to
the doFollowingRedirects function.

Also, remove a redundant nil Header check.

R=bradfitz
CC=golang-dev
https://golang.org/cl/5270046
2011-10-14 17:09:38 -07:00
Robert Griesemer
c5b3a4fb07 godoc: updates for latest Go app-engine release.
R=adg
CC=golang-dev
https://golang.org/cl/5273044
2011-10-14 16:06:39 -07:00
Andrew Gerrand
92b7b48213 doc: add go-tour-kr, a Korean translation of A Tour of Go
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5273043
2011-10-15 08:42:31 +11:00
Dave Cheney
a3ff67c3a7 godefs: add enum/const testdata
Also, add golden output data for linux/arm.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5256041
2011-10-14 17:34:00 -04:00
Chris Farmiloe
55751a38f0 xml: match Marshal's XMLName behavior in Unmarshal
When xml.Marshal is called on a struct it will happily
reflect the information in the "tag" of an XMLName member
regardless of the type to give the struct a tag-name in
it's XML form. This is backed up by the documentation which
says:

However xml.Unmarshal *does* care about the XMLName field
being of type xml.Name, and currently returns the error
"field XMLName does not have type xml.Name" if you have it
set to something else.

This is firstly inconsistant with xml.Marshal but it also
makes it impossible to use xml.Marshal alongside other
Marshallers (like json/bson) without poluting the state's
namespace with XMLName fields. Inorder to exclude fields
from other Marshallers the convention has been started to
tag fields as "omitempty"; which will cause the field not
to display if it is at it's "zero" state, XMLName cannot
have such as zero-state since it is a struct, so it is nicer
to use a pointer/bool value for XMLName so it can be easily
excluded when I want to Marshal my struct by some other
wire format.

Attached is the proposed minor change, that simply stops
erring if it can't set the name on the XMLName field, which
is just optional metadata anyway.
Fixes #2265.

R=rsc
CC=golang-dev
https://golang.org/cl/5067044
2011-10-14 17:29:54 -04:00
Brad Fitzpatrick
b9ad2787dd http: RoundTrippers shouldn't mutate Request
Fixes #2146

R=rsc
CC=golang-dev
https://golang.org/cl/5284041
2011-10-14 14:16:43 -07:00
Russ Cox
236aff31c5 gofmt: fix //line handling
Fixes #2369.

R=gri
CC=golang-dev
https://golang.org/cl/5275048
2011-10-14 15:54:45 -04:00
Russ Cox
12ece77c14 build: stop on failed deps.bash
Apparently some versions of bash do the ||exit implicitly
when in set -e mode, but others do not.  ???

R=gri
CC=golang-dev
https://golang.org/cl/5285043
2011-10-14 15:54:36 -04:00
Jaroslavas Počepko
ff866c4ca3 ld: Fixes issue 1899 ("cannot create 8.out.exe")
http://code.google.com/p/go/issues/detail?id=1899

R=rsc, alex.brainman, bsiegert, hectorchu, bradfitz
CC=golang-dev
https://golang.org/cl/4978047
2011-10-14 20:37:07 +01:00
Adam Langley
b3812bf6db crypto/x509: add code for dealing with PKIX public keys.
We also have functions for dealing with PKCS#1 private keys. This
change adds functions for PKIX /public/ keys. Most of the time one
won't be parsing them because they usually come in certificates, but
marshaling them happens and I've previously copied the code from
x509.go for this.

R=bradfitz, rsc
CC=golang-dev
https://golang.org/cl/5286042
2011-10-14 15:11:21 -04:00
Adam Langley
e74dcbeb0f crypto/x509: keep the raw Subject and Issuer.
X509 names, like everything else X509, are ludicrously general. This
change keeps the raw version of the subject and issuer around for
matching. Since certificates use a distinguished encoding, comparing
the encoding is the same as comparing the values directly. This came
up recently when parsing the NSS built-in certificates which use the
raw subject and issuer for matching trust records to certificates.

R=bradfitz
CC=golang-dev
https://golang.org/cl/5275047
2011-10-14 15:06:54 -04:00
Adam Langley
37e802a7c5 asn1: accept UTF8 strings as ASN.1 ANY values
R=bradfitz
CC=golang-dev
https://golang.org/cl/5172042
2011-10-14 15:06:11 -04:00
Brad Fitzpatrick
c4b9c8bb7d http: shut up a false Transport warning on Windows
Fixes #2057

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5269044
2011-10-14 11:31:00 -07:00