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

570 Commits

Author SHA1 Message Date
Marcel van Lohuizen
8ba20dbdb5 exp/norm: a few minor changes in prepration for a table format change:
- Unified bounary conditions for NFC and NFD and removed some indirections.
   This enforces boundaries at the character level, which is typically what
   the user expects. (NFD allows a boundary between 'a' and '`', for example,
   which may give unexpected results for collation.  The current implementation
   is already stricter than the standard, so nothing much changes.  This change
   just formalizes it.
 - Moved methods of qcflags to runeInfo.
 - Swapped YesC and YesMaybe bits in qcFlags. This is to aid future changes.
 - runeInfo return values use named fields in preperation for struct change.
 - Replaced some left-over uint32s with rune.

R=r
CC=golang-dev
https://golang.org/cl/5607050
2012-02-02 13:55:53 +01:00
Marcel van Lohuizen
d673c95d6c exp/norm: Added some benchmarks for form-specific performance measurements.
R=r
CC=golang-dev
https://golang.org/cl/5605051
2012-02-02 13:19:12 +01:00
Robert Griesemer
f3f5239d1e all packages: fix various typos
Detected semi-automatically. There are probably more.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5620046
2012-02-01 16:19:36 -08:00
David Symonds
b68d947b91 os/signal: move to exp/signal.
Fixes #2816.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5609048
2012-02-02 09:08:50 +11:00
Russ Cox
2050a9e478 build: remove Make.pkg, Make.tool
Consequently, remove many package Makefiles,
and shorten the few that remain.

gomake becomes 'go tool make'.

Turn off test phases of run.bash that do not work,
flagged with $BROKEN.  Future CLs will restore these,
but this seemed like a big enough CL already.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5601057
2012-01-30 23:43:46 -05:00
Rob Pike
91cb3489ab go: move compilers into the go-tool directory
Also delete gotest, since it's messy to fix and slated for deletion anyway.
A couple of things outside src can't be tested any more. "go test" will be
fixed and these tests will be re-enabled. They're noisy for now.

Fixes #284.

R=rsc
CC=golang-dev
https://golang.org/cl/5598049
2012-01-30 14:46:31 -08:00
Russ Cox
0368ca138b build: remove code now in subrepositories
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5569064
2012-01-25 15:30:42 -05:00
Nigel Tao
324513bc5f html: move the HTML parser to an exp/html package. The parser is a
work in progress, and we are not ready to freeze its API for Go 1.

Package html still exists, containing just two functions: EscapeString
and UnescapeString.

Both the packages at exp/html and html are "package html". The former
is a superset of the latter.

At some point in the future, the exp/html code will move back into
html, once we have finalized the parser API.

R=rsc, dsymonds
CC=golang-dev
https://golang.org/cl/5571059
2012-01-25 10:54:59 +11:00
Russ Cox
4417bc3742 exp/ebnflint: test spec during 'go test'
This avoids the need for a custom Makefile.

R=gri
CC=golang-dev
https://golang.org/cl/5575045
2012-01-23 16:35:25 -05:00
Marcel van Lohuizen
110964ac81 exp/norm: fixes a subtle bug introduced by change 10087: random offset
for map iteration.  New code makes table output predictable and fixes
bug.

R=rsc, r
CC=golang-dev
https://golang.org/cl/5573044
2012-01-23 19:36:52 +01:00
Brad Fitzpatrick
7fc4c07172 database/sql: move from exp/sql
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5536076
2012-01-19 16:04:26 -08:00
Luit van Drongelen
8d66a416cb crypto/hmac: Deprecate hmac.NewMD5, hmac.NewSHA1 and hmac.NewSHA256
Remove NewMD5, NewSHA1 and NewSHA256 in favor of using New and
explicitly importing the used hash-function. This way when using, for
example, HMAC with RIPEMD there's no md5, sha1 and sha256 linked in
through the hmac package.

A gofix rule is included, and applied to the standard library (3 files
altered).

This change is the result of a discussion at
https://golang.org/cl/5550043/ to pull the discussion about
deprecating these functions out of that issue.

R=golang-dev, agl
CC=golang-dev, r, rsc
https://golang.org/cl/5556058
2012-01-19 17:28:38 -05:00
Olivier Duperray
e5c1f3870b pkg: Add & fix Copyright of "hand generated" files
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5554064
2012-01-19 10:14:56 -08:00
Brad Fitzpatrick
bc0139b4b3 exp/sql: rename NullableString to NullString and allow its use as a parameter
Prep for Issue 2699

R=rsc
CC=golang-dev
https://golang.org/cl/5536045
2012-01-19 09:27:45 -08:00
Brad Fitzpatrick
b71883e9b0 net: change SetTimeout to SetDeadline
Previously, a timeout (in int64 nanoseconds) applied to a granularity
even smaller than one operation:  a 100 byte read with a 1 second timeout
could take 100 seconds, if the bytes all arrived on the network 1 second
apart.  This was confusing.

Rather than making the timeout granularity be per-Read/Write,
this CL makes callers set an absolute deadline (in time.Time)
after which operations will fail.  This makes it possible to
set deadlines at higher levels, without knowing exactly how
many read/write operations will happen in e.g. reading an HTTP
request.

Fixes #2723

R=r, rsc, dave
CC=golang-dev
https://golang.org/cl/5555048
2012-01-18 16:24:06 -08:00
Robert Griesemer
9edabbe038 go/token: replaced Files() with Iterate()
- Use a faster closure-based iterator rather than a channel-based one.
- Otherwise: better code organization, but no other API changes.

R=r, r
CC=golang-dev
https://golang.org/cl/5557051
2012-01-18 14:10:42 -08:00
Adam Langley
dbebb08601 exp/ssh: handle versions with just '\n'
djm recommend that we do this because OpenSSL was only fixed in 2008:
http://anoncvs.mindrot.org/index.cgi/openssh/sshd.c?revision=1.380&view=markup

R=dave, jonathan.mark.pittman
CC=golang-dev
https://golang.org/cl/5555044
2012-01-18 15:04:17 -05:00
Luit van Drongelen
a5263c7caa crypto/hmac: Add HMAC-SHA224 and HMAC-SHA384/512
First was, apart from adding tests, a single line of code (to add the
constructor function). Adding SHA512-based hashing to crypto/hmac
required minor rework of the package because of a previously hardcoded
block-size in it's implementation. Instead of using a hash.Hash
generator function the constructor function now uses a crypto.Hash
type, which was extended to expose information about block size.

The only standard library package impacted by the change is
crypto/tls, for which the fix is included in this patch. It might be
useful to extend gofix to include this API change too.

R=agl, r, rsc, r
CC=golang-dev
https://golang.org/cl/5550043
2012-01-18 10:36:28 -05:00
Rob Pike
7585aa6ae5 utf8.String: move to exp/utf8string.String
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5528115
2012-01-17 14:21:50 -08:00
Brad Fitzpatrick
ebc8013edf exp/sql: copy when scanning into []byte by default
Fixes #2698

R=rsc
CC=golang-dev
https://golang.org/cl/5539060
2012-01-17 10:44:35 -08:00
Luuk van Dijk
9523b4d59c gc: fix infinite recursion for embedded interfaces
Fixes #1909

R=rsc, gri
CC=golang-dev
https://golang.org/cl/5523047
2012-01-17 10:00:57 +01:00
Gustavo Niemeyer
9b54af2020 exp/proxy: fix build after URL changes
R=golang-dev
CC=golang-dev
https://golang.org/cl/5540062
2012-01-17 00:55:35 -02:00
Russ Cox
3735cf7b09 exp/terminal: fix build on non-Linux using Makefiles
The Makefiles will go away soon.

R=agl
CC=golang-dev
https://golang.org/cl/5544081
2012-01-16 17:49:58 -05:00
Christopher Wedgwood
f53cc8e6ff exp/ssh: rename (some) fields
R=dave, agl, agl
CC=golang-dev
https://golang.org/cl/5494057
2012-01-16 10:09:36 -05:00
Dmitriy Vyukov
3d2e75cf92 exp/inotify: fix data race in linux tests
Fixes #2708.

R=golang-dev, bradfitz
CC=golang-dev, mpimenov
https://golang.org/cl/5543060
2012-01-16 11:11:58 +04:00
Jonathan Pittman
0a97ef8f71 exp/ssh: add marshal functions for uint32 and uint64 types
R=golang-dev, dave, agl
CC=golang-dev
https://golang.org/cl/5533081
2012-01-15 19:54:17 -05:00
Adam Langley
1019eda9d8 exp/terminal: still trying to unbreak non-Linux builds.
R=golang-dev
CC=golang-dev
https://golang.org/cl/5542050
2012-01-15 10:41:16 -05:00
Adam Langley
a33b76081b exp/ssh: patching in the last change lost that a file was deleted.
R=golang-dev
CC=golang-dev
https://golang.org/cl/5541060
2012-01-15 10:08:48 -05:00
Adam Langley
dd47a0a2ca exp/ssh: remove duplicated terminal code.
The terminal code in exp/terminal was forked from the code in exp/ssh.
This change removes the duplicated code from exp/ssh in favour of
using exp/terminal.

R=rsc
CC=golang-dev
https://golang.org/cl/5375064
2012-01-15 09:59:06 -05:00
Shenghou Ma
4cfa9e3c61 doc: fix comments referring to removed API funcs
The strconv package has removed Atob, AtoF{64,32} and Ftoa.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5540057
2012-01-14 10:59:45 -08:00
Adam Langley
a9e1f6d7a6 exp/terminal: add SetPrompt and handle large pastes.
(This was missing in the last change because I uploaded it from the
wrong machine.)

Large pastes previously misbehaved because the code tried reading from
the terminal before checking whether an line was already buffered.
Large pastes can cause multiples lines to be read at once from the
terminal.

R=bradfitz
CC=golang-dev
https://golang.org/cl/5542049
2012-01-14 10:59:11 -05:00
Adam Langley
423a09760b exp/proxy: new package
exp/proxy provides client support for tunneling connections through
various proxies.

This is an initial, incomplete sketch of the code to lay down an
API.

R=golang-dev, r, r, bradfitz, rsc
CC=golang-dev
https://golang.org/cl/5490062
2012-01-14 10:44:35 -05:00
Brad Fitzpatrick
bf734d62d8 exp/sql: add time.Time support
Fixes #2694

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5541057
2012-01-13 15:45:05 -08:00
Brad Fitzpatrick
1c441e259f exp/sql: fix statement leak
Also verified in external test suite that this fixes MySQL
resource exhaustion problems, and also exposed a double-free
bug in the gosqlite3 driver (where gosqlite3 either got lucky
before, or was working around this bug)

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5544057
2012-01-13 15:25:07 -08:00
Brad Fitzpatrick
701f70abf6 sql: fix potential corruption in QueryRow.Scan into a *[]byte
Fixes #2622

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5533077
2012-01-12 11:23:33 -08:00
Robert Griesemer
276f177b9c go/scanner: remove (exported) InsertSemis mode
This is a relic from the times when we switched
to automatic semicolon insertion. It's still use-
ful to have a non-exported switch for testing.

R=golang-dev, r, rsc
CC=golang-dev
https://golang.org/cl/5528077
2012-01-11 10:06:44 -08:00
Robert Griesemer
090049130e go/ast: predeclared objects have the Universe/Unsafe scope as Decl
Makes it possible to easily detect if an Object was predeclared
(as opposed to unresolved).

R=rsc
CC=golang-dev
https://golang.org/cl/5530072
2012-01-10 18:30:06 -08:00
Brad Fitzpatrick
4435c8bf2a exp/sql: close Rows on EOF
Fixes #2624

R=rsc
CC=golang-dev
https://golang.org/cl/5530068
2012-01-10 12:51:27 -08:00
Dave Cheney
424f53fa0c exp/ssh: fix two flow control bugs in chanWriter
This CL fixes two issues sending data to the remote peer.
The first bug occurs when the size of the buffer passed to
Write is larger than the current window, in this case, w.rwin
can become negative.

The second issue is more problematic than the first as the
amount of data passed to writePacket was not limited to w.rwin.
In this case the remote peer could silently drop the additional
data, or drop the connection.

Credit to Jacek Masiulaniec for the bug report.

R=agl, jacek.masiulaniec
CC=golang-dev
https://golang.org/cl/5511043
2012-01-04 10:36:21 -05:00
Dave Cheney
7f20bcbbcb exp/ssh: various small fixes
transport.go:
* remove unused nil check.

doc.go:
* improve documentation about supported auth
methods and update Run example.

Thanks Jacek Masiulaniec for both reports.

R=jacek.masiulaniec, agl
CC=golang-dev
https://golang.org/cl/5501075
2011-12-27 09:49:19 -05:00
Marcel van Lohuizen
cadbd3ea49 exp/norm: fixed two unrelated bugs in normalization library.
1) incorrect length given for out buffer in String.
2) patchTail bug that could cause characters to be lost
   when crossing into the out-buffer boundary.

