Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(110)

Unified Diff: jingle/notifier/communicator/xmpp_connection_generator.cc

Issue 6833031: Changed the jingle network code in ChromeAsyncSocket to use the client socket pool. This also all... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: More Mac/Linux compile fixes Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: jingle/notifier/communicator/xmpp_connection_generator.cc
===================================================================
--- jingle/notifier/communicator/xmpp_connection_generator.cc (revision 81535)
+++ jingle/notifier/communicator/xmpp_connection_generator.cc (working copy)
@@ -56,6 +56,7 @@
try_ssltcp_first_(try_ssltcp_first),
successfully_resolved_dns_(false),
first_dns_error_(0),
+ should_resolve_dns_(true),
options_(options) {
DCHECK(delegate_);
DCHECK(host_resolver);
@@ -119,18 +120,26 @@
return;
}
- // Resolve the server.
- const net::HostPortPair& server = current_server_->server;
- net::HostResolver::RequestInfo request_info(server);
- int status =
- host_resolver_.Resolve(
- request_info, &address_list_, resolve_callback_.get(),
- bound_net_log_);
- if (status == net::ERR_IO_PENDING) {
- // resolve_callback_ will call us when it's called.
- return;
+ if (should_resolve_dns_) {
+ // Resolve the server.
+ const net::HostPortPair& server = current_server_->server;
+ net::HostResolver::RequestInfo request_info(server);
+ int status =
+ host_resolver_.Resolve(
+ request_info, &address_list_, resolve_callback_.get(),
+ bound_net_log_);
+ if (status == net::ERR_IO_PENDING) {
+ // resolve_callback_ will call us when it's called.
+ return;
+ }
+ HandleServerDNSResolved(status);
+ } else {
+ // We are not resolving DNS here (DNS will be resolved by a lower layer).
+ // Generate settings using an empty IP list (which will just use the
+ // host name for the current server).
+ std::vector<uint32> ip_list;
+ GenerateSettingsForIPList(ip_list);
}
- HandleServerDNSResolved(status);
}
}
@@ -169,6 +178,11 @@
<< " : " << talk_base::SocketAddress::IPToString(ip_list[i]);
}
+ GenerateSettingsForIPList(ip_list);
+}
+
+void XmppConnectionGenerator::GenerateSettingsForIPList(
+ const std::vector<uint32>& ip_list) {
// Build the ip list.
DCHECK(settings_list_.get());
settings_index_ = -1;

Powered by Google App Engine
This is Rietveld 408576698