| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 // | 4 // |
| 5 // XmppConnectionGenerator does the following algorithm: | 5 // XmppConnectionGenerator does the following algorithm: |
| 6 // proxy = ResolveProxyInformation(connection_options) | 6 // proxy = ResolveProxyInformation(connection_options) |
| 7 // for server in server_list | 7 // for server in server_list |
| 8 // get dns_addresses for server | 8 // get dns_addresses for server |
| 9 // connection_list = (dns_addresses X connection methods X proxy).shuffle() | 9 // connection_list = (dns_addresses X connection methods X proxy).shuffle() |
| 10 // for connection in connection_list | 10 // for connection in connection_list |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 // to try. | 83 // to try. |
| 84 while (true) { | 84 while (true) { |
| 85 // Iterate to the next possible connection. | 85 // Iterate to the next possible connection. |
| 86 settings_index_++; | 86 settings_index_++; |
| 87 if (settings_index_ < settings_list_->GetCount()) { | 87 if (settings_index_ < settings_list_->GetCount()) { |
| 88 // We have more connection settings in the settings_list_ to | 88 // We have more connection settings in the settings_list_ to |
| 89 // try, kick off the next one. | 89 // try, kick off the next one. |
| 90 ConnectionSettings* settings = | 90 ConnectionSettings* settings = |
| 91 settings_list_->GetSettings(settings_index_); | 91 settings_list_->GetSettings(settings_index_); |
| 92 VLOG(1) << "*** Attempting " << PROTO_NAMES[settings->protocol()] | 92 VLOG(1) << "*** Attempting " << PROTO_NAMES[settings->protocol()] |
| 93 << " connection to " << settings->server().IPAsString() | 93 << " connection to " << settings->server().HostAsURIString() |
| 94 << ":" << settings->server().port(); | 94 << ":" << settings->server().port(); |
| 95 delegate_->OnNewSettings(*settings); | 95 delegate_->OnNewSettings(*settings); |
| 96 return; | 96 return; |
| 97 } | 97 } |
| 98 | 98 |
| 99 // Iterate to the next possible server. | 99 // Iterate to the next possible server. |
| 100 if (current_server_ == servers_.end()) { | 100 if (current_server_ == servers_.end()) { |
| 101 current_server_ = servers_.begin(); | 101 current_server_ = servers_.begin(); |
| 102 } else { | 102 } else { |
| 103 ++current_server_; | 103 ++current_server_; |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 settings_list_->ClearPermutations(); | 181 settings_list_->ClearPermutations(); |
| 182 settings_list_->AddPermutations( | 182 settings_list_->AddPermutations( |
| 183 current_server_->server.host(), | 183 current_server_->server.host(), |
| 184 ip_list, | 184 ip_list, |
| 185 current_server_->server.port(), | 185 current_server_->server.port(), |
| 186 current_server_->special_port_magic, | 186 current_server_->special_port_magic, |
| 187 try_ssltcp_first_); | 187 try_ssltcp_first_); |
| 188 } | 188 } |
| 189 | 189 |
| 190 } // namespace notifier | 190 } // namespace notifier |
| OLD | NEW |