Added tests to expose these bugs.  Also slightly improved
performance of Bytes() and String() by sharing the reorderBuffer
across operations.

Fixes #2567.

R=r
CC=golang-dev
https://golang.org/cl/5502069
2011-12-23 18:21:26 +01:00
Adam Langley
7350c771f8 exp/terminal: several cleanups
1) Add EscapeCodes to the terminal so that applications don't wire
   them in.
2) Add a callback for auto-complete
3) Fix an issue with input lines longer than the width of the
   terminal.
4) Have Write() not stomp the current line. It now erases the current
   input, writes the output and reprints the prompt and partial input.
5) Support prompting without local echo in Terminal.
6) Add GetSize to report the size of terminal.

R=bradfitz
CC=golang-dev
https://golang.org/cl/5479043
2011-12-22 11:23:57 -05:00
Russ Cox
e83cd7f750 build: a round of fixes
TBR=r
CC=golang-dev
https://golang.org/cl/5503052
2011-12-20 17:54:40 -05:00
Robert Griesemer
541b67d051 go/printer, gofmt: fine tuning of line spacing
- no empty lines inside empty structs and interfaces
- top-level declarations are separated by a blank line if
  a) they are of different kind (e.g. const vs type); or
  b) there are documentation comments associated with a
     declaration (this is new)
