diff options
| author | Edwin Mons <edwin.mons@isode.com> | 2018-10-29 16:28:14 (GMT) |
|---|---|---|
| committer | Edwin Mons <edwin.mons@isode.com> | 2018-11-08 11:31:20 (GMT) |
| commit | cf3d517763a3d74a2ec9fd6f7bdee8cbaee3550f (patch) | |
| tree | 69e11e13ff2e5127d2cbfcc164be761cf104a1b2 /Swiften/Component/ComponentConnector.h | |
| parent | 5ce9e19ef0744f530a797c30a82e9723eb7ea306 (diff) | |
| download | swift-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/Component/ComponentConnector.h')
| -rw-r--r-- | Swiften/Component/ComponentConnector.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Swiften/Component/ComponentConnector.h b/Swiften/Component/ComponentConnector.h index ab36901..cfd49fe 100644 --- a/Swiften/Component/ComponentConnector.h +++ b/Swiften/Component/ComponentConnector.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 | */ |
| @@ -28,7 +28,7 @@ namespace Swift { | |||
| 28 | public: | 28 | public: |
| 29 | typedef std::shared_ptr<ComponentConnector> ref; | 29 | typedef std::shared_ptr<ComponentConnector> ref; |
| 30 | 30 | ||
| 31 | static ComponentConnector::ref create(const std::string& hostname, int port, DomainNameResolver* resolver, ConnectionFactory* connectionFactory, TimerFactory* timerFactory) { | 31 | static ComponentConnector::ref create(const std::string& hostname, unsigned short port, DomainNameResolver* resolver, ConnectionFactory* connectionFactory, TimerFactory* timerFactory) { |
| 32 | return ref(new ComponentConnector(hostname, port, resolver, connectionFactory, timerFactory)); | 32 | return ref(new ComponentConnector(hostname, port, resolver, connectionFactory, timerFactory)); |
| 33 | } | 33 | } |
| 34 | 34 | ||
| @@ -40,7 +40,7 @@ namespace Swift { | |||
| 40 | boost::signals2::signal<void (std::shared_ptr<Connection>)> onConnectFinished; | 40 | boost::signals2::signal<void (std::shared_ptr<Connection>)> onConnectFinished; |
| 41 | 41 | ||
| 42 | private: | 42 | private: |
| 43 | ComponentConnector(const std::string& hostname, int port, DomainNameResolver*, ConnectionFactory*, TimerFactory*); | 43 | ComponentConnector(const std::string& hostname, unsigned short port, DomainNameResolver*, ConnectionFactory*, TimerFactory*); |
| 44 | 44 | ||
| 45 | void handleAddressQueryResult(const std::vector<HostAddress>& address, boost::optional<DomainNameResolveError> error); | 45 | void handleAddressQueryResult(const std::vector<HostAddress>& address, boost::optional<DomainNameResolveError> error); |
| 46 | void tryNextAddress(); | 46 | void tryNextAddress(); |
| @@ -53,7 +53,7 @@ namespace Swift { | |||
| 53 | 53 | ||
| 54 | private: | 54 | private: |
| 55 | std::string hostname; | 55 | std::string hostname; |
| 56 | int port; | 56 | unsigned short port; |
| 57 | DomainNameResolver* resolver; | 57 | DomainNameResolver* resolver; |
| 58 | ConnectionFactory* connectionFactory; | 58 | ConnectionFactory* connectionFactory; |
| 59 | TimerFactory* timerFactory; | 59 | TimerFactory* timerFactory; |
Swift