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

Fix connection pooling for different clients with the same pool. #5520

Merged
merged 1 commit into from Oct 2, 2019

Conversation

swankjesse
Copy link
Member

Closes: #5519

@@ -163,9 +163,9 @@ open class OkHttpClient internal constructor(

@get:JvmName("proxySelector") val proxySelector: ProxySelector =
when {
// Avoid possible SecurityException from ProxySelector.getDefault
builder.proxy != null -> NullProxySelector()
else -> builder.proxySelector ?: ProxySelector.getDefault() ?: NullProxySelector()
Copy link
Member Author

Choose a reason for hiding this comment

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

these NullProxySelector instances weren’t equal to each other!

@yschimke
Copy link
Collaborator

yschimke commented Oct 2, 2019

LGTM. On mobile.

Copy link
Collaborator

@yschimke yschimke left a comment

Choose a reason for hiding this comment

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

Sorry about the bug.

@swankjesse
Copy link
Member Author

All good. SecurityManager is bad and we should discourage it.

@swankjesse swankjesse merged commit 8ae4e86 into master Oct 2, 2019
@oldergod oldergod deleted the jwilson.1001.fix_pooling branch October 3, 2019 15: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.

Too many NullProxySelector instances break connection pooling
2 participants