diff options
-rw-r--r-- | Swiften/Network/Connector.cpp | 24 | ||||
-rw-r--r-- | Swiften/Network/PlatformDomainNameResolver.cpp | 12 | ||||
-rw-r--r-- | Swiften/Network/PlatformDomainNameServiceQuery.cpp | 6 |
3 files changed, 21 insertions, 21 deletions
diff --git a/Swiften/Network/Connector.cpp b/Swiften/Network/Connector.cpp index 6e454ad..e424f64 100644 --- a/Swiften/Network/Connector.cpp +++ b/Swiften/Network/Connector.cpp @@ -13,7 +13,7 @@ Connector::Connector(const String& hostname, DomainNameResolver* resolver, Conne } void Connector::start() { - std::cout << "Connector::start()" << std::endl; + //std::cout << "Connector::start()" << std::endl; assert(!currentConnection); assert(!serviceQuery); queriedAllHosts = false; @@ -30,7 +30,7 @@ void Connector::queryAddress(const String& hostname) { } void Connector::handleServiceQueryResult(const std::vector<DomainNameServiceQuery::Result>& result) { - std::cout << "Received SRV results" << std::endl; + //std::cout << "Received SRV results" << std::endl; serviceQueryResults = std::deque<DomainNameServiceQuery::Result>(result.begin(), result.end()); serviceQuery.reset(); tryNextHostname(); @@ -38,44 +38,44 @@ void Connector::handleServiceQueryResult(const std::vector<DomainNameServiceQuer void Connector::tryNextHostname() { if (queriedAllHosts) { - std::cout << "Connector::tryNextHostName(): Queried all hosts. Error." << std::endl; + //std::cout << "Connector::tryNextHostName(): Queried all hosts. Error." << std::endl; onConnectFinished(boost::shared_ptr<Connection>()); } else if (serviceQueryResults.empty()) { - std::cout << "Connector::tryNextHostName(): Falling back on A resolution" << std::endl; + //std::cout << "Connector::tryNextHostName(): Falling back on A resolution" << std::endl; // Fall back on simple address resolving queriedAllHosts = true; queryAddress(hostname); } else { - std::cout << "Connector::tryNextHostName(): Querying next address" << std::endl; + //std::cout << "Connector::tryNextHostName(): Querying next address" << std::endl; queryAddress(serviceQueryResults.front().hostname); } } void Connector::handleAddressQueryResult(const HostAddress& address, boost::optional<DomainNameResolveError> error) { - std::cout << "Connector::handleAddressQueryResult(): Start" << std::endl; + //std::cout << "Connector::handleAddressQueryResult(): Start" << std::endl; addressQuery.reset(); if (!serviceQueryResults.empty()) { DomainNameServiceQuery::Result serviceQueryResult = serviceQueryResults.front(); serviceQueryResults.pop_front(); if (error) { - std::cout << "Connector::handleAddressQueryResult(): A lookup for SRV host " << serviceQueryResult.hostname << " failed." << std::endl; + //std::cout << "Connector::handleAddressQueryResult(): A lookup for SRV host " << serviceQueryResult.hostname << " failed." << std::endl; tryNextHostname(); } else { - std::cout << "Connector::handleAddressQueryResult(): A lookup for SRV host " << serviceQueryResult.hostname << " succeeded: " << address.toString() << std::endl; + //std::cout << "Connector::handleAddressQueryResult(): A lookup for SRV host " << serviceQueryResult.hostname << " succeeded: " << address.toString() << std::endl; tryConnect(HostAddressPort(address, serviceQueryResult.port)); } } else if (error) { - std::cout << "Connector::handleAddressQueryResult(): Fallback address query failed. Giving up" << std::endl; + //std::cout << "Connector::handleAddressQueryResult(): Fallback address query failed. Giving up" << std::endl; // The fallback address query failed assert(queriedAllHosts); onConnectFinished(boost::shared_ptr<Connection>()); } else { - std::cout << "Connector::handleAddressQueryResult(): Fallback address query succeeded: " << address.toString() << std::endl; + //std::cout << "Connector::handleAddressQueryResult(): Fallback address query succeeded: " << address.toString() << std::endl; // The fallback query succeeded tryConnect(HostAddressPort(address, 5222)); } @@ -83,14 +83,14 @@ void Connector::handleAddressQueryResult(const HostAddress& address, boost::opti void Connector::tryConnect(const HostAddressPort& target) { assert(!currentConnection); - std::cout << "Connector::tryConnect() " << target.getAddress().toString() << " " << target.getPort() << std::endl; + //std::cout << "Connector::tryConnect() " << target.getAddress().toString() << " " << target.getPort() << std::endl; currentConnection = connectionFactory->createConnection(); currentConnection->onConnectFinished.connect(boost::bind(&Connector::handleConnectionConnectFinished, this, _1)); currentConnection->connect(target); } void Connector::handleConnectionConnectFinished(bool error) { - std::cout << "Connector::handleConnectionConnectFinished() " << error << std::endl; + //std::cout << "Connector::handleConnectionConnectFinished() " << error << std::endl; if (error) { currentConnection.reset(); tryNextHostname(); diff --git a/Swiften/Network/PlatformDomainNameResolver.cpp b/Swiften/Network/PlatformDomainNameResolver.cpp index 5ffa2fb..7b8a6d5 100644 --- a/Swiften/Network/PlatformDomainNameResolver.cpp +++ b/Swiften/Network/PlatformDomainNameResolver.cpp @@ -39,28 +39,28 @@ namespace { } void doRun() { - std::cout << "PlatformDomainNameResolver::doRun()" << std::endl; + //std::cout << "PlatformDomainNameResolver::doRun()" << std::endl; boost::asio::ip::tcp::resolver resolver(ioService); boost::asio::ip::tcp::resolver::query query(hostname.getUTF8String(), "5222"); try { - std::cout << "PlatformDomainNameResolver::doRun(): Resolving" << std::endl; + //std::cout << "PlatformDomainNameResolver::doRun(): Resolving" << std::endl; boost::asio::ip::tcp::resolver::iterator endpointIterator = resolver.resolve(query); - std::cout << "PlatformDomainNameResolver::doRun(): Resolved" << std::endl; + //std::cout << "PlatformDomainNameResolver::doRun(): Resolved" << std::endl; if (endpointIterator == boost::asio::ip::tcp::resolver::iterator()) { - std::cout << "PlatformDomainNameResolver::doRun(): Error 1" << std::endl; + //std::cout << "PlatformDomainNameResolver::doRun(): Error 1" << std::endl; emitError(); } else { boost::asio::ip::address address = (*endpointIterator).endpoint().address(); HostAddress result = (address.is_v4() ? HostAddress(&address.to_v4().to_bytes()[0], 4) : HostAddress(&address.to_v6().to_bytes()[0], 16)); - std::cout << "PlatformDomainNameResolver::doRun(): Success" << std::endl; + //std::cout << "PlatformDomainNameResolver::doRun(): Success" << std::endl; MainEventLoop::postEvent( boost::bind(boost::ref(onResult), result, boost::optional<DomainNameResolveError>()), shared_from_this()); } } catch (...) { - std::cout << "PlatformDomainNameResolver::doRun(): Error 2" << std::endl; + //std::cout << "PlatformDomainNameResolver::doRun(): Error 2" << std::endl; emitError(); } safeToJoin = true; diff --git a/Swiften/Network/PlatformDomainNameServiceQuery.cpp b/Swiften/Network/PlatformDomainNameServiceQuery.cpp index 659f397..bde851b 100644 --- a/Swiften/Network/PlatformDomainNameServiceQuery.cpp +++ b/Swiften/Network/PlatformDomainNameServiceQuery.cpp @@ -76,11 +76,11 @@ void PlatformDomainNameServiceQuery::doRun() { // Make sure we reinitialize the domain list every time res_init(); - std::cout << "SRV: Querying " << service << std::endl; + //std::cout << "SRV: Querying " << service << std::endl; ByteArray response; response.resize(NS_PACKETSZ); int responseLength = res_query(const_cast<char*>(service.getUTF8Data()), ns_c_in, ns_t_srv, reinterpret_cast<u_char*>(response.getData()), response.getSize()); - std::cout << "res_query done " << (responseLength != -1) << std::endl; + //std::cout << "res_query done " << (responseLength != -1) << std::endl; if (responseLength == -1) { emitError(); return; @@ -158,7 +158,7 @@ void PlatformDomainNameServiceQuery::doRun() { safeToJoin = true; std::sort(records.begin(), records.end(), ResultPriorityComparator()); - std::cout << "Sending out " << records.size() << " SRV results " << std::endl; + //std::cout << "Sending out " << records.size() << " SRV results " << std::endl; MainEventLoop::postEvent(boost::bind(boost::ref(onResult), records)); } |