From 842934347d8007a691332b33c61afff8a907dda8 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Mon, 22 Nov 2021 08:58:34 +0100 Subject: [PATCH] debug --- lib/connections/connections_test.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/connections/connections_test.go b/lib/connections/connections_test.go index 705e32a41..2529dbdff 100644 --- a/lib/connections/connections_test.go +++ b/lib/connections/connections_test.go @@ -446,6 +446,7 @@ func withConnectionPair(b interface{ Fatal(...interface{}) }, connUri string, h } natSvc := nat.NewService(deviceId, wcfg) conns := make(chan internalConn, 1) + fmt.Println("listening", uri) listenSvc := lf.New(uri, wcfg, tlsCfg, conns, natSvc) supervisor.Add(listenSvc) @@ -468,7 +469,9 @@ func withConnectionPair(b interface{ Fatal(...interface{}) }, connUri string, h dialer := df.New(cfg.Options, tlsCfg) // Relays might take some time to register the device, so dial multiple times + fmt.Println("dialing", addr) clientConn, err := dialer.Dial(ctx, deviceId, addr) + fmt.Println("clientConn", clientConn.LocalAddr(), "->", clientConn.RemoteAddr()) if err != nil { for i := 0; i < 10 && err != nil; i++ { clientConn, err = dialer.Dial(ctx, deviceId, addr) @@ -487,6 +490,7 @@ func withConnectionPair(b interface{ Fatal(...interface{}) }, connUri string, h } serverConn := <-conns + fmt.Println("serverConn", serverConn.LocalAddr(), "->", serverConn.RemoteAddr()) recv := make([]byte, len(send)) if _, err := io.ReadFull(serverConn, recv); err != nil { @@ -502,7 +506,7 @@ func withConnectionPair(b interface{ Fatal(...interface{}) }, connUri string, h _ = serverConn.Close() } -func mustGetCert(b *testing.B) tls.Certificate { +func mustGetCert(b interface{ Fatal(...interface{}) }) tls.Certificate { cert, err := tlsutil.NewCertificateInMemory("bench", 10) if err != nil { b.Fatal(err)