mirror of
https://github.com/clangen/musikcube.git
synced 2024-10-02 04:52:32 +00:00
We should be passing the port numbers around as unsigned. Oops.
This commit is contained in:
parent
bc96d35bb2
commit
f9f4557402
@ -5,6 +5,8 @@
|
|||||||
box will have a blue (instead of red) border.
|
box will have a blue (instead of red) border.
|
||||||
* relaxed search to ignore accents. for example: 'À', 'Á`, 'Â`, etc are all
|
* relaxed search to ignore accents. for example: 'À', 'Á`, 'Â`, etc are all
|
||||||
considered equivalent to the english 'A', and vice versa.
|
considered equivalent to the english 'A', and vice versa.
|
||||||
|
* fixed a bug where remote library ports greater than 32767 caused the app to
|
||||||
|
crash.
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -428,7 +428,7 @@ std::string RemoteLibrary::GetTrackUri(musik::core::sdk::ITrack* track, const st
|
|||||||
|
|
||||||
auto prefs = Preferences::ForComponent(core::prefs::components::Settings);
|
auto prefs = Preferences::ForComponent(core::prefs::components::Settings);
|
||||||
auto host = prefs->GetString(core::prefs::keys::RemoteLibraryHostname, "127.0.0.1");
|
auto host = prefs->GetString(core::prefs::keys::RemoteLibraryHostname, "127.0.0.1");
|
||||||
auto port = (short) prefs->GetInt(core::prefs::keys::RemoteLibraryHttpPort, 7905);
|
auto port = (unsigned short) prefs->GetInt(core::prefs::keys::RemoteLibraryHttpPort, 7905);
|
||||||
auto password = prefs->GetString(core::prefs::keys::RemoteLibraryPassword, "");
|
auto password = prefs->GetString(core::prefs::keys::RemoteLibraryPassword, "");
|
||||||
auto useTls = prefs->GetBool(core::prefs::keys::RemoteLibraryHttpTls, false);
|
auto useTls = prefs->GetBool(core::prefs::keys::RemoteLibraryHttpTls, false);
|
||||||
|
|
||||||
@ -464,7 +464,7 @@ const net::WebSocketClient& RemoteLibrary::WebSocketClient() const {
|
|||||||
void RemoteLibrary::ReloadConnectionFromPreferences() {
|
void RemoteLibrary::ReloadConnectionFromPreferences() {
|
||||||
auto prefs = Preferences::ForComponent(core::prefs::components::Settings);
|
auto prefs = Preferences::ForComponent(core::prefs::components::Settings);
|
||||||
auto host = prefs->GetString(core::prefs::keys::RemoteLibraryHostname, "127.0.0.1");
|
auto host = prefs->GetString(core::prefs::keys::RemoteLibraryHostname, "127.0.0.1");
|
||||||
auto port = (short) prefs->GetInt(core::prefs::keys::RemoteLibraryWssPort, 7905);
|
auto port = (unsigned short) prefs->GetInt(core::prefs::keys::RemoteLibraryWssPort, 7905);
|
||||||
auto password = prefs->GetString(core::prefs::keys::RemoteLibraryPassword, "");
|
auto password = prefs->GetString(core::prefs::keys::RemoteLibraryPassword, "");
|
||||||
auto useTls = prefs->GetBool(core::prefs::keys::RemoteLibraryWssTls, false);
|
auto useTls = prefs->GetBool(core::prefs::keys::RemoteLibraryWssTls, false);
|
||||||
this->wsc.Connect(host, port, password, useTls);
|
this->wsc.Connect(host, port, password, useTls);
|
||||||
|
@ -124,12 +124,16 @@ void RawWebSocketClient::Connect(const std::string& uri) {
|
|||||||
websocketpp::lib::error_code ec;
|
websocketpp::lib::error_code ec;
|
||||||
if (mode == Mode::PlainText) {
|
if (mode == Mode::PlainText) {
|
||||||
PlainTextClient::connection_ptr connection = plainTextClient->get_connection(uri, ec);
|
PlainTextClient::connection_ptr connection = plainTextClient->get_connection(uri, ec);
|
||||||
|
if (!ec) {
|
||||||
plainTextClient->connect(connection);
|
plainTextClient->connect(connection);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if (mode == Mode::TLS) {
|
else if (mode == Mode::TLS) {
|
||||||
TlsClient::connection_ptr connection = tlsClient->get_connection(uri, ec);
|
TlsClient::connection_ptr connection = tlsClient->get_connection(uri, ec);
|
||||||
|
if (!ec) {
|
||||||
tlsClient->connect(connection);
|
tlsClient->connect(connection);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RawWebSocketClient::Run() {
|
void RawWebSocketClient::Run() {
|
||||||
|
@ -230,7 +230,7 @@ std::string WebSocketClient::EnqueueQuery(Query query) {
|
|||||||
|
|
||||||
void WebSocketClient::Connect(
|
void WebSocketClient::Connect(
|
||||||
const std::string& host,
|
const std::string& host,
|
||||||
short port,
|
unsigned short port,
|
||||||
const std::string& password,
|
const std::string& password,
|
||||||
bool useTls)
|
bool useTls)
|
||||||
{
|
{
|
||||||
|
@ -95,7 +95,7 @@ namespace musik { namespace core { namespace net {
|
|||||||
|
|
||||||
void Connect(
|
void Connect(
|
||||||
const std::string& host,
|
const std::string& host,
|
||||||
short port,
|
unsigned short port,
|
||||||
const std::string& password,
|
const std::string& password,
|
||||||
bool useTls);
|
bool useTls);
|
||||||
|
|
||||||
|
@ -195,8 +195,8 @@ void RemoteLibrarySettingsLayout::LoadPreferences() {
|
|||||||
this->httpTlsCheckbox->CheckChanged.disconnect(this);
|
this->httpTlsCheckbox->CheckChanged.disconnect(this);
|
||||||
|
|
||||||
auto host = prefs->GetString(core::prefs::keys::RemoteLibraryHostname, "127.0.0.1");
|
auto host = prefs->GetString(core::prefs::keys::RemoteLibraryHostname, "127.0.0.1");
|
||||||
auto const wssPort = (short) prefs->GetInt(core::prefs::keys::RemoteLibraryWssPort, 7905);
|
auto const wssPort = (unsigned short) prefs->GetInt(core::prefs::keys::RemoteLibraryWssPort, 7905);
|
||||||
auto const httpPort = (short) prefs->GetInt(core::prefs::keys::RemoteLibraryHttpPort, 7906);
|
auto const httpPort = (unsigned short) prefs->GetInt(core::prefs::keys::RemoteLibraryHttpPort, 7906);
|
||||||
auto const password = prefs->GetString(core::prefs::keys::RemoteLibraryPassword, "");
|
auto const password = prefs->GetString(core::prefs::keys::RemoteLibraryPassword, "");
|
||||||
auto const wssTls = prefs->GetBool(core::prefs::keys::RemoteLibraryWssTls, false);
|
auto const wssTls = prefs->GetBool(core::prefs::keys::RemoteLibraryWssTls, false);
|
||||||
auto const httpTls = prefs->GetBool(core::prefs::keys::RemoteLibraryHttpTls, false);
|
auto const httpTls = prefs->GetBool(core::prefs::keys::RemoteLibraryHttpTls, false);
|
||||||
|
Loading…
Reference in New Issue
Block a user