From 6ec1c61b061a4a136b32bce6286d80db00142aca Mon Sep 17 00:00:00 2001 From: thalieht Date: Sun, 11 Sep 2016 23:09:30 +0300 Subject: [PATCH] fix webui port overflow --- src/base/net/portforwarder.cpp | 6 +++--- src/base/net/portforwarder.h | 6 +++--- src/webui/webui.h | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/base/net/portforwarder.cpp b/src/base/net/portforwarder.cpp index 456b794b1..6cd027b4a 100644 --- a/src/base/net/portforwarder.cpp +++ b/src/base/net/portforwarder.cpp @@ -70,7 +70,7 @@ PortForwarder *PortForwarder::instance() return m_instance; } -void PortForwarder::addPort(qint16 port) +void PortForwarder::addPort(quint16 port) { if (!m_mappedPorts.contains(port)) { m_mappedPorts.insert(port, 0); @@ -79,7 +79,7 @@ void PortForwarder::addPort(qint16 port) } } -void PortForwarder::deletePort(qint16 port) +void PortForwarder::deletePort(quint16 port) { if (m_mappedPorts.contains(port)) { if (m_active) @@ -104,7 +104,7 @@ void PortForwarder::start() qDebug("Enabling UPnP / NAT-PMP"); m_provider->start_upnp(); m_provider->start_natpmp(); - foreach (qint16 port, m_mappedPorts.keys()) + foreach (quint16 port, m_mappedPorts.keys()) m_mappedPorts[port] = m_provider->add_port_mapping(libt::session::tcp, port, port); m_active = true; Logger::instance()->addMessage(tr("UPnP / NAT-PMP support [ON]"), Log::INFO); diff --git a/src/base/net/portforwarder.h b/src/base/net/portforwarder.h index 6980baaa5..cb9be9448 100644 --- a/src/base/net/portforwarder.h +++ b/src/base/net/portforwarder.h @@ -49,8 +49,8 @@ namespace Net static void freeInstance(); static PortForwarder *instance(); - void addPort(qint16 port); - void deletePort(qint16 port); + void addPort(quint16 port); + void deletePort(quint16 port); private slots: void configure(); @@ -64,7 +64,7 @@ namespace Net bool m_active; libtorrent::session *m_provider; - QHash m_mappedPorts; + QHash m_mappedPorts; static PortForwarder *m_instance; }; diff --git a/src/webui/webui.h b/src/webui/webui.h index 891e79084..5f156a92e 100644 --- a/src/webui/webui.h +++ b/src/webui/webui.h @@ -58,7 +58,7 @@ private: QPointer httpServer_; QPointer dynDNSUpdater_; QPointer webapp_; - qint16 m_port; + quint16 m_port; }; #endif // WEBUI_H