diff --git a/backend/lib/noson/CMakeLists.txt b/backend/lib/noson/CMakeLists.txt index 1fd710ca..3ff504f3 100644 --- a/backend/lib/noson/CMakeLists.txt +++ b/backend/lib/noson/CMakeLists.txt @@ -1,5 +1,5 @@ -cmake_minimum_required (VERSION 2.6 FATAL_ERROR) -cmake_policy (VERSION 2.6) +cmake_minimum_required (VERSION 2.8.9 FATAL_ERROR) +cmake_policy (VERSION 2.8) add_subdirectory (${CMAKE_SOURCE_DIR}/noson) add_subdirectory (${CMAKE_SOURCE_DIR}/test) diff --git a/backend/lib/noson/noson/CMakeLists.txt b/backend/lib/noson/noson/CMakeLists.txt index f55e388d..902d378f 100644 --- a/backend/lib/noson/noson/CMakeLists.txt +++ b/backend/lib/noson/noson/CMakeLists.txt @@ -1,6 +1,5 @@ cmake_minimum_required (VERSION 2.8.9 FATAL_ERROR) cmake_policy (VERSION 2.8) -#set(CMAKE_LEGACY_CYGWIN_WIN32 0) # Remove when CMake >= 2.8.4 is required project (noson) @@ -15,13 +14,13 @@ if (MSVC) OPTION (STATIC_CRT "Link the static CRT libraries" OFF) endif () -if (NOT WIN32) +if (NOT MSVC) OPTION (REQUIRE_CXX_98 "Require standard c++98" OFF) endif () ############################################################################### # set lib version here -set (NOSON_LIB_VERSION "1.4.1") +set (NOSON_LIB_VERSION "1.4.2") set (NOSON_LIB_SOVERSION "1") ############################################################################### @@ -40,7 +39,7 @@ if (MSVC) set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /W3 /Od /RTC1 /EHsc /nologo") endif () -if (NOT WIN32) +if (NOT MSVC) if (NOT CYGWIN) add_definitions ("-fPIC") endif () @@ -204,7 +203,7 @@ endif () if (OPENSSL_FOUND) list (APPEND noson_LIBRARIES ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY}) endif () -if (WIN32) +if (MSVC) list (APPEND noson_LIBRARIES ws2_32) else () list (APPEND noson_LIBRARIES m) @@ -229,7 +228,7 @@ set_target_properties (noson PROPERTIES # Create pkg-conf file. # (We use the same files as ./configure does, so we # have to defined the same variables used there). -if (NOT WIN32) +if (NOT MSVC) if (NOT DEFINED CMAKE_INSTALL_BINDIR) set (CMAKE_INSTALL_BINDIR bin) endif () diff --git a/backend/lib/noson/noson/src/musicservices.cpp b/backend/lib/noson/noson/src/musicservices.cpp index fa27f8ea..b5c71e50 100644 --- a/backend/lib/noson/noson/src/musicservices.cpp +++ b/backend/lib/noson/noson/src/musicservices.cpp @@ -321,8 +321,11 @@ bool MusicServices::LoadAccounts(SMAccountList& accounts, std::string& agentStr) WSRequest request(m_host, m_port); request.RequestService("/status/accounts"); WSResponse response(request); - if (!response.IsSuccessful() || !response.GetHeaderValue("SERVER", agentStr)) + if (!response.IsSuccessful()) return false; + //@FIXME make the user agent string according to the template: Linux UPnP/1.0 Sonos/26.99-12345 + //Resolved by SoCo: https://github.com/SoCo/SoCo/blob/18ee1ec11bba8463c4536aa7c2a25f5c20a051a4/soco/music_services/music_service.py#L55 + agentStr.assign("Linux UPnP/1.0 Sonos/26.99-12345"); size_t len = 0, l = 0; std::string data; diff --git a/backend/lib/noson/noson/src/smapi.cpp b/backend/lib/noson/noson/src/smapi.cpp index 4f32fd38..1804ee00 100644 --- a/backend/lib/noson/noson/src/smapi.cpp +++ b/backend/lib/noson/noson/src/smapi.cpp @@ -357,7 +357,7 @@ bool SMAPI::GetDeviceAuthToken(SMOAKeyring::Credentials& auth) ElementList resp = DoCall("getDeviceAuthToken", args); const std::string& tag = resp.GetValue("TAG"); - if (tag == "Fault" && resp.GetValue("faultcode").find("NOT_LINKED_RETRY") != std::string::npos) + if (tag == "Fault") return true; else if (tag == "getDeviceAuthTokenResponse") { diff --git a/backend/lib/noson/test/CMakeLists.txt b/backend/lib/noson/test/CMakeLists.txt index c970d289..79dbf42b 100644 --- a/backend/lib/noson/test/CMakeLists.txt +++ b/backend/lib/noson/test/CMakeLists.txt @@ -1,5 +1,5 @@ -cmake_minimum_required (VERSION 2.6 FATAL_ERROR) -cmake_policy (VERSION 2.6) +cmake_minimum_required (VERSION 2.8.9 FATAL_ERROR) +cmake_policy (VERSION 2.8) project (nosontest)