Repository navigation
Expose the UDP peer address through socket.opened - #8825
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
There was a problem hiding this comment.
Superseded by the review of
5e8e2b40.
This review, of 54841749
💬 Approved with comments — The change is correct and tested. The only comment is an optional SUGGESTION about documenting that clientAddress is read once.
Findings: 1 suggestion (1 is an inline comment on the diff)
The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.
📋 Code Quality: 💬 1 suggestion
The change is correct and has an end-to-end test; one optional design suggestion.
Recommendation: 💬 Optional Nits
- [SUGGESTION] clientAddress is a public, mutable field that every reader moves out of (
src/workerd/io/io-context.h:148)
View full review
The client address now lives on IncomingRequest and reaches both the TCP connect() path and the UDP socket.opened.remoteAddress. The new constructor parameter defaults to kj::none, so existing callers still compile. The Rust listener passes peer.to_string(), which has the same ip:port format as the TCP path.
There is one optional suggestion: clientAddress is a public mutable field that each reader moves out of, so a second reader would get none.
✅ All other checks passed
📝 Documentation: ✅ LGTM
No documentation issues found.
Reviewed commit: 54841749
70f055a to
5e8e2b4
Compare
There was a problem hiding this comment.
Superseded by the review of
1f851d95.
This review, of 5e8e2b40
✅ Approved — The change is correct and tested, and the one suggestion from the last review is resolved; no new issues found.
The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.
✅ All checks passed
📋 Code Quality: ✅ LGTM
The client address goes from WorkerEntrypoint into IncomingRequest, and the TCP and UDP connect paths each move it out once. The member declaration order matches the initializer list. The Rust listener's address format matches the TCP path, and the new test asserts the exact peer address. The earlier note about the consumed field is resolved by the new comment on clientAddress.
📝 Documentation: ✅ LGTM
No documentation issues found.
Reviewed commit: 5e8e2b40
When request metadata includes a client address, pass it to the UDP socket so the connect() handler can read the peer IP and port from (await socket.opened).remoteAddress.
5e8e2b4 to
1f851d9
Compare
There was a problem hiding this comment.
✅ Approved — The change is correct and has a test that checks the exact peer address. No issues were found, and nothing has changed since the last approved review.
The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.
✅ All checks passed
🔒 Security: ✅ LGTM
No security issues found.
📋 Code Quality: ✅ LGTM
- Address handoff:
clientAddressgoes fromWorkerEntrypointintoIncomingRequest. The TCPconnectpath and the UDP path each move it out exactly once. connectUdpsignature: the change is applied in the header, the implementation and the only caller.- Member order: the order of members in
IncomingRequestmatches the initializer list. - UDP listener:
udp.rspassespeer.to_string()as the client address. - Test: the new test asserts the exact peer address.
📝 Documentation: ✅ LGTM
No documentation issues found.
Reviewed commit: 1f851d95
When request metadata includes a client address, pass it to the UDP socket so the connect() handler can read the peer IP and port from
(await socket.opened).remoteAddress.