Fix ctr crash when pulling with http-trace and http-dump
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
This commit is contained in:
parent
740c9335be
commit
9c2a634408
@ -200,7 +200,12 @@ func NewDebugClientTrace(ctx gocontext.Context) *httptrace.ClientTrace {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
GotConn: func(connInfo httptrace.GotConnInfo) {
|
GotConn: func(connInfo httptrace.GotConnInfo) {
|
||||||
log.G(ctx).WithField("reused", connInfo.Reused).WithField("remote_addr", connInfo.Conn.RemoteAddr().String()).Debugf("Connection successful")
|
remoteAddr := "<nil>"
|
||||||
|
if addr := connInfo.Conn.RemoteAddr(); addr != nil {
|
||||||
|
remoteAddr = addr.String()
|
||||||
|
}
|
||||||
|
|
||||||
|
log.G(ctx).WithField("reused", connInfo.Reused).WithField("remote_addr", remoteAddr).Debugf("Connection successful")
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user