Dave Cheney [Sat, 29 Oct 2011 18:22:30 +0000 (14:22 -0400)]
exp/ssh: fix length header leaking into channel data streams.
The payload of a data message is defined as an SSH string type,
which uses the first four bytes to encode its length. When channelData
and channelExtendedData were added I defined Payload as []byte to
be able to use it directly without a string to []byte conversion. This
resulted in the length data leaking into the payload data.
This CL fixes the bug, and restores agl's original fast path code.
Additionally, a bug whereby s.lock was not released if a packet arrived
for an invalid channel has been fixed.
Finally, as they were no longer used, I have removed
the channelData and channelExtedendData structs.
Andrew Balholm [Fri, 28 Oct 2011 23:51:59 +0000 (10:51 +1100)]
html: adjust bookmark in "adoption agency" algorithm
In the adoption agency algorithm, the formatting element is sometimes
removed from the list of active formatting elements and reinserted at a later index.
In that case, the bookmark showing where it is to be reinserted needs to be moved,
so that its position relative to its neighbors remains the same
(and also so that it doesn't become out of bounds).
Also pass tests through test 76:
<test attribute---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
Russ Cox [Fri, 28 Oct 2011 02:42:32 +0000 (19:42 -0700)]
crypto/tls: add Error method to alert
alerts get used as both values and errors.
Rather than introduce an alertError wrapper,
this CL just adds an Error method, which will
satisfy the error interface when the time comes.
Russ Cox [Fri, 28 Oct 2011 02:39:25 +0000 (19:39 -0700)]
go/doc: remove os.NewError anti-heuristic
It will be obsolete when error happens.
Submitting this now will make the error transition earlier,
at the cost of making a locally-built godoc viewing
/pkg/syscall or /pkg/os have some functions appear
under the Error type as constructors.
Russ Cox [Fri, 28 Oct 2011 01:04:12 +0000 (18:04 -0700)]
runtime: lock the main goroutine to the main OS thread during init
We only guarantee that the main goroutine runs on the
main OS thread for initialization. Programs that wish to
preserve that property for main.main can call runtime.LockOSThread.
This is what programs used to do before we unleashed
goroutines during init, so it is both a simple fix and keeps
existing programs working.
Julian Phillips [Thu, 27 Oct 2011 08:45:07 +0000 (17:45 +0900)]
goinstall: More intelligent vcs selection for common sites
goinstall has built in support for a few common code hosting sites. The
identification of which vcs tool should be used was based purely on a
regex match against the provided import path. The problem with this
approach is that it requires distinct import paths for different vcs
tools on the same site.
Since bitbucket has recently starting hosting Git repositories under the
same bitbucket.org/user/project scheme as it already hosts Mercurial
repositories, now would seem a good time to take a more flexible
approach.
We still match the import path against a list of regexes, but now the
match is purely to distinguish the different hosting sites. Once the
site is identified, the specified function is called with the repo and
path matched out of the import string. This function is responsible for
creating the vcsMatch structure that tells us what we need to download
the code.
For github and launchpad, only one vcs tool is currently supported, so
these functions can simply return a vcsMatch structure. For googlecode,
we retain the behaviour of determing the vcs from the import path - but
now it is done by the function instead of the regex. For bitbucket, we
use api.bitbucket.org to find out what sort of repository the specified
import path corresponds to - and then construct the appropriate vcsMatch
structure.
Ron Minnich [Wed, 26 Oct 2011 22:27:59 +0000 (15:27 -0700)]
cc: change cas to newcase
Change the name of cas() in cc to newcase() to avoid a NIX conflict.
cas() is used in cc to create a new Case struct. There is a name
conflict in that cas() is a commonly-used
name for compare and swap. Since cas() is only used internally
in the compiler in 3 places, change the name to avoid a wider
conflict with the NIX runtime. This issue might well come up on
other OSes in the future anyway, as the name is fairly common.
Adam Langley [Wed, 26 Oct 2011 14:41:24 +0000 (10:41 -0400)]
crypto/rsa: change public exponent from 3 to 65537
Although there's still no concrete security reason not to use 3, I
think Bleichenbacher has convinced me that it's a useful defense and
it's what everyone else does.
Nigel Tao [Tue, 25 Oct 2011 00:28:07 +0000 (11:28 +1100)]
html: remove the Tokenizer.ReturnComments option.
The original intention was to simplify the parser, in making it skip
all comment tokens. However, checking that the Go html package is
100% compatible with the WebKit HTML test suite requires parsing the
comments. There is no longer any real benefit for the option.
Dave Cheney [Mon, 24 Oct 2011 23:13:55 +0000 (19:13 -0400)]
exp/ssh: introduce Session to replace Cmd for interactive commands
This CL replaces the Cmd type with a Session type representing
interactive channels. This lays the foundation for supporting
other kinds of channels like direct-tcpip or x11.
client.go:
* replace chanlist map with slice.
* generalize stdout and stderr into a single type.
* unexport ClientChan to clientChan.
doc.go:
* update ServerConfig/ServerConn documentation.
* update Client example for Session.
message.go:
* make channelExtendedData more like channelData.
Robert Griesemer [Fri, 21 Oct 2011 21:11:36 +0000 (14:11 -0700)]
big: usable zero Rat values without need for explicit initialization
- no explicit API change, but new(big.Rat) now creates a big.Rat value
of 0 that is immediately usable, in sync. w/ the conventions elsewhere
- various cleanups along the way
Robert Griesemer [Fri, 21 Oct 2011 20:26:00 +0000 (13:26 -0700)]
big: implemented Rat.Inv
Also:
- changed semantics of return values for [Int|Rat].SetString
if an error occured (returned value is nil); will expose
hidden errors where return values are not checked
- added more tests
- various cleanups throughout
Rob Pike [Fri, 21 Oct 2011 18:16:46 +0000 (11:16 -0700)]
gotest: make it easier to get the help string
Because gotest's args are mingled with the tests, it's
hard to get the usage message to print. This CL adds
explicit support for -help, spelled several different ways.
Gotest has special flags like -file that are somewhat
hidden otherwise.
Dave Cheney [Fri, 21 Oct 2011 15:04:28 +0000 (11:04 -0400)]
exp/ssh: server cleanups
server.go/channel.go:
* rename Server to ServerConfig to match Client.
* rename ServerConnection to ServeConn to match Client.
* add Listen/Listener.
* ServerConn.Handshake(), general cleanups.
client.go:
* fix bug where fmt.Error was not assigned to err
Russ Cox [Wed, 19 Oct 2011 20:06:16 +0000 (16:06 -0400)]
govet: check canonical dynamic method signatures
Adds check that, for example, a Scan method taking
a first argument of type fmt.ScanState has the correct
signature to satisfy fmt.Scanner.
Similarly, a ReadByte should return byte, os.Error.
These are important to check because various pieces
of code (fmt, gob, json, flate) do dynamic checks
for these methods, so code with incorrect signatures
would not be flagged at compile time.
These become even more important to check when
rune is introduced.
Russ Cox [Wed, 19 Oct 2011 20:02:22 +0000 (16:02 -0400)]
unicode: sort tables.go
Makes tables.go output consistent across maketable runs.
(It was already inconsistent across architectures; the new
map iteration order just make it inconsistent across runs.)
Reviewer: mikesamuel@gmail.com, nigeltao@golang.org
mikesamuel: I don't see a type def for rune. Assuming that's a new intrinsic, LGTM. CC: golang-dev@googlegroups.com
Files:
src/pkg/exp/template/html/css.go
src/pkg/exp/template/html/css_test.go
src/pkg/exp/template/html/html.go
src/pkg/exp/template/html/js.go
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5297045