{"action":"created","comment":{"url":"https://api.github.com/repos/square/okhttp/pulls/comments/23135896","id":23135896,"diff_hunk":"@@ -0,0 +1,41 @@\n+/*\n+ * Copyright (C) 2015 Square, Inc.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ *      http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+package com.squareup.okhttp;\n+\n+import java.io.IOException;\n+import java.util.LinkedList;\n+\n+/**\n+ * An exception thrown to indicate a problem connecting to an address. Multiple attempts may have\n+ * been made, none of which were successful.\n+ */\n+public class ConnectionFailureException extends Exception {\n+\n+  private final LinkedList<IOException> connectExceptions = new LinkedList<IOException>();","path":"okhttp/src/main/java/com/squareup/okhttp/ConnectionFailureException.java","position":27,"original_position":27,"commit_id":"2721c20777f1d1c57e07692765344da2bb98bbab","original_commit_id":"2721c20777f1d1c57e07692765344da2bb98bbab","user":{"login":"swankjesse","id":133019,"avatar_url":"https://avatars.githubusercontent.com/u/133019?v=3","gravatar_id":"","url":"https://api.github.com/users/swankjesse","html_url":"https://github.com/swankjesse","followers_url":"https://api.github.com/users/swankjesse/followers","following_url":"https://api.github.com/users/swankjesse/following{/other_user}","gists_url":"https://api.github.com/users/swankjesse/gists{/gist_id}","starred_url":"https://api.github.com/users/swankjesse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swankjesse/subscriptions","organizations_url":"https://api.github.com/users/swankjesse/orgs","repos_url":"https://api.github.com/users/swankjesse/repos","events_url":"https://api.github.com/users/swankjesse/events{/privacy}","received_events_url":"https://api.github.com/users/swankjesse/received_events","type":"User","site_admin":false},"body":"LinkedList? I think you mistyped ArrayList","created_at":"2015-01-18T19:05:50Z","updated_at":"2015-01-18T19:05:50Z","html_url":"https://github.com/square/okhttp/pull/1301#discussion_r23135896","pull_request_url":"https://api.github.com/repos/square/okhttp/pulls/1301","_links":{"self":{"href":"https://api.github.com/repos/square/okhttp/pulls/comments/23135896"},"html":{"href":"https://github.com/square/okhttp/pull/1301#discussion_r23135896"},"pull_request":{"href":"https://api.github.com/repos/square/okhttp/pulls/1301"}}},"pull_request":{"url":"https://api.github.com/repos/square/okhttp/pulls/1301","id":26953175,"html_url":"https://github.com/square/okhttp/pull/1301","diff_url":"https://github.com/square/okhttp/pull/1301.diff","patch_url":"https://github.com/square/okhttp/pull/1301.patch","issue_url":"https://api.github.com/repos/square/okhttp/issues/1301","number":1301,"state":"open","locked":false,"title":"WIP: Connection route selection","user":{"login":"nfuller","id":6388721,"avatar_url":"https://avatars.githubusercontent.com/u/6388721?v=3","gravatar_id":"","url":"https://api.github.com/users/nfuller","html_url":"https://github.com/nfuller","followers_url":"https://api.github.com/users/nfuller/followers","following_url":"https://api.github.com/users/nfuller/following{/other_user}","gists_url":"https://api.github.com/users/nfuller/gists{/gist_id}","starred_url":"https://api.github.com/users/nfuller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nfuller/subscriptions","organizations_url":"https://api.github.com/users/nfuller/orgs","repos_url":"https://api.github.com/users/nfuller/repos","events_url":"https://api.github.com/users/nfuller/events{/privacy}","received_events_url":"https://api.github.com/users/nfuller/received_events","type":"User","site_admin":false},"body":"Work in progress. This is to get feedback and to show you where I'm heading with this. The ultimate aim is to implement multiple-level fallback, but without creating unnecessary connections when an SSLSocketFactory returns a socket that does not support all the protocols.\r\n\r\nIn Android I only moved the protocol selection out of RouteSelector / Route. Here, I have kept the RouteSelector, but made Connection responsible for creating the socket connection; it handles the retries.\r\n\r\nSee https://android-review.googlesource.com/#/c/113411 for the Android change against an older OkHttp\r\n\r\nThis pull request adds a commit on top of the first refactoring commit I sent out earlier. Please see the commit comment there for more information and potential benefits from the change.\r\n\r\nSeveral files have TODO(nfuller) in the code and I would like feedback on. All OkHttp tests pass.\r\n\r\nI expect the next commit would further modify the RouteSelector / Connection interaction. An SSLSocket can be interrogated by the RouteSelectorImpl to work out whether further attempts with other TLS protocols are worth trying. As things stand and plain socket is created, an SSLSocket wrapped around it, and *then* the Connection code would be able to work out there's no point in going further. This way we can avoid making unnecessary connections.","created_at":"2015-01-07T12:00:56Z","updated_at":"2015-01-18T19:05:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6a7ac05051ab2d482d1b7b5d0e885a2d521cb9de","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/square/okhttp/pulls/1301/commits","review_comments_url":"https://api.github.com/repos/square/okhttp/pulls/1301/comments","review_comment_url":"https://api.github.com/repos/square/okhttp/pulls/comments/{number}","comments_url":"https://api.github.com/repos/square/okhttp/issues/1301/comments","statuses_url":"https://api.github.com/repos/square/okhttp/statuses/2721c20777f1d1c57e07692765344da2bb98bbab","head":{"label":"nfuller:ConnectionRouteSelection3","ref":"ConnectionRouteSelection3","sha":"2721c20777f1d1c57e07692765344da2bb98bbab","user":{"login":"nfuller","id":6388721,"avatar_url":"https://avatars.githubusercontent.com/u/6388721?v=3","gravatar_id":"","url":"https://api.github.com/users/nfuller","html_url":"https://github.com/nfuller","followers_url":"https://api.github.com/users/nfuller/followers","following_url":"https://api.github.com/users/nfuller/following{/other_user}","gists_url":"https://api.github.com/users/nfuller/gists{/gist_id}","starred_url":"https://api.github.com/users/nfuller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nfuller/subscriptions","organizations_url":"https://api.github.com/users/nfuller/orgs","repos_url":"https://api.github.com/users/nfuller/repos","events_url":"https://api.github.com/users/nfuller/events{/privacy}","received_events_url":"https://api.github.com/users/nfuller/received_events","type":"User","site_admin":false},"repo":{"id":17255665,"name":"okhttp","full_name":"nfuller/okhttp","owner":{"login":"nfuller","id":6388721,"avatar_url":"https://avatars.githubusercontent.com/u/6388721?v=3","gravatar_id":"","url":"https://api.github.com/users/nfuller","html_url":"https://github.com/nfuller","followers_url":"https://api.github.com/users/nfuller/followers","following_url":"https://api.github.com/users/nfuller/following{/other_user}","gists_url":"https://api.github.com/users/nfuller/gists{/gist_id}","starred_url":"https://api.github.com/users/nfuller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nfuller/subscriptions","organizations_url":"https://api.github.com/users/nfuller/orgs","repos_url":"https://api.github.com/users/nfuller/repos","events_url":"https://api.github.com/users/nfuller/events{/privacy}","received_events_url":"https://api.github.com/users/nfuller/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nfuller/okhttp","description":"An HTTP+SPDY client for Android and Java applications.","fork":true,"url":"https://api.github.com/repos/nfuller/okhttp","forks_url":"https://api.github.com/repos/nfuller/okhttp/forks","keys_url":"https://api.github.com/repos/nfuller/okhttp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nfuller/okhttp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nfuller/okhttp/teams","hooks_url":"https://api.github.com/repos/nfuller/okhttp/hooks","issue_events_url":"https://api.github.com/repos/nfuller/okhttp/issues/events{/number}","events_url":"https://api.github.com/repos/nfuller/okhttp/events","assignees_url":"https://api.github.com/repos/nfuller/okhttp/assignees{/user}","branches_url":"https://api.github.com/repos/nfuller/okhttp/branches{/branch}","tags_url":"https://api.github.com/repos/nfuller/okhttp/tags","blobs_url":"https://api.github.com/repos/nfuller/okhttp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nfuller/okhttp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nfuller/okhttp/git/refs{/sha}","trees_url":"https://api.github.com/repos/nfuller/okhttp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nfuller/okhttp/statuses/{sha}","languages_url":"https://api.github.com/repos/nfuller/okhttp/languages","stargazers_url":"https://api.github.com/repos/nfuller/okhttp/stargazers","contributors_url":"https://api.github.com/repos/nfuller/okhttp/contributors","subscribers_url":"https://api.github.com/repos/nfuller/okhttp/subscribers","subscription_url":"https://api.github.com/repos/nfuller/okhttp/subscription","commits_url":"https://api.github.com/repos/nfuller/okhttp/commits{/sha}","git_commits_url":"https://api.github.com/repos/nfuller/okhttp/git/commits{/sha}","comments_url":"https://api.github.com/repos/nfuller/okhttp/comments{/number}","issue_comment_url":"https://api.github.com/repos/nfuller/okhttp/issues/comments/{number}","contents_url":"https://api.github.com/repos/nfuller/okhttp/contents/{+path}","compare_url":"https://api.github.com/repos/nfuller/okhttp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nfuller/okhttp/merges","archive_url":"https://api.github.com/repos/nfuller/okhttp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nfuller/okhttp/downloads","issues_url":"https://api.github.com/repos/nfuller/okhttp/issues{/number}","pulls_url":"https://api.github.com/repos/nfuller/okhttp/pulls{/number}","milestones_url":"https://api.github.com/repos/nfuller/okhttp/milestones{/number}","notifications_url":"https://api.github.com/repos/nfuller/okhttp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nfuller/okhttp/labels{/name}","releases_url":"https://api.github.com/repos/nfuller/okhttp/releases{/id}","created_at":"2014-02-27T16:30:14Z","updated_at":"2014-11-08T03:10:19Z","pushed_at":"2015-01-15T11:48:00Z","git_url":"git://github.com/nfuller/okhttp.git","ssh_url":"git@github.com:nfuller/okhttp.git","clone_url":"https://github.com/nfuller/okhttp.git","svn_url":"https://github.com/nfuller/okhttp","homepage":"http://square.github.io/okhttp/","size":8123,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"square:master","ref":"master","sha":"1551f50f99c52612cb97e5b49b7b0c19cef814ca","user":{"login":"square","id":82592,"avatar_url":"https://avatars.githubusercontent.com/u/82592?v=3","gravatar_id":"","url":"https://api.github.com/users/square","html_url":"https://github.com/square","followers_url":"https://api.github.com/users/square/followers","following_url":"https://api.github.com/users/square/following{/other_user}","gists_url":"https://api.github.com/users/square/gists{/gist_id}","starred_url":"https://api.github.com/users/square/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/square/subscriptions","organizations_url":"https://api.github.com/users/square/orgs","repos_url":"https://api.github.com/users/square/repos","events_url":"https://api.github.com/users/square/events{/privacy}","received_events_url":"https://api.github.com/users/square/received_events","type":"Organization","site_admin":false},"repo":{"id":5152285,"name":"okhttp","full_name":"square/okhttp","owner":{"login":"square","id":82592,"avatar_url":"https://avatars.githubusercontent.com/u/82592?v=3","gravatar_id":"","url":"https://api.github.com/users/square","html_url":"https://github.com/square","followers_url":"https://api.github.com/users/square/followers","following_url":"https://api.github.com/users/square/following{/other_user}","gists_url":"https://api.github.com/users/square/gists{/gist_id}","starred_url":"https://api.github.com/users/square/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/square/subscriptions","organizations_url":"https://api.github.com/users/square/orgs","repos_url":"https://api.github.com/users/square/repos","events_url":"https://api.github.com/users/square/events{/privacy}","received_events_url":"https://api.github.com/users/square/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/square/okhttp","description":"An HTTP+SPDY client for Android and Java applications.","fork":false,"url":"https://api.github.com/repos/square/okhttp","forks_url":"https://api.github.com/repos/square/okhttp/forks","keys_url":"https://api.github.com/repos/square/okhttp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/square/okhttp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/square/okhttp/teams","hooks_url":"https://api.github.com/repos/square/okhttp/hooks","issue_events_url":"https://api.github.com/repos/square/okhttp/issues/events{/number}","events_url":"https://api.github.com/repos/square/okhttp/events","assignees_url":"https://api.github.com/repos/square/okhttp/assignees{/user}","branches_url":"https://api.github.com/repos/square/okhttp/branches{/branch}","tags_url":"https://api.github.com/repos/square/okhttp/tags","blobs_url":"https://api.github.com/repos/square/okhttp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/square/okhttp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/square/okhttp/git/refs{/sha}","trees_url":"https://api.github.com/repos/square/okhttp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/square/okhttp/statuses/{sha}","languages_url":"https://api.github.com/repos/square/okhttp/languages","stargazers_url":"https://api.github.com/repos/square/okhttp/stargazers","contributors_url":"https://api.github.com/repos/square/okhttp/contributors","subscribers_url":"https://api.github.com/repos/square/okhttp/subscribers","subscription_url":"https://api.github.com/repos/square/okhttp/subscription","commits_url":"https://api.github.com/repos/square/okhttp/commits{/sha}","git_commits_url":"https://api.github.com/repos/square/okhttp/git/commits{/sha}","comments_url":"https://api.github.com/repos/square/okhttp/comments{/number}","issue_comment_url":"https://api.github.com/repos/square/okhttp/issues/comments/{number}","contents_url":"https://api.github.com/repos/square/okhttp/contents/{+path}","compare_url":"https://api.github.com/repos/square/okhttp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/square/okhttp/merges","archive_url":"https://api.github.com/repos/square/okhttp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/square/okhttp/downloads","issues_url":"https://api.github.com/repos/square/okhttp/issues{/number}","pulls_url":"https://api.github.com/repos/square/okhttp/pulls{/number}","milestones_url":"https://api.github.com/repos/square/okhttp/milestones{/number}","notifications_url":"https://api.github.com/repos/square/okhttp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/square/okhttp/labels{/name}","releases_url":"https://api.github.com/repos/square/okhttp/releases{/id}","created_at":"2012-07-23T13:42:55Z","updated_at":"2015-01-18T18:47:34Z","pushed_at":"2015-01-18T18:47:34Z","git_url":"git://github.com/square/okhttp.git","ssh_url":"git@github.com:square/okhttp.git","clone_url":"https://github.com/square/okhttp.git","svn_url":"https://github.com/square/okhttp","homepage":"http://square.github.io/okhttp/","size":24958,"stargazers_count":3176,"watchers_count":3176,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":703,"mirror_url":null,"open_issues_count":66,"forks":703,"open_issues":66,"watchers":3176,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/square/okhttp/pulls/1301"},"html":{"href":"https://github.com/square/okhttp/pull/1301"},"issue":{"href":"https://api.github.com/repos/square/okhttp/issues/1301"},"comments":{"href":"https://api.github.com/repos/square/okhttp/issues/1301/comments"},"review_comments":{"href":"https://api.github.com/repos/square/okhttp/pulls/1301/comments"},"review_comment":{"href":"https://api.github.com/repos/square/okhttp/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/square/okhttp/pulls/1301/commits"},"statuses":{"href":"https://api.github.com/repos/square/okhttp/statuses/2721c20777f1d1c57e07692765344da2bb98bbab"}}}}