Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(755)

Issue 6128059: code review 6128059: go.crypto/ssh: move common channel methods into an embe... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 12 months ago by dave
Modified:
11 years, 11 months ago
Reviewers:
CC:
agl1, gpaul, golang-dev
Visibility:
Public.

Description

go.crypto/ssh: move common channel methods into an embedded struct This CL introduces a new struct, channel to hold common shared functions. * add a new channel struct, which is embeded in {client,server}Chan. * move common methods from {client,server}Chan into channel. * remove unneeded used of serverConn.lock in serverChan (transport.writePacket has its own mutex). * remove filteredConn, introduce conn.

Patch Set 1 #

Patch Set 2 : diff -r 71651a57184a https://code.google.com/p/go.crypto #

Patch Set 3 : diff -r 71651a57184a https://code.google.com/p/go.crypto #

Patch Set 4 : diff -r 71651a57184a https://code.google.com/p/go.crypto #

Patch Set 5 : diff -r 71651a57184a https://code.google.com/p/go.crypto #

Patch Set 6 : diff -r 71651a57184a https://code.google.com/p/go.crypto #

Patch Set 7 : diff -r f7dd94cf509c https://code.google.com/p/go.crypto #

Patch Set 8 : diff -r f7dd94cf509c https://code.google.com/p/go.crypto #

Patch Set 9 : diff -r 249fab80a9e4 https://code.google.com/p/go.crypto #

Patch Set 10 : diff -r 249fab80a9e4 https://code.google.com/p/go.crypto #

Patch Set 11 : diff -r 249fab80a9e4 https://code.google.com/p/go.crypto #

Total comments: 4

Patch Set 12 : diff -r 249fab80a9e4 https://code.google.com/p/go.crypto #

Total comments: 4

Patch Set 13 : diff -r 249fab80a9e4 https://code.google.com/p/go.crypto #

Unified diffs Side-by-side diffs Delta from patch set Stats (+123 lines, -142 lines) Patch
M ssh/channel.go View 1 2 3 4 5 6 7 8 9 10 11 chunks +59 lines, -45 lines 0 comments Download
M ssh/client.go View 1 2 3 4 5 6 7 8 9 10 7 chunks +24 lines, -47 lines 0 comments Download
M ssh/server.go View 1 2 3 4 5 6 7 8 9 10 11 7 chunks +30 lines, -28 lines 0 comments Download
M ssh/transport.go View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +10 lines, -22 lines 0 comments Download

Messages

Total messages: 12
dave_cheney.net
Hello agl@golang.org, gustav.paul@gmail.com (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://code.google.com/p/go.crypto
11 years, 12 months ago (2012-05-01 10:59:32 UTC) #1
agl1
I think this CL is helpful and I'm not sure that it needs to be ...
11 years, 12 months ago (2012-05-02 17:03:25 UTC) #2
dave_cheney.net
Thanks for your comments agl. This CL was a quick and dirty search and replace ...
11 years, 12 months ago (2012-05-02 22:34:51 UTC) #3
dave_cheney.net
Hello agl@golang.org, gustav.paul@gmail.com (cc: golang-dev@googlegroups.com), Please take another look.
11 years, 11 months ago (2012-05-05 08:08:42 UTC) #4
agl1
LGTM http://codereview.appspot.com/6128059/diff/24005/ssh/channel.go File ssh/channel.go (right): http://codereview.appspot.com/6128059/diff/24005/ssh/channel.go#newcode246 ssh/channel.go:246: if err = c.writePacket(packet); err != nil { ...
11 years, 11 months ago (2012-05-07 14:40:01 UTC) #5
dave_cheney.net
Thank you for your comments. http://codereview.appspot.com/6128059/diff/24005/ssh/channel.go File ssh/channel.go (right): http://codereview.appspot.com/6128059/diff/24005/ssh/channel.go#newcode246 ssh/channel.go:246: if err = c.writePacket(packet); ...
11 years, 11 months ago (2012-05-07 15:20:50 UTC) #6
dave_cheney.net
re: writePacket and locks. The only place where writePacket is now called holding c.serverConn.lock is ...
11 years, 11 months ago (2012-05-07 15:30:56 UTC) #7
dave_cheney.net
Hello agl@golang.org, gustav.paul@gmail.com (cc: golang-dev@googlegroups.com), Please take another look.
11 years, 11 months ago (2012-05-07 15:31:36 UTC) #8
gpaul
This patch cleans up the channel code quite a bit. Thanks Dave http://codereview.appspot.com/6128059/diff/20006/ssh/client.go File ssh/client.go ...
11 years, 11 months ago (2012-05-08 22:01:19 UTC) #9
agl1
(p.s. if you were waiting for me, my previous LGTM still stands.)
11 years, 11 months ago (2012-05-08 22:03:43 UTC) #10
gpaul
LGTM too. My comments are minor nitpicks, feel free to land. On Wed, May 9, ...
11 years, 11 months ago (2012-05-08 22:05:11 UTC) #11
dave_cheney.net
11 years, 11 months ago (2012-05-08 22:20:10 UTC) #12
*** Submitted as
http://code.google.com/p/go/source/detail?r=540906e566d5&repo=crypto ***

go.crypto/ssh: move common channel methods into an embedded struct

This CL introduces a new struct, channel to hold common shared
functions.

* add a new channel struct, which is embeded in {client,server}Chan.
* move common methods from {client,server}Chan into channel.
* remove unneeded used of serverConn.lock in serverChan
 (transport.writePacket has its own mutex).
* remove filteredConn, introduce conn.

R=agl, gustav.paul
CC=golang-dev
http://codereview.appspot.com/6128059

http://codereview.appspot.com/6128059/diff/20006/ssh/client.go
File ssh/client.go (right):

http://codereview.appspot.com/6128059/diff/20006/ssh/client.go#newcode428
ssh/client.go:428: channel
I prefer to embed structs directly (ie, not as pointers). The reason
stdin/out/err are pointers, is it makes them easier to pass to things expecting
io.Reader/Writer.

http://codereview.appspot.com/6128059/diff/20006/ssh/transport.go
File ssh/transport.go (right):

http://codereview.appspot.com/6128059/diff/20006/ssh/transport.go#newcode50
ssh/transport.go:50: // writer represnts the outgoing connection state.
On 2012/05/08 22:01:19, gpaul wrote:
> typo, represents

Done.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b