mirror of
https://github.com/golang/go
synced 2024-11-22 05:24:39 -07:00
exp/ssh: rename (some) fields
R=dave, agl, agl CC=golang-dev https://golang.org/cl/5494057
This commit is contained in:
parent
0aaf2c2d10
commit
f53cc8e6ff
@ -306,7 +306,6 @@ type clientChan struct {
|
|||||||
stdout *chanReader // receives the payload of channelData messages
|
stdout *chanReader // receives the payload of channelData messages
|
||||||
stderr *chanReader // receives the payload of channelExtendedData messages
|
stderr *chanReader // receives the payload of channelExtendedData messages
|
||||||
msg chan interface{} // incoming messages
|
msg chan interface{} // incoming messages
|
||||||
|
|
||||||
theyClosed bool // indicates the close msg has been received from the remote side
|
theyClosed bool // indicates the close msg has been received from the remote side
|
||||||
weClosed bool // incidates the close msg has been sent from our side
|
weClosed bool // incidates the close msg has been sent from our side
|
||||||
}
|
}
|
||||||
|
@ -70,7 +70,7 @@ type Session struct {
|
|||||||
|
|
||||||
started bool // true once Start, Run or Shell is invoked.
|
started bool // true once Start, Run or Shell is invoked.
|
||||||
copyFuncs []func() error
|
copyFuncs []func() error
|
||||||
errch chan error // one send per copyFunc
|
errors chan error // one send per copyFunc
|
||||||
|
|
||||||
// true if pipe method is active
|
// true if pipe method is active
|
||||||
stdinpipe, stdoutpipe, stderrpipe bool
|
stdinpipe, stdoutpipe, stderrpipe bool
|
||||||
@ -244,10 +244,10 @@ func (s *Session) start() error {
|
|||||||
setupFd(s)
|
setupFd(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
s.errch = make(chan error, len(s.copyFuncs))
|
s.errors = make(chan error, len(s.copyFuncs))
|
||||||
for _, fn := range s.copyFuncs {
|
for _, fn := range s.copyFuncs {
|
||||||
go func(fn func() error) {
|
go func(fn func() error) {
|
||||||
s.errch <- fn()
|
s.errors <- fn()
|
||||||
}(fn)
|
}(fn)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
@ -270,7 +270,7 @@ func (s *Session) Wait() error {
|
|||||||
|
|
||||||
var copyError error
|
var copyError error
|
||||||
for _ = range s.copyFuncs {
|
for _ = range s.copyFuncs {
|
||||||
if err := <-s.errch; err != nil && copyError == nil {
|
if err := <-s.errors; err != nil && copyError == nil {
|
||||||
copyError = err
|
copyError = err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user