x/crypto/ssh: if debugMux is set, also log global messages.
Change-Id: I685ba7f30f1d2e2bc3c078c7bddb6d383a179113 Reviewed-on: https://go-review.googlesource.com/22416 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Han-Wen Nienhuys <hanwen@google.com>
This commit is contained in:
+2
-2
@@ -217,7 +217,7 @@ func (c *channel) writePacket(packet []byte) error {
|
|||||||
|
|
||||||
func (c *channel) sendMessage(msg interface{}) error {
|
func (c *channel) sendMessage(msg interface{}) error {
|
||||||
if debugMux {
|
if debugMux {
|
||||||
log.Printf("send %d: %#v", c.mux.chanList.offset, msg)
|
log.Printf("send(%d): %#v", c.mux.chanList.offset, msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
p := Marshal(msg)
|
p := Marshal(msg)
|
||||||
@@ -371,7 +371,7 @@ func (c *channel) close() {
|
|||||||
close(c.msg)
|
close(c.msg)
|
||||||
close(c.incomingRequests)
|
close(c.incomingRequests)
|
||||||
c.writeMu.Lock()
|
c.writeMu.Lock()
|
||||||
// This is not necesary for a normal channel teardown, but if
|
// This is not necessary for a normal channel teardown, but if
|
||||||
// there was another error, it is.
|
// there was another error, it is.
|
||||||
c.sentClose = true
|
c.sentClose = true
|
||||||
c.writeMu.Unlock()
|
c.writeMu.Unlock()
|
||||||
|
|||||||
@@ -131,6 +131,9 @@ func newMux(p packetConn) *mux {
|
|||||||
|
|
||||||
func (m *mux) sendMessage(msg interface{}) error {
|
func (m *mux) sendMessage(msg interface{}) error {
|
||||||
p := Marshal(msg)
|
p := Marshal(msg)
|
||||||
|
if debugMux {
|
||||||
|
log.Printf("send global(%d): %#v", m.chanList.offset, msg)
|
||||||
|
}
|
||||||
return m.conn.writePacket(p)
|
return m.conn.writePacket(p)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user