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

Update RealConnection.java #5011

Closed
wants to merge 3 commits into from
Closed

Update RealConnection.java #5011

wants to merge 3 commits into from

Conversation

DevResRod
Copy link

Re-create the connection when Proxy server closes the connection after an unauthorized request, to avoid IO issue with closed socket.

Re-create the connection when Proxy server closes the connection after an unauthorized request, to avoid IO issue with closed socket.
@swankjesse
Copy link
Member

Please don’t combine behavior changes with refactorings. Ie. don’t extract methods.

Please include a test case that fails without the behavior change.

Added test that fails when proxy server closes the connection after 407 response.
Reverted refactors.
@DevResRod
Copy link
Author

DevResRod commented May 5, 2019

I have reverted the method extraction (refactor) to ease the change tracking. Is it enough?
Also, added a new test method in CallTest.java that fails with the original code and succeeds with this commit.

if (tunnelRequest != null) continue;
if (tunnelRequest != null) {
String header = response.header("Connection");
if (header != null && header.toLowerCase().contains("close")) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

.contains() seems a bit weak here, value is generally keep-alive or close.

@yschimke
Copy link
Collaborator

yschimke commented Jan 5, 2020

Any plans to migrate this to kotlin? Seems like a useful fix, but not essential (it should recover anyway) unless you suffer this daily with additional latency and timeouts.

@yschimke yschimke closed this Feb 23, 2020
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.

None yet

3 participants