also pass the stateless reset token by value to the tracer

This commit is contained in:
Marten Seemann 2020-07-10 11:32:21 +07:00
parent 0ef1b2f92e
commit a4679bc02e
2 changed files with 3 additions and 3 deletions

View file

@ -179,7 +179,7 @@ func (e eventVersionNegotiationReceived) MarshalJSONObject(enc *gojay.Encoder) {
}
type eventStatelessResetReceived struct {
Token *[16]byte
Token [16]byte
}
func (e eventStatelessResetReceived) Category() category { return categoryTransport }
@ -188,7 +188,7 @@ func (e eventStatelessResetReceived) IsNil() bool { return false }
func (e eventStatelessResetReceived) MarshalJSONObject(enc *gojay.Encoder) {
enc.StringKey("packet_type", packetType(logging.PacketTypeStatelessReset).String())
enc.StringKey("stateless_reset_token", fmt.Sprintf("%x", *e.Token))
enc.StringKey("stateless_reset_token", fmt.Sprintf("%x", e.Token))
}
type eventPacketBuffered struct {

View file

@ -171,7 +171,7 @@ func (t *connectionTracer) ClosedConnection(r logging.CloseReason) {
t.recordEvent(time.Now(), &eventConnectionClosed{Reason: timeoutReason(reason)})
} else if token, ok := r.StatelessReset(); ok {
t.recordEvent(time.Now(), &eventStatelessResetReceived{
Token: &token,
Token: token,
})
}
}