summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdwin Mons <edwin.mons@isode.com>2018-10-29 16:28:14 (GMT)
committerEdwin Mons <edwin.mons@isode.com>2018-11-08 11:31:20 (GMT)
commitcf3d517763a3d74a2ec9fd6f7bdee8cbaee3550f (patch)
tree69e11e13ff2e5127d2cbfcc164be761cf104a1b2 /Swiften/Network/Connector.h
parent5ce9e19ef0744f530a797c30a82e9723eb7ea306 (diff)
downloadswift-cf3d517763a3d74a2ec9fd6f7bdee8cbaee3550f.zip
swift-cf3d517763a3d74a2ec9fd6f7bdee8cbaee3550f.tar.bz2
Consistently use unsigned short for network ports
Network ports are now consistently stored as unsigned shorts, apart from the options and user interface, where -1 is still used to denote the use of default ports. Test-Information: Unit tests pass on macOS 10.13 and Debian 9 On macOS: tested the UI with various proxy and manual ports, behaviour as expected. Change-Id: I7a65f40083022887aa30ed7b21eadc56d0c52be1
Diffstat (limited to 'Swiften/Network/Connector.h')
-rw-r--r--Swiften/Network/Connector.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/Swiften/Network/Connector.h b/Swiften/Network/Connector.h
index d8a1b88..c76a4af 100644
--- a/Swiften/Network/Connector.h
+++ b/Swiften/Network/Connector.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2010-2016 Isode Limited. 2 * Copyright (c) 2010-2018 Isode Limited.
3 * All rights reserved. 3 * All rights reserved.
4 * See the COPYING file for more information. 4 * See the COPYING file for more information.
5 */ 5 */
@@ -30,7 +30,7 @@ namespace Swift {
30 public: 30 public:
31 typedef std::shared_ptr<Connector> ref; 31 typedef std::shared_ptr<Connector> ref;
32 32
33 static Connector::ref create(const std::string& hostname, int port, const boost::optional<std::string>& serviceLookupPrefix, DomainNameResolver* resolver, ConnectionFactory* connectionFactory, TimerFactory* timerFactory) { 33 static Connector::ref create(const std::string& hostname, unsigned short port, const boost::optional<std::string>& serviceLookupPrefix, DomainNameResolver* resolver, ConnectionFactory* connectionFactory, TimerFactory* timerFactory) {
34 return ref(new Connector(hostname, port, serviceLookupPrefix, resolver, connectionFactory, timerFactory)); 34 return ref(new Connector(hostname, port, serviceLookupPrefix, resolver, connectionFactory, timerFactory));
35 } 35 }
36 36
@@ -46,7 +46,7 @@ namespace Swift {
46 boost::signals2::signal<void (std::shared_ptr<Connection>, std::shared_ptr<Error>)> onConnectFinished; 46 boost::signals2::signal<void (std::shared_ptr<Connection>, std::shared_ptr<Error>)> onConnectFinished;
47 47
48 private: 48 private:
49 Connector(const std::string& hostname, int port, const boost::optional<std::string>& serviceLookupPrefix, DomainNameResolver*, ConnectionFactory*, TimerFactory*); 49 Connector(const std::string& hostname, unsigned short port, const boost::optional<std::string>& serviceLookupPrefix, DomainNameResolver*, ConnectionFactory*, TimerFactory*);
50 50
51 void handleServiceQueryResult(const std::vector<DomainNameServiceQuery::Result>& result); 51 void handleServiceQueryResult(const std::vector<DomainNameServiceQuery::Result>& result);
52 void handleAddressQueryResult(const std::vector<HostAddress>& address, boost::optional<DomainNameResolveError> error); 52 void handleAddressQueryResult(const std::vector<HostAddress>& address, boost::optional<DomainNameResolveError> error);
@@ -63,7 +63,7 @@ namespace Swift {
63 63
64 private: 64 private:
65 std::string hostname; 65 std::string hostname;
66 int port; 66 unsigned short port;
67 boost::optional<std::string> serviceLookupPrefix; 67 boost::optional<std::string> serviceLookupPrefix;
68 DomainNameResolver* resolver; 68 DomainNameResolver* resolver;
69 ConnectionFactory* connectionFactory; 69 ConnectionFactory* connectionFactory;