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>
diff --git a/ssh/channel.go b/ssh/channel.go
index 5403c7e..6671c98 100644
--- a/ssh/channel.go
+++ b/ssh/channel.go
@@ -217,7 +217,7 @@
func (c *channel) sendMessage(msg interface{}) error {
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)
@@ -371,7 +371,7 @@
close(c.msg)
close(c.incomingRequests)
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.
c.sentClose = true
c.writeMu.Unlock()
diff --git a/ssh/mux.go b/ssh/mux.go
index a2af7f4..fb54c8b 100644
--- a/ssh/mux.go
+++ b/ssh/mux.go
@@ -131,6 +131,9 @@
func (m *mux) sendMessage(msg interface{}) error {
p := Marshal(msg)
+ if debugMux {
+ log.Printf("send global(%d): %#v", m.chanList.offset, msg)
+ }
return m.conn.writePacket(p)
}