go.crypto/ssh: assorted close related fixes

Fixes golang/go#3810.

Fixes chanWriter Write after close behaviour bug.

Fixes serverChan writePacket after close bug.

Addresses final comments by agl on 6405064, plus various cleanups.

R=agl, kardianos, gustav.paul, fullung
CC=golang-dev
https://golang.org/cl/6479056
This commit is contained in:
Dave Cheney
2012-09-05 09:47:02 +10:00
parent 06790d30c2
commit 552202b8e3
5 changed files with 51 additions and 60 deletions
+1 -1
View File
@@ -536,7 +536,7 @@ func (s *ServerConn) Accept() (Channel, error) {
// TODO(dfc) s.lock protects s.channels but isn't being held here.
for _, c := range s.channels {
c.dead = true
c.setDead()
c.handleData(nil)
}