summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2009-12-23 12:17:05 (GMT)
committerRemko Tronçon <git@el-tramo.be>2009-12-23 12:17:05 (GMT)
commit290134a460538f61143ba50e0232a5d5be560ca3 (patch)
treecc689ef6b597a57d40161916df00b31f18d3ddeb /Swiften/Network/Connector.cpp
parentf288c20f0b47ab986c9511df2295b79b2b96c9ab (diff)
downloadswift-contrib-290134a460538f61143ba50e0232a5d5be560ca3.zip
swift-contrib-290134a460538f61143ba50e0232a5d5be560ca3.tar.bz2
Commented debug output.
Diffstat (limited to 'Swiften/Network/Connector.cpp')
-rw-r--r--Swiften/Network/Connector.cpp24
1 files changed, 12 insertions, 12 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();