- applied gofmt -w misc src

The actual changes are in go/printer/nodes.go:397-400 (empty structs/interfaces),
and go/printer/printer.go:307-309 (extra line break). The remaining
changes are cleanups w/o changing the existing functionality.

Fixes issue  2570.

R=rsc
CC=golang-dev
https://golang.org/cl/5493057
2011-12-16 15:43:06 -08:00
Maxim Pimenov
bf6dd2db04 various: use $GCFLAGS and $GCIMPORTS like Make does
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5489065
2011-12-16 11:31:39 -05:00
Dave Cheney
52c8107a3c exp/ssh: simplify Stdin/out/errPipe methods
If a Pipe method is called, return the underlying
reader/writer from session.clientChan, bypassing the
io.Copy and io.Pipe harness.

StdoutPipe and StderrPipe now return an io.Reader not
an io.ReadCloser as SSH cannot signal the close of the
local reader to the remote process.

R=rsc, agl, gustav.paul, cw
CC=golang-dev
https://golang.org/cl/5493047
2011-12-15 16:50:41 -05:00
Russ Cox
fd1f10966d more tags for go/build
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5490047
2011-12-15 13:35:59 -05:00
Brad Fitzpatrick
ea51dd23b4 sql: add Rows.Columns
Also, fix package name in error messages.

