Skip to content

Conversation

@danprudky
Copy link

Daniel Prudky added 15 commits December 18, 2025 11:08
…ogging, and implement connection management.
…lement connection state management, improve logging, and refine cleanup processes.
…ove outdated code sections, and organize code structure for clarity.
…ogging for stream events, and clean up debug code.
…ror handling with `StreamShutdown`, and clean up unused callbacks and logging.
…mprove stream and connection logging, and clean up unnecessary debug code.
…hod, improve handling of JSON-encoded protocol settings, and refine `SettingsParser` logic for cleaner value parsing.
…ne logging messages for clarity, and remove unused includes.
…better error handling, improve sender loop logic, and refine logging for message and connection events.
…ate with external_client::connection::ConnectionState
…ings::Constants::ALPN` for improved configurability.
@coderabbitai
Copy link

coderabbitai bot commented Jan 7, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch BAF-1256/use_quic_external_client

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Daniel Prudky added 8 commits January 7, 2026 09:02
…ed memory handling, update QUIC stream send logic, refine logging with stream IDs, and switch `initRegistration` to use `std::string`.
…er::logError` for error handling and ensure graceful returns in failure scenarios.
…::unique_ptr` with `std::string` for memory management.
…oped_lock` and simplify enum string conversion using `using enum`.
ZLIB::ZLIB
fleet-protocol-cxx-helpers-static::fleet-protocol-cxx-helpers-static
async-function-execution-shared::async-function-execution-shared
msquic
Copy link
Member

Choose a reason for hiding this comment

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

The msquic shall be added as a dependency to the Fleet Protocol Context
https://github.com/bringauto/packager-fleet-protocol-context

@koudis will add it in week 19. 1. 2026

case CONNECTING: return "Connecting";
case CONNECTED: return "Connected";
case CLOSING: return "Closing";
default: return "Unknown";

Choose a reason for hiding this comment

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

Use string constants like loggerVerbosityToString.
Put each return statements on a new line, like in loggerVerbosityToString.

Copy link
Author

Choose a reason for hiding this comment

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

Resolved in 3e5df14

QUIC_BUFFER buffer{};
std::string storage;

explicit SendBuffer(size_t size)

Choose a reason for hiding this comment

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

Maybe add a small docstring for struct SendBuffer, but definitely add a docstring for the constructor saying, that it initializes the buffer to size and fills it with zeroes

Copy link
Author

Choose a reason for hiding this comment

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

Resolved in e74bc2a

Choose a reason for hiding this comment

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

update the README in resources/config with descriptions of the new options you added

Copy link
Author

Choose a reason for hiding this comment

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

Resolved in c1b3a8c

{
auto copy = std::make_shared<ExternalProtocol::ExternalClient>(*message);
std::scoped_lock lock(outboundMutex_);
outboundQueue_.push(std::move(copy));

Choose a reason for hiding this comment

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

use unique_ptr - std::move(outboundQueue_.front()) and then outboundQueue_.pop() should work fine

also just a nitpick, but if you're only locking a single mutex, use lock_guard instead of scoped_lock

Copy link
Author

Choose a reason for hiding this comment

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

Resolved in 30123d9

alpnBuffer_.Length = static_cast<uint32_t>(alpn_.size());

loadMsQuic();
initRegistration("module-gateway-quic-client");

Choose a reason for hiding this comment

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

"module-gateway-quic-client" should be defined as a constexpr string_view, also if initRegistration is only going to be used like this, and the appName will not be configurable, then initRegistration should just have no arguments and use this constant directly

Copy link
Author

Choose a reason for hiding this comment

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

Resolved in 5853c70

}

void QuicCommunication::initConfiguration() {
configurationOpen(nullptr);

Choose a reason for hiding this comment

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

I think you should parse the config for QUIC_SETTINGS as well, the JSON keys could just be the same as the member names in https://github.com/microsoft/msquic/blob/main/docs/api/QUIC_SETTINGS.md, should probably be done in a new static class, responsible for QUIC config parsing, since there's a lot of options - you will need something slightly different from getProtocolSettingsString, each of the QUIC_SETTINGS should be optional, so it can't throw when it doesn't find the key, also you will need to parse the value as an unsigned integer, not just a string

we probably don't need all the settings, probably just allow parsing of timeout settings for now
just make it simple to add any additional options we might need in the future

Copy link
Author

Choose a reason for hiding this comment

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

Resolved in be11942

event->RECEIVE.BufferCount
);

std::vector<uint8_t> data;

Choose a reason for hiding this comment

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

according to https://github.com/microsoft/msquic/blob/main/docs/Streams.md#Receiving, BufferCount == 0 is valid and means end of stream data, maybe handle it as well?

Copy link
Author

Choose a reason for hiding this comment

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

Resolved in d2303a7

This is not treated as stream termination; data processing is skipped only.

Daniel Prudky added 3 commits January 15, 2026 09:26
…initRegistration` with a constant for simplification and improved consistency.
…ique_ptr` in outbound queue, update `sendViaQuicStream` to use references for improved memory management and clarity.
Daniel Prudky added 4 commits January 19, 2026 06:36
…pand protocol support, and provide examples for both.
…dBuffer` to clarify purpose, usage, and construction.
… `settings::Constants` for improved maintainability.
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
3 New Major Issues (required ≤ 0)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

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