Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #11031 - HttpClient should expose Connection/EndPoint used by H… #11033

Merged
merged 2 commits into from
Dec 13, 2023

Conversation

sbordet
Copy link
Contributor

@sbordet sbordet commented Dec 9, 2023

…TTP requests.

Introduced method Request.getConnection() to expose the Connection after at the request begin event.

…TTP requests.

Introduced method Request.getConnection() to expose the Connection after at the request begin event.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
@sbordet sbordet requested review from lorban and gregw December 9, 2023 11:25
@sbordet sbordet added the Sponsored This issue affects a user with a commercial support agreement label Dec 9, 2023
@sbordet sbordet linked an issue Dec 9, 2023 that may be closed by this pull request
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Copy link
Contributor

@lorban lorban left a comment

Choose a reason for hiding this comment

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

LGTM except that I'm not convinced by the default marker of the new interface methods.

* or {@code null} if there is no connection associated
* with this request
*/
default Connection getConnection()
Copy link
Contributor

Choose a reason for hiding this comment

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

Why mark that method as default?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because it is an existing interface that people may have implemented (e.g. for wrapping), and we don't want to break them.

/**
* @return the local socket address associated with the connection
*/
default SocketAddress getLocalSocketAddress()
Copy link
Contributor

Choose a reason for hiding this comment

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

Why mark that method as default?

/**
* @return the remote socket address associated with the connection
*/
default SocketAddress getRemoteSocketAddress()
Copy link
Contributor

Choose a reason for hiding this comment

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

Why mark that method as default?

@sbordet sbordet requested a review from lorban December 11, 2023 09:15
@sbordet sbordet merged commit efda646 into jetty-10.0.x Dec 13, 2023
9 checks passed
@sbordet sbordet deleted the fix/11031/expose-request-connection branch December 13, 2023 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Sponsored This issue affects a user with a commercial support agreement
Projects
No open projects
Status: ✅ Done
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

HttpClient should expose Connection/EndPoint used by HTTP requests
4 participants