diff --git a/mplexer/connwrap.go b/mplexer/connwrap.go index e338165..12c29a6 100644 --- a/mplexer/connwrap.go +++ b/mplexer/connwrap.go @@ -6,6 +6,7 @@ import ( "net" "time" + "git.coolaj86.com/coolaj86/go-telebitd/dbg" "git.coolaj86.com/coolaj86/go-telebitd/sni" ) @@ -137,7 +138,9 @@ func (c *ConnWrap) isEncrypted() bool { c.SetDeadline(time.Now().Add(5 * time.Second)) n := 6 b, err := c.Peek(n) - fmt.Printf("[debug] [wrap] Peek(%d): %s %s %s\n", n, b, string(b), err) + if dbg.Debug { + fmt.Printf("[debug] [wrap] Peek(%d): %s %v\n", n, string(b), err) + } if nil != err { // TODO return error on error? return encrypted diff --git a/mplexer/routemux.go b/mplexer/routemux.go index 240db6c..1bfe270 100644 --- a/mplexer/routemux.go +++ b/mplexer/routemux.go @@ -93,7 +93,7 @@ func (m *RouteMux) Serve(client net.Conn) error { } } - fmt.Println("No match found for", wconn.Scheme(), wconn.Servername()) + fmt.Printf("No match found for %q %q\n", wconn.Scheme(), wconn.Servername()) return client.Close() // TODO Chi-style route handling