Merge pull request #2505 from lucas-clemente/fix-remote-addr-qlogging

fix qlogging of the remote address when dialing a new connection
This commit is contained in:
Marten Seemann
2020-04-25 16:24:27 +07:00
committed by GitHub
2 changed files with 2 additions and 2 deletions

View File

@@ -252,7 +252,7 @@ func newClient(
func (c *client) dial(ctx context.Context) error {
c.logger.Infof("Starting new connection to %s (%s -> %s), source connection ID %s, destination connection ID %s, version %s", c.tlsConf.ServerName, c.conn.LocalAddr(), c.conn.RemoteAddr(), c.srcConnID, c.destConnID, c.version)
if c.qlogger != nil {
c.qlogger.StartedConnection(c.conn.LocalAddr(), c.conn.LocalAddr(), c.version, c.srcConnID, c.destConnID)
c.qlogger.StartedConnection(c.conn.LocalAddr(), c.conn.RemoteAddr(), c.version, c.srcConnID, c.destConnID)
}
c.mutex.Lock()

View File

@@ -243,7 +243,7 @@ var _ = Describe("Client", func() {
sess.EXPECT().run()
return sess
}
qlogger.EXPECT().StartedConnection(gomock.Any(), gomock.Any(), protocol.VersionTLS, gomock.Any(), gomock.Any())
qlogger.EXPECT().StartedConnection(packetConn.addr, addr, protocol.VersionTLS, gomock.Any(), gomock.Any())
_, err := Dial(
packetConn,
addr,