Fixes #2453

R=rsc
CC=golang-dev
https://golang.org/cl/5483088
2011-12-15 10:14:57 -08:00
Dave Cheney
fc6df2fdd8 exp/ssh: rename ClientAuthPublicKey helper ClientAuthKeyring
Also, rename ServerConfig.PubKeyCallback to PublicKeyCallback.

R=rsc, agl
CC=golang-dev
https://golang.org/cl/5477059
2011-12-15 11:06:10 -05:00
Yasuhiro Matsumoto
1c50c32af0 exp/winfsnotify: fix build.
R=golang-dev, alex.brainman
CC=golang-dev
https://golang.org/cl/5483057
2011-12-14 13:17:48 +11:00
Rob Pike
02f6719d44 strconv: include package and function name in error strings
Fixes #2548.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5484062
2011-12-13 10:42:05 -08:00
Dave Cheney
2b600f77dd exp/ssh: improve client channel close behavior
R=gustav.paul
CC=golang-dev
https://golang.org/cl/5480062
2011-12-13 10:27:17 -05:00
David Symonds
3dbecd592b various: a grab-bag of time.Duration cleanups.
R=adg, r, rsc
CC=golang-dev
https://golang.org/cl/5475069
2011-12-13 10:42:56 +11:00
Brad Fitzpatrick
06a9bc6835 sql: fix missing mutex unlock in an error case
Fixes #2542

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5483054
2011-12-12 13:56:56 -08:00
Joel Sing
7e797be7a3 exp/norm: fix rune/int types in test
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5472067
2011-12-11 09:25:09 -08:00
Russ Cox
fc128403dc gc: minor changes for inlining
Copied from 5400043 since they stand alone from inlining.

