diff options
Diffstat (limited to 'Swiften/Network/Connector.cpp')
| -rw-r--r-- | Swiften/Network/Connector.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Swiften/Network/Connector.cpp b/Swiften/Network/Connector.cpp index ca924bb..a0e6b23 100644 --- a/Swiften/Network/Connector.cpp +++ b/Swiften/Network/Connector.cpp | |||
| @@ -17,7 +17,7 @@ | |||
| 17 | 17 | ||
| 18 | namespace Swift { | 18 | namespace Swift { |
| 19 | 19 | ||
| 20 | Connector::Connector(const std::string& hostname, int port, const boost::optional<std::string>& serviceLookupPrefix, DomainNameResolver* resolver, ConnectionFactory* connectionFactory, TimerFactory* timerFactory) : hostname(hostname), port(port), serviceLookupPrefix(serviceLookupPrefix), resolver(resolver), connectionFactory(connectionFactory), timerFactory(timerFactory), timeoutMilliseconds(0), queriedAllServices(true), foundSomeDNS(false) { | 20 | Connector::Connector(const std::string& hostname, unsigned short port, const boost::optional<std::string>& serviceLookupPrefix, DomainNameResolver* resolver, ConnectionFactory* connectionFactory, TimerFactory* timerFactory) : hostname(hostname), port(port), serviceLookupPrefix(serviceLookupPrefix), resolver(resolver), connectionFactory(connectionFactory), timerFactory(timerFactory), timeoutMilliseconds(0), queriedAllServices(true), foundSomeDNS(false) { |
| 21 | } | 21 | } |
| 22 | 22 | ||
| 23 | void Connector::setTimeoutMilliseconds(int milliseconds) { | 23 | void Connector::setTimeoutMilliseconds(int milliseconds) { |
| @@ -122,7 +122,7 @@ void Connector::tryNextAddress() { | |||
| 122 | HostAddress address = addressQueryResults.front(); | 122 | HostAddress address = addressQueryResults.front(); |
| 123 | addressQueryResults.pop_front(); | 123 | addressQueryResults.pop_front(); |
| 124 | 124 | ||
| 125 | int connectPort = (port == -1 ? 5222 : port); | 125 | unsigned short connectPort = (port == 0 ? 5222 : port); |
| 126 | if (!serviceQueryResults.empty()) { | 126 | if (!serviceQueryResults.empty()) { |
| 127 | connectPort = serviceQueryResults.front().port; | 127 | connectPort = serviceQueryResults.front().port; |
| 128 | } | 128 | } |
Swift