Skip to content

Initial libquicr session implementation - #189

Merged
TimEvens merged 15 commits into
mainfrom
draft-18-session
Sep 15, 2026
Merged

TimEvens merged 15 commits into
mainfrom
draft-18-session

Conversation

@TimEvens

Copy link
Copy Markdown
Collaborator

No description provided.

@TimEvens
TimEvens changed the base branch from main to draft-18 August 12, 2026 18:06
Base automatically changed from draft-18 to main August 14, 2026 18:47
@TimEvens
TimEvens marked this pull request as ready for review September 8, 2026 14:11
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-08T14:17:05.257305Z 3ab5fda Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3ab5fdaa28

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +79 to +82
connection_->SetDelegate(shared_from_this());

SPDLOG_LOGGER_DEBUG(LOGGER, "Control stream ID {0}", control_data_ctx_id_);
// The peer answers on the same stream, so the control exchange needs a bidirectional one
control_stream_ = transport_->CreateRequestStream(connection_);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Create the control stream before attaching the delegate

When an outbound connection reaches kReady before SetDelegate() is called, attaching the delegate replays that status and OnConnectionStatus() immediately calls SendConnect(). Because control_stream_ is not created until afterward, SendControl() drops the only CONNECT message and the peering handshake remains stuck. Create the request stream before attaching the delegate, or retry the handshake after the stream exists.

Useful? React with 👍 / 👎.

Comment on lines +1300 to +1301
peer_sess = std::move(peer_it->second);
server_peer_sessions_.erase(peer_it);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Keep the inbound peer registered during disconnect cleanup

When OnConnectionClosed is delivered before the delegate's disconnected status, this erases the inbound session and then calls SessionChanged(). That cleanup calls SubscribeInfoReceived(peer_session_id, ..., true), whose first operation is GetPeerSession(peer_session_id); the lookup now throws and its catch skips the subscription withdrawal, leaving stale subscriber state and forwarding decisions. Run SessionChanged() before erasing the session, or make disconnect cleanup independent of that lookup.

Useful? React with 👍 / 👎.

Comment thread src/client_manager.cc
Comment on lines +54 to +57
session_manager_->AddTransport(server_config_,
std::static_pointer_cast<quicr::Session::ServerCallbacks>(shared_from_this()));

return quicr::Session::Status::kReady;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Report listener startup failures instead of unconditional readiness

When the server transport cannot be added or become ready—for example because the listening port is already occupied or TLS configuration is invalid—Start() still returns kReady without checking the result or transport status. main.cc relies on this return value to detect startup failure, so the process can remain running even though it is not accepting clients. Return the actual listener/session status or propagate an AddTransport failure.

Useful? React with 👍 / 👎.

Comment thread src/client_manager.cc
Comment on lines +95 to +97
// Peer address requires the owning transport; SessionManager does not expose it. See libquicr issue.
const auto [ip, port] = GetPeerAddress(nullptr, session->GetConnection());
metrics_publisher_.AddConnection(connection_handle, { ip, port });

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve remote addresses in connection metrics

For every accepted client this passes a literal null transport to GetPeerAddress(), whose first branch always returns an empty address and port zero. Consequently all connection metric samples now lose remote_ip and remote_port, even though those fields previously came from NewConnectionAccepted and remain part of the documented metrics payload. Obtain the owning transport through the session manager/callback rather than invoking the helper with nullptr.

Useful? React with 👍 / 👎.

@TimEvens
TimEvens merged commit 87cd490 into main Sep 15, 2026
2 checks passed
@TimEvens
TimEvens deleted the draft-18-session branch September 15, 2026 17:13
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.

2 participants