https://codereview.appspot.com/37730043/diff/160001/ssh/client.go File ssh/client.go (right): https://codereview.appspot.com/37730043/diff/160001/ssh/client.go#newcode34 ssh/client.go:34: // Client returns a new SSH client connection using ...
10 years, 4 months ago
(2013-12-12 16:18:01 UTC)
#5
https://codereview.appspot.com/37730043/diff/160001/ssh/client.go
File ssh/client.go (right):
https://codereview.appspot.com/37730043/diff/160001/ssh/client.go#newcode34
ssh/client.go:34: // Client returns a new SSH client connection using c as the
underlying transport.
On 2013/12/12 10:38:19, hanwen-google wrote:
> I tried clarifying, not sure if I succeeded.
I think some thought is probably still needed here, but this CL need not be
delayed if you don't want to.
There are three layers in play (I think):
net.Conn --(NewClientConn)--> ssh.Conn --(Client)--> *ssh.ClientConn
I seems odd that NewClientConn *doesn't* return a *ClientConn.
On the other side, there's no Server() function any longer, one deals directly
with a ServerConn, but NewServerConn *does* create that?
It seems that ssh.Conn is common between clients and servers, except for the
handshake. Perhaps:
NewClientConn(net.Conn, addr, config) (Conn, <-chan NewChannel, <-chan *Request,
error)
and, likewise, NewServerConn() (differing only in the flavor of handshake)
Then ClientConn could be renamed to Client, and the current Client() become
NewClient().
https://codereview.appspot.com/37730043/diff/180001/ssh/connection.go
File ssh/connection.go (right):
https://codereview.appspot.com/37730043/diff/180001/ssh/connection.go#newcode72
ssh/connection.go:72: // Disconnect
On 2013/12/12 11:19:03, hanwen-google wrote:
> any opinion on these?
I think being cautious with what's exposed is fine.
Google Germany GmbH - ABC-Str. 19 - 20354 Hamburg Registergericht und -nummer: Hamburg, HRB 86891 ...
10 years, 4 months ago
(2013-12-12 16:21:36 UTC)
#6
Google Germany GmbH - ABC-Str. 19 - 20354 Hamburg
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg - Geschäftsführer: Graham Law,
Christine Elizabeth Flores
On Thu, Dec 12, 2013 at 5:18 PM, <agl@golang.org> wrote:
>
> https://codereview.appspot.com/37730043/diff/160001/ssh/client.go
> File ssh/client.go (right):
>
> https://codereview.appspot.com/37730043/diff/160001/ssh/client.go#newcode34
> ssh/client.go:34: // Client returns a new SSH client connection using c
> as the underlying transport.
> On 2013/12/12 10:38:19, hanwen-google wrote:
>>
>> I tried clarifying, not sure if I succeeded.
>
>
> I think some thought is probably still needed here, but this CL need not
> be delayed if you don't want to.
>
> There are three layers in play (I think):
>
> net.Conn --(NewClientConn)--> ssh.Conn --(Client)--> *ssh.ClientConn
>
> I seems odd that NewClientConn *doesn't* return a *ClientConn.
>
> On the other side, there's no Server() function any longer, one deals
> directly with a ServerConn, but NewServerConn *does* create that?
>
> It seems that ssh.Conn is common between clients and servers, except for
> the handshake. Perhaps:
>
> NewClientConn(net.Conn, addr, config) (Conn, <-chan NewChannel, <-chan
> *Request, error)
>
> and, likewise, NewServerConn() (differing only in the flavor of
> handshake)
>
> Then ClientConn could be renamed to Client, and the current Client()
> become NewClient().
SGTM . I'll do this, probably tomorrow morning.
--
Han-Wen Nienhuys
Google Munich
hanwen@google.com
Issue 37730043: code review 37730043: gosshnew/ssh: introduce ssh.Conn, representing the conn...
(Closed)
Created 10 years, 4 months ago by hanwen-google
Modified 10 years, 4 months ago
Reviewers:
Base URL:
Comments: 13