forked from mozilla/neqo
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix qlog issues to enable correct qvis rendering (mozilla#1544)
* Fix qlog issues that affect correct qvis rendering * Add tests * Log tparams with valid timestamp * Log ACTIVE_CONNECTION_ID_LIMIT and PREFERRED_ADDRESS to qlog. * Fix imports * More tests * Add clippy ignores * Restore fix to logging tparams with valid timestamp No idea how that got reverted * Interim commit * Progress * Enable qlog generation for some more tests * Update test-fixture/src/lib.rs Co-authored-by: Max Inden <[email protected]> * Update test-fixture/src/lib.rs Co-authored-by: Max Inden <[email protected]> * Update neqo-transport/src/qlog.rs Co-authored-by: Max Inden <[email protected]> * Update neqo-common/src/qlog.rs Co-authored-by: Max Inden <[email protected]> * Incorporate suggestions from @mxinden - thanks! * More readable JSON literals * Undo one suggestion per @martinthomson * Update neqo-common/src/qlog.rs Co-authored-by: Martin Thomson <[email protected]> * Update neqo-common/src/qlog.rs Co-authored-by: Martin Thomson <[email protected]> * Update neqo-common/src/qlog.rs Co-authored-by: Martin Thomson <[email protected]> * Suggestions from @martinthomson * Fix clippy. --------- Co-authored-by: Max Inden <[email protected]> Co-authored-by: Martin Thomson <[email protected]>
- Loading branch information
1 parent
9d58e64
commit 70e3ac4
Showing
8 changed files
with
158 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ use qlog::events::{ | |
AckedRanges, ErrorSpace, MetricsUpdated, PacketDropped, PacketHeader, PacketLost, | ||
PacketReceived, PacketSent, QuicFrame, StreamType, VersionInformation, | ||
}, | ||
Event, EventData, RawInfo, | ||
EventData, RawInfo, | ||
}; | ||
|
||
use neqo_common::{hex, qinfo, qlog::NeqoQlog, Decoder}; | ||
|
@@ -37,7 +37,7 @@ use crate::{ | |
}; | ||
|
||
pub fn connection_tparams_set(qlog: &mut NeqoQlog, tph: &TransportParametersHandler) { | ||
qlog.add_event(|| { | ||
qlog.add_event_data(|| { | ||
let remote = tph.remote(); | ||
let ev_data = EventData::TransportParametersSet( | ||
qlog::events::quic::TransportParametersSet { | ||
|
@@ -61,20 +61,26 @@ pub fn connection_tparams_set(qlog: &mut NeqoQlog, tph: &TransportParametersHand | |
max_udp_payload_size: Some(remote.get_integer(tparams::MAX_UDP_PAYLOAD_SIZE) as u32), | ||
ack_delay_exponent: Some(remote.get_integer(tparams::ACK_DELAY_EXPONENT) as u16), | ||
max_ack_delay: Some(remote.get_integer(tparams::MAX_ACK_DELAY) as u16), | ||
// TODO([email protected]): We do not yet handle ACTIVE_CONNECTION_ID_LIMIT in tparams yet. | ||
active_connection_id_limit: None, | ||
active_connection_id_limit: Some(remote.get_integer(tparams::ACTIVE_CONNECTION_ID_LIMIT) as u32), | ||
initial_max_data: Some(remote.get_integer(tparams::INITIAL_MAX_DATA)), | ||
initial_max_stream_data_bidi_local: Some(remote.get_integer(tparams::INITIAL_MAX_STREAM_DATA_BIDI_LOCAL)), | ||
initial_max_stream_data_bidi_remote: Some(remote.get_integer(tparams::INITIAL_MAX_STREAM_DATA_BIDI_REMOTE)), | ||
initial_max_stream_data_uni: Some(remote.get_integer(tparams::INITIAL_MAX_STREAM_DATA_UNI)), | ||
initial_max_streams_bidi: Some(remote.get_integer(tparams::INITIAL_MAX_STREAMS_BIDI)), | ||
initial_max_streams_uni: Some(remote.get_integer(tparams::INITIAL_MAX_STREAMS_UNI)), | ||
// TODO([email protected]): We do not yet handle PREFERRED_ADDRESS in tparams yet. | ||
preferred_address: None, | ||
preferred_address: remote.get_preferred_address().and_then(|(paddr, cid)| { | ||
Some(qlog::events::quic::PreferredAddress { | ||
ip_v4: paddr.ipv4()?.ip().to_string(), | ||
ip_v6: paddr.ipv6()?.ip().to_string(), | ||
port_v4: paddr.ipv4()?.port(), | ||
port_v6: paddr.ipv6()?.port(), | ||
connection_id: cid.connection_id().to_string(), | ||
stateless_reset_token: hex(cid.reset_token()), | ||
}) | ||
}), | ||
}); | ||
|
||
// This event occurs very early, so just mark the time as 0.0. | ||
Some(Event::with_time(0.0, ev_data)) | ||
Some(ev_data) | ||
}); | ||
} | ||
|
||
|
@@ -194,8 +200,8 @@ pub fn packet_sent( | |
let mut d = Decoder::from(body); | ||
let header = PacketHeader::with_type(to_qlog_pkt_type(pt), Some(pn), None, None, None); | ||
let raw = RawInfo { | ||
length: None, | ||
payload_length: Some(plen as u64), | ||
length: Some(plen as u64), | ||
payload_length: None, | ||
data: None, | ||
}; | ||
|
||
|
@@ -229,18 +235,18 @@ pub fn packet_sent( | |
}); | ||
} | ||
|
||
pub fn packet_dropped(qlog: &mut NeqoQlog, payload: &PublicPacket) { | ||
pub fn packet_dropped(qlog: &mut NeqoQlog, public_packet: &PublicPacket) { | ||
qlog.add_event_data(|| { | ||
let header = PacketHeader::with_type( | ||
to_qlog_pkt_type(payload.packet_type()), | ||
to_qlog_pkt_type(public_packet.packet_type()), | ||
None, | ||
None, | ||
None, | ||
None, | ||
); | ||
let raw = RawInfo { | ||
length: None, | ||
payload_length: Some(payload.len() as u64), | ||
length: Some(public_packet.len() as u64), | ||
payload_length: None, | ||
data: None, | ||
}; | ||
|
||
|
@@ -290,8 +296,8 @@ pub fn packet_received( | |
None, | ||
); | ||
let raw = RawInfo { | ||
length: None, | ||
payload_length: Some(public_packet.len() as u64), | ||
length: Some(public_packet.len() as u64), | ||
payload_length: None, | ||
data: None, | ||
}; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters