If we use a port<1024 for HTTP server, then just assign a 'dynamic'/random port
This commit is contained in:
@@ -521,7 +521,7 @@ int Settings::stopFadeDuration()
|
||||
#ifdef TAGLIB_FOUND
|
||||
int Settings::httpPort()
|
||||
{
|
||||
return GET_INT("httpPort", 9001);
|
||||
return GET_INT("httpPort", 1023);
|
||||
}
|
||||
|
||||
QString Settings::httpAddress()
|
||||
|
||||
@@ -23,18 +23,21 @@
|
||||
|
||||
#include "httpserversettings.h"
|
||||
#include "settings.h"
|
||||
#include "localize.h"
|
||||
|
||||
HttpServerSettings::HttpServerSettings(QWidget *p)
|
||||
: QWidget(p)
|
||||
{
|
||||
setupUi(this);
|
||||
httpPort->setSpecialValueText(i18n("Dynamic"));
|
||||
}
|
||||
|
||||
void HttpServerSettings::load()
|
||||
{
|
||||
int port=Settings::self()->httpPort();
|
||||
enableHttp->setChecked(Settings::self()->enableHttp());
|
||||
alwaysUseHttp->setChecked(Settings::self()->alwaysUseHttp());
|
||||
httpPort->setValue(Settings::self()->httpPort());
|
||||
httpPort->setValue(port<1024 ? 1023 : port);
|
||||
httpAddress->setText(Settings::self()->httpAddress());
|
||||
}
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
<item row="3" column="1">
|
||||
<widget class="SpinBox" name="httpPort">
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
<number>1023</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>65535</number>
|
||||
@@ -108,7 +108,7 @@
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string><i><b>NOTE:</b> MPD usually only plays songs that are stored within its folders. If you have connected via a local socket, then MPD can also play files located on your filesystem. If you are using a non local socket (e.g. you have entered a hostname or IP address in the 'Host' field of the 'Connection' settings page), then Cantata contains a minimal HTTP server that can be used to serve files to MPD. This, however, will only work whilst Cantata is running. If you enable 'Always use server', then Cantata will always pass server URLs to MPD for files, even when you have connected via a local socket.<br/><br/>
|
||||
<b>NOTE:</b> 'Address/interface' may contain either the IP address, or interface (e.g. eth0), that you wish to listen for connections on. Leave blank to use the local loopback address (127.0.0.1).</i></i></string>
|
||||
<b>NOTE:</b> 'Address/interface' may contain either the IP address, or interface (e.g. eth0), that you wish to listen for connections on. Leave blank to use the local loopback address (127.0.0.1).<br/><br/><b>NOTE:</b> Leave port set to 'Dynamic' to have Cantata choose a random port number.</i></string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
|
||||
@@ -186,7 +186,7 @@ HttpSocket::HttpSocket(const QString &addr, quint16 p)
|
||||
}
|
||||
}
|
||||
}
|
||||
listen(a.isNull() ? QHostAddress::LocalHost : a, p);
|
||||
listen(a.isNull() ? QHostAddress::LocalHost : a, p<1024 ? 0 : p);
|
||||
}
|
||||
|
||||
void HttpSocket::terminate()
|
||||
|
||||
Reference in New Issue
Block a user