R=lvd
CC=golang-dev
https://golang.org/cl/5479046
2011-12-09 08:03:51 -05:00
Russ Cox
41453d2ed2 exp/types: fix linux build
I don't understand why it was only broken on Linux

TBR=gri
CC=golang-dev
https://golang.org/cl/5479045
2011-12-08 23:20:21 -05:00
Russ Cox
a250f37cbc update tree for new default type rule
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5448091
2011-12-08 22:08:03 -05:00
Alex Brainman
ef65feda2a syscall: return error, not uintptr, when function returns error
R=rsc
CC=golang-dev
https://golang.org/cl/5450119
2011-12-08 12:07:21 +11:00
David Symonds
9d52fe22b4 exp/sql: simplify some string conversions.
R=bradfitz
CC=golang-dev
https://golang.org/cl/5451112
2011-12-08 08:08:00 +11:00
Gustav Paul
50c24bf6ec exp/ssh: Have Wait() return an *ExitError
I added the clientChan's msg channel to the list of channels that are closed in mainloop when the server sends a channelCloseMsg.

I added an ExitError type that wraps a Waitmsg similar to that of os/exec. I fill ExitStatus with the data returned in the 'exit-status' channel message and Msg with the data returned in the 'exit-signal' channel message.

Instead of having Wait() return on the first 'exit-status'/'exit-signal' I have it return an ExitError containing the status and signal when the clientChan's msg channel is closed.

I added two tests cases to session_test.go that test for exit status 0 (in which case Wait() returns nil) and exit status 1 (in which case Wait() returns an ExitError with ExitStatus 1)

R=dave, agl, rsc, golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5452051
2011-12-07 09:58:22 -05:00
Dave Cheney
bf59f081c1 exp/ssh: cleanup client auth tests
This CL cleans up the client auth tests, making the
individual test body more manageable.

Also, adds tests for rsa and dsa key negotiation.

Finally, remove the package level use of the variable
strings, which avoids conflicting with the strings pkg.

R=gustav.paul, agl, n13m3y3r, rsc
CC=golang-dev
https://golang.org/cl/5447049
2011-12-06 18:13:20 -05:00
Dave Cheney
bbbd41f4ff exp/ssh: simplify client channel open logic
This is part one of a small set of CL's that aim to resolve
the outstanding TODOs relating to channel close and blocking
behavior.

Firstly, the hairy handling of assigning the peersId is now
done in one place. The cost of this change is the slightly
paradoxical construction of the partially created clientChan.

Secondly, by creating clientChan.stdin/out/err when the channel
is opened, the creation of consumers like tcpchan and Session
is simplified; they just have to wire themselves up to the
relevant readers/writers.

