Skip to content

Conversation

@Frando
Copy link
Member

@Frando Frando commented Dec 2, 2025

Description

Based on #179

This moves the QuicFrame generation into the qlog module. The public interface for recording frames in sent packets now either takes a crate::Frame, or for frame types where constructing such a frame would have a cost, there's a specialized method on the QlogSentPacket.

This keeps the mapping between frames and qlog::QuicFrame localized instead of spread out through the crate, and will make it much easier to add support for more frames.

Breaking Changes

Notes & open questions

@Frando Frando requested a review from flub December 2, 2025 13:48
@Frando Frando force-pushed the Frando/qlog-refactor branch from c45f0ec to 6cfdcb7 Compare December 2, 2025 13:53
@codecov-commenter
Copy link

codecov-commenter commented Dec 2, 2025

Codecov Report

❌ Patch coverage is 90.55118% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.68%. Comparing base (d3f378b) to head (aa24f52).
⚠️ Report is 6 commits behind head on Frando/qlog-qnt.

Files with missing lines Patch % Lines
quinn-proto/src/connection/mod.rs 80.64% 12 Missing ⚠️
Additional details and impacted files
@@                 Coverage Diff                 @@
##           Frando/qlog-qnt     #207      +/-   ##
===================================================
- Coverage            76.71%   76.68%   -0.04%     
===================================================
  Files                   83       83              
  Lines                22689    22663      -26     
===================================================
- Hits                 17406    17378      -28     
- Misses                5283     5285       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Collaborator

@flub flub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

length: None,
payload_length: None,
});
qlog.frame(&Frame::ResetStream(frame));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function has an inner cfg now, I think you can also remove the cfg here and the compiler should figure out this is all a noop and remove the call?

Also in the other locations in this file.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed.

frame.write(buf);
#[cfg(feature = "qlog")]
qlog.unknown_frame(&frame.get_type());
qlog.frame(&Frame::ObservedAddr(frame));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just occured to me that you might be able to write these all as &frame.into()? No need to do it, but you could if you like.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left it as-is, because the into is not available for all frame kinds (those that have primitive types are not covered).

@Frando Frando merged commit 145ba10 into Frando/qlog-qnt Dec 2, 2025
22 of 28 checks passed
@Frando Frando deleted the Frando/qlog-refactor branch December 2, 2025 14:08
truncated.encode(buf);
self.stats.frame_tx.crypto += 1;

// The clone is cheap but we still cfg it out if qlog is disabled.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW I don't think this matters: the way I understand it is that the compiler will always consider inlining functions from the same crate. It'll then see that this does nothing. And in turn it sees that this clone call is unused and remove it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants