Skip to content

Commit

Permalink
sync upstream lib/noson
Browse files Browse the repository at this point in the history
janbar-noson-9fab18a
  • Loading branch information
janbar committed Jul 19, 2017
1 parent f445834 commit adee93f
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 12 deletions.
4 changes: 2 additions & 2 deletions backend/lib/noson/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
11 changes: 5 additions & 6 deletions backend/lib/noson/noson/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)

Expand All @@ -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")

###############################################################################
Expand All @@ -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 ()
Expand Down Expand Up @@ -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)
Expand All @@ -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 ()
Expand Down
5 changes: 4 additions & 1 deletion backend/lib/noson/noson/src/musicservices.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion backend/lib/noson/noson/src/smapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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")
{
Expand Down
4 changes: 2 additions & 2 deletions backend/lib/noson/test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)

Expand Down

0 comments on commit adee93f

Please sign in to comment.