Skip to content

Allow AhcEndpoint address override in grizzly provider #1122

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

Merged
merged 1 commit into from
Mar 30, 2016

Conversation

elrodro83
Copy link

Add usage of Request#getInetAddress() in grizzly provider.

This allows for overriding the address where the physical connection is established, by setting it in the request instead of letting the provider use the host from the url or the proxy.

Netty is already doing this (https://github.com/AsyncHttpClient/async-http-client/blob/1.9.x/src/main/java/com/ning/http/client/providers/netty/request/NettyRequestSender.java#L354) among with other name resolution stuff, and it is a feature i am needing in grizzly provider.

ProxyServer proxyServer) {
return request.getConnectionPoolPartitioning()
.getPartitionKey(request.getUri(), proxyServer).toString();
return overrideAddress != null ? overrideAddress.toString() + "_" : "" +
Copy link
Contributor

Choose a reason for hiding this comment

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

is it supposed to be
(overrideAddress != null ? overrideAddress.toString() + "_" : "") +
request.getConnectionPoolPartitioning()
.getPartitionKey(request.getUri(), proxyServer).toString();

?

Copy link
Author

Choose a reason for hiding this comment

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

Yes, thanks for pointing out. Fixed it.

@slandelle
Copy link
Contributor

First, before going into reviewing the implementation (I'll leave this for @oleksiys as this is on the Grizzly side), there's a very important step! You didn't describe the purpose of your proposed change!!! What is this for? Is it a bug? A new feature?

@elrodro83
Copy link
Author

@slandelle Thanks, i just edited the first comment in the PR.

@oleksiys
Copy link
Contributor

@slandelle can we ignore that integration failure? not sure if it's related to the change at all.
Thanks.

@slandelle
Copy link
Contributor

@oleksiys Yes, you can ignore Travis on 1.9. Travis is enabled globally on the repo but there's no yaml file in 1.9 as tests would fail anyway (some old tests are localized and only work outside NA, where Travis hosts are of course based).

@oleksiys oleksiys merged commit cfe5f40 into AsyncHttpClient:1.9.x Mar 30, 2016
@oleksiys
Copy link
Contributor

thank you!

@elrodro83
Copy link
Author

@slandelle
Excellent. Would it be possible to get a version out with this change?
Thanks in advance.

@elrodro83 elrodro83 deleted the addressOverride branch March 30, 2016 14:40
@slandelle slandelle added this to the 1.9.37 milestone Mar 30, 2016
@slandelle
Copy link
Contributor

I juste released 1.9.37

@oleksiys
Copy link
Contributor

thank you!

@elrodro83
Copy link
Author

Thanks to both of you.

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

Successfully merging this pull request may close these issues.

3 participants