R=agl, gustav.paul, rsc
CC=golang-dev
https://golang.org/cl/5448073
2011-12-06 09:33:23 -05:00
Rob Pike
0a5508c692 various: we don't cast, we convert
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5437142
2011-12-05 19:40:52 -08:00
Russ Cox
2666b815a3 use new strconv API
All but 3 cases (in gcimporter.go and hixie.go)
are automatic conversions using gofix.

No attempt is made to use the new Append functions
even though there are definitely opportunities.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5447069
2011-12-05 15:48:46 -05:00
Luuk van Dijk
40b2fe004f gc: changes in export format in preparation of inlining.
Includes minimal change to gcimporter to keep it working,

R=rsc, gri
CC=golang-dev
https://golang.org/cl/5431046
2011-12-05 14:40:19 -05:00
Russ Cox
dcf1d7bc0e gofmt -s misc src
R=golang-dev, bradfitz, gri
CC=golang-dev
https://golang.org/cl/5451079
2011-12-02 14:14:25 -05:00
Gustav Paul
bd9dc3d55f exp/ssh: allow for msgUserAuthBanner during authentication
The SSH spec allows for the server to send a banner message to the client at any point during the authentication process. Currently the ssh client auth types all assume that the first response from the server after issuing a userAuthRequestMsg will be one of a couple of possible authentication success/failure messages. This means that client authentication breaks if the ssh server being connected to has a banner message configured.

This changeset refactors the noneAuth, passwordAuth and publickeyAuth types' auth() function and allows for msgUserAuthBanner during authentication.

R=golang-dev, rsc, dave, agl
CC=golang-dev
https://golang.org/cl/5432065
2011-12-02 10:34:42 -05:00
Gustav Paul
fad57c0c03 exp/ssh: export type signal. Renamed to Signal
R=dave, agl, rsc, golang-dev, n13m3y3r
CC=golang-dev
https://golang.org/cl/5450059
2011-12-01 14:06:15 -05:00
Adam Langley
bac7bc55a6 Add a []byte argument to hash.Hash to allow an allocation to be saved.
This is the result of running `gofix -r hashsum` over the tree, changing
the hash function implementations by hand and then fixing a couple of
instances where gofix didn't catch something.

The changed implementations are as simple as possible while still
working: I'm not trying to optimise in this CL.

R=rsc, cw, rogpeppe
CC=golang-dev
https://golang.org/cl/5448065
2011-12-01 12:35:37 -05:00
Dave Cheney
c4d0ac0e2f exp/ssh: add Std{in,out,err}Pipe methods to Session
R=gustav.paul, cw, agl, rsc, n13m3y3r
CC=golang-dev
https://golang.org/cl/5433080
2011-12-01 08:30:16 -02:00
Dave Cheney
0e62c75b9d undo CL 5436056 / 03560deae933
Remove the accidentally exported net.Listener

««« original CL description
exp/ssh: remove unused forwarding methods in Server Listener

R=agl, rsc
CC=golang-dev
https://golang.org/cl/5436056

»»»

R=agl, rsc
CC=golang-dev
https://golang.org/cl/5437090
2011-11-30 17:14:03 -05:00
Russ Cox
8dce57e169 os: new FileInfo, FileMode types + update tree
R=golang-dev, r, r, gri, bradfitz, iant, iant, nigeltao, n13m3y3r
CC=golang-dev
https://golang.org/cl/5416060
2011-11-30 12:04:16 -05:00
Russ Cox
03823b881c use new time API
R=bradfitz, gri, r, dsymonds
CC=golang-dev
https://golang.org/cl/5390042
2011-11-30 12:01:46 -05:00
Gustav Paul
c6691d1fb4 exp/ssh: Add Start(cmd string) and Signal(sig string) to Session. Rename Exec to Run.
Exec() has been renamed to Run() in keeping with the os/exec API.

Added func (*Session) Start(cmd string) which starts a remote process but unlike Run() doesn't wait for it to finish before returning.

Run() has been refactored to use Start internally. Its really just a refactoring, no new code but some extra functionality was won.

