-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
qlog: add support for alpn_information event #4216
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -34,6 +34,7 @@ type ConnectionTracer struct { | |||||
LossTimerExpired func(TimerType, EncryptionLevel) | ||||||
LossTimerCanceled func() | ||||||
ECNStateUpdated func(state ECNState, trigger ECNStateTrigger) | ||||||
ChoseAlpn func(protocol string) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think Go naming conventions would tell us to write it this way:
Suggested change
|
||||||
// Close is called when the connection is closed. | ||||||
Close func() | ||||||
Debug func(name, msg string) | ||||||
|
@@ -237,6 +238,13 @@ func NewMultiplexedConnectionTracer(tracers ...*ConnectionTracer) *ConnectionTra | |||||
} | ||||||
} | ||||||
}, | ||||||
ChoseAlpn: func(protocol string) { | ||||||
for _, t := range tracers { | ||||||
if t.ChoseAlpn != nil { | ||||||
t.ChoseAlpn(protocol) | ||||||
} | ||||||
} | ||||||
}, | ||||||
Close: func() { | ||||||
for _, t := range tracers { | ||||||
if t.Close != nil { | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -554,3 +554,15 @@ func (e eventGeneric) IsNil() bool { return false } | |||||
func (e eventGeneric) MarshalJSONObject(enc *gojay.Encoder) { | ||||||
enc.StringKey("details", e.msg) | ||||||
} | ||||||
|
||||||
type eventAlpnInformation struct { | ||||||
marten-seemann marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
chosenAlpn string | ||||||
marten-seemann marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
} | ||||||
|
||||||
func (e eventAlpnInformation) Category() category { return categoryTransport } | ||||||
func (e eventAlpnInformation) Name() string { return "alpn_information" } | ||||||
func (e eventAlpnInformation) IsNil() bool { return false } | ||||||
|
||||||
func (e eventAlpnInformation) MarshalJSONObject(enc *gojay.Encoder) { | ||||||
enc.StringKeyOmitEmpty("chosen_alpn", e.chosenAlpn) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's not omit the empty value.
Suggested change
|
||||||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should be able to log this earlier, at the very latest on handshake completion.