forked from square/okhttp
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
We had a bug where the socket-being-connected wasn't being closed when the application used Call.cancel(). The problem is that the SocketConnector model assumes the Connection doesn't want a Socket instance until it's fully connected. This moves the SocketConnector code back into Connection, removes a lot of nested try/catch blocks, and assigns a Socket instance as soon as its created. This also likely fixes some bugs where sockets weren't being closed when an IOException or RouteException was thrown during connection. Now we always close at the top level of connect() unless the connection is successful. square#1779
- Loading branch information
1 parent
1e5f3a9
commit b42e73f
Showing
4 changed files
with
284 additions
and
334 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.