Also added func (*Session) Signal(sig signal) which sends a UNIX signal to a remote process. This is espcially useful in conjunction with Start() as the two allow you to start a remote process, monitor its stdout/stderr, and send it a TERM/HUP/etc signal when you want it to close.

R=dave, rsc, agl, bradfitz, n13m3y3r, gustavo
CC=golang-dev
https://golang.org/cl/5437058
2011-11-29 12:26:39 -05:00
Dave Cheney
4cc64bd5bf exp/ssh: move openChan to NewSession
openChan was only being called by NewSession, Dial has
its own version.

R=gustav.paul, agl, rsc
CC=golang-dev
https://golang.org/cl/5435071
2011-11-28 15:42:47 -05:00
Dave Cheney
b57bb9282e exp/ssh: add safeString error sanitiser
R=huin, agl, gustav.paul, cw
CC=golang-dev
https://golang.org/cl/5399044
2011-11-28 12:29:19 -05:00
Dave Cheney
ce7e11997b exp/ssh: fix three shift bugs related to packet lengths
Thanks for Ke Lan for the initial report and investigation.

R=agl, gustav.paul, tg8866, rsc
CC=golang-dev
https://golang.org/cl/5443044
2011-11-28 12:10:16 -05:00
Brad Fitzpatrick
e77099daa2 sql: add Tx.Stmt to use an existing prepared stmt in a transaction
R=rsc
CC=golang-dev
https://golang.org/cl/5433059
2011-11-28 11:00:32 -05:00
Gustav Paul
23227f3d63 exp/ssh: fix misleading spelling mistake in comment
R=dave, agl, rsc, golang-dev
CC=golang-dev
https://golang.org/cl/5431089
2011-11-28 10:45:52 -05:00
Gustav Paul
d859d7deee exp/ssh: messages now contain remote channel's id instead of local id
According to http://www.ietf.org/rfc/rfc4254.txt most channel messages contain the channel id of the recipient channel, not the sender id. This allows the recipient connection multiplexer to route the message to the correct channel.

This changeset fixes several messages that incorrectly send the local channel id instead of the remote channel's id.

While sessions were being created and closed in sequence channels in the channel pool were freed and reused on the server side of the connection at the same rate as was done on the client, so the channel local and remote channel ids always corresponded. As soon as I had concurrent sessions on the same clientConn the server started to complain of 'uknown channel id N' where N is the local channel id, which is actually paired with server channel id K.

R=golang-dev, dave, rsc, agl
CC=golang-dev
https://golang.org/cl/5433063
2011-11-27 09:59:20 -05:00
Benny Siegert
5519b5d716 exp/sql/driver: Correct package name in comment.
IIRC, package sql used to be called db. There was one occurrence
of the old name in a comment.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5431075
2011-11-25 10:57:10 -05:00
Dave Cheney
f2c858749a exp/ssh: add simple tcpip.go functional tests
R=rsc, agl, n13m3y3r, bradfitz
CC=golang-dev
https://golang.org/cl/5385041
2011-11-23 09:38:11 -05:00
Dave Cheney
d5514120b1 exp/ssh: remove unused forwarding methods in Server Listener
R=agl, rsc
CC=golang-dev
https://golang.org/cl/5436056
2011-11-23 09:35:01 -05:00
Brad Fitzpatrick
750d0e33fb sql: more driver docs & tests; no functional changes
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5415055
2011-11-20 14:56:49 -05:00
Dave Cheney
fb57134d47 exp/ssh: alter Session to match the exec.Cmd API
This CL inverts the direction of the Stdin/out/err members of the
Session struct so they reflect the API of the exec.Cmd. In doing so
it borrows heavily from the exec package.

Additionally Shell now returns immediately, wait for completion using
Wait. Exec calls Wait internally and so blocks until the remote
command is complete.

Credit to Gustavo Niemeyer for the impetus for this CL.

R=rsc, agl, n13m3y3r, huin, bradfitz
CC=cw, golang-dev
https://golang.org/cl/5322055
2011-11-20 11:46:35 -05:00
Nigel Tao
dbb591d8da exp/gui: delete exp/gui and exp/gui/x11. They are moving to
x-go-binding.googlecode.com.

R=rsc, rogpeppe
CC=golang-dev
https://golang.org/cl/5406041
2011-11-20 21:56:17 +11:00
John Beisley
0e60804b4a exp/ssh: Add support for (most) of the ciphers from RFC4253, RFC4344 and RFC4345.
R=dave, agl, taruti, rsc, r
CC=golang-dev
https://golang.org/cl/5342057
2011-11-18 12:56:57 -05:00
Dmitriy Vyukov
151bcb11a8 exp/terminal: fix Makefile formatting for deps.bash
deps.bash does not understand current format,
so make.bash fails (with MAKEFLAGS=-j20).

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5410046
2011-11-18 15:30:36 +03:00
Gustavo Niemeyer
558d055352 exp/terminal: fix build after os.Errno changes
Also include exp/terminal in linux build so such failures
are noticed.

R=rsc
CC=golang-dev
https://golang.org/cl/5416044
2011-11-18 01:12:57 -02:00
Alex Brainman
3ec82f6e09 exp/ssh: change test listen address, also exit test if fails
R=golang-dev, rsc
CC=dave, golang-dev
https://golang.org/cl/5364061
2011-11-17 11:20:42 +11:00
Russ Cox
8c6461bcb1 exp/ssh: fix test?
Fixes use of c after Dial failure (causes crash).
May fix Dial failure by listening to 127.0.0.1:0
instead of 0.0.0.0:0 (tests should only listen on
localhost).

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5395052
2011-11-16 18:13:50 -05:00
Dave Cheney
00f9b7680a exp/ssh: fix unmarshal test
Ensure that empty NameLists always return
a zero length []string, not nil.

In practice NameLists are only used in a few
message types and always consumed by a for
range function so the difference between nil
and []string{} is not significant.

Also, add exp/ssh to pkg/Makefile as suggested
by rsc.

R=rsc, agl
CC=golang-dev
https://golang.org/cl/5400042
2011-11-16 10:19:56 -05:00
Yasuhiro Matsumoto
5e5c5c2789 exp/sql: NumInput() allow -1 to ignore checking.
Some database driver can't get number of parameters.
For example:
        http://support.microsoft.com/kb/240205/en-us
So, added way to ignore checking number of parameters with return -1.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5376091
2011-11-15 16:29:43 -08:00
Brad Fitzpatrick
5b7827ec07 sql: document that for drivers, io.EOF means no more rows
This was used in the sql package + tests, but never
documented.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5372107
2011-11-15 14:29:45 -08:00
Brad Fitzpatrick
0a8005c772 sql: add DB.Close, fix bugs, remove Execer on Driver (only Conn)
R=rsc
CC=golang-dev
https://golang.org/cl/5372099
2011-11-14 10:48:26 -08:00
Russ Cox
c017a8299f syscall: use error
- syscall (not os) now defines the Errno type.
- the low-level assembly functions Syscall, Syscall6, and so on
  return Errno, not uintptr
- syscall wrappers all return error, not uintptr.

R=golang-dev, mikioh.mikioh, r, alex.brainman
CC=golang-dev
https://golang.org/cl/5372080
2011-11-13 22:44:52 -05:00
Dave Cheney
7af553ab52 exp/ssh: add direct-tcpip client support
This CL adds experimental support for making proxied
net.Conn connections via the remote server.

nb. Functional tests exist for this feature but CL
5320053 or similar needs to be committed to support them.

R=rsc, agl, n13m3y3r
CC=cw, golang-dev, huin
https://golang.org/cl/5371081
2011-11-13 21:05:35 -05:00
Dave Cheney
34466a1491 exp/ssh: add client functional tests
Requires CL 5373055

R=rsc, agl, n13m3y3r
CC=golang-dev
https://golang.org/cl/5320053
2011-11-13 20:58:51 -05:00
Dave Cheney
59a92cde3d exp/ssh: use ClientConfig.rand() for publickey authentication
Closes TODO from 5373055

R=agl
CC=golang-dev
https://golang.org/cl/5375081
2011-11-13 20:57:15 -05:00