mirror of
https://github.com/morgan9e/UxPlay
synced 2026-04-14 00:04:13 +09:00
cosmetic change (keep lib free of UxPlay mentions in case of re-use)
make NOHOLD feature a #define item
This commit is contained in:
@@ -24,6 +24,10 @@ endif()
|
||||
|
||||
message( STATUS "using CMAKE_CFLAGS: " ${CMAKE_C_FLAGS} )
|
||||
|
||||
#activate the NOHOLD feature to drop existing connections if a third connection is made
|
||||
add_definitions( -DNOHOLD )
|
||||
|
||||
|
||||
INCLUDE (CheckIncludeFiles)
|
||||
if( WIN32 )
|
||||
CHECK_INCLUDE_FILES ("winsock2.h" WINSOCK2 )
|
||||
@@ -123,7 +127,7 @@ if ( NOT APPLE )
|
||||
target_include_directories( airplay PRIVATE ${AVAHI_DNSSD_INCLUDE_DIRS} )
|
||||
find_library( DNSSD ${AVAHI_DNSSD_LIBRARIES} PATH ${AVAHI_DNSSD_LIBDIR})
|
||||
target_link_libraries(airplay PUBLIC ${DNSSD} )
|
||||
else() # UxPlay can also build if mDNSResponder or another implementation of dns_sd is present instead of Avahi
|
||||
else() # can also build if mDNSResponder or another implementation of dns_sd is present instead of Avahi
|
||||
if ( WIN32 )
|
||||
set(BONJOUR_SDK "$ENV{BONJOUR_SDK_HOME}" )
|
||||
message( STATUS "BONJOUR_SDK_HOME " ${BONJOUR_SDK} )
|
||||
|
||||
@@ -172,7 +172,8 @@ httpd_accept_connection(httpd_t *httpd, int server_fd, int is_ipv6)
|
||||
local = netutils_get_address(&local_saddr, &local_len);
|
||||
remote = netutils_get_address(&remote_saddr, &remote_len);
|
||||
|
||||
/* for uxplay, remove existing connections to make way for new connections:
|
||||
#ifdef NOHOLD
|
||||
/* remove existing connections to make way for new connections:
|
||||
* this will only occur if max_connections > 2 */
|
||||
if (httpd->open_connections >= 2) {
|
||||
logger_log(httpd->logger, LOGGER_INFO, "Destroying current connections to allow connection by new client");
|
||||
@@ -184,7 +185,8 @@ httpd_accept_connection(httpd_t *httpd, int server_fd, int is_ipv6)
|
||||
httpd_remove_connection(httpd, connection);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
ret = httpd_add_connection(httpd, fd, local, local_len, remote, remote_len);
|
||||
if (ret == -1) {
|
||||
shutdown(fd, SHUT_RDWR);
|
||||
|
||||
@@ -213,7 +213,7 @@ conn_request(void *ptr, http_request_t *request, http_response_t **response) {
|
||||
} else if (!strcmp(method, "POST") && !strcmp(url, "/pair-pin-start")) {
|
||||
logger_log(conn->raop->logger, LOGGER_ERR, "*** ERROR: Unsupported client request %s with URL %s", method, url);
|
||||
logger_log(conn->raop->logger, LOGGER_INFO, "*** AirPlay client has requested PIN as implemented on AppleTV,");
|
||||
logger_log(conn->raop->logger, LOGGER_INFO, "*** but UxPlay does not require a PIN and cannot supply one.");
|
||||
logger_log(conn->raop->logger, LOGGER_INFO, "*** but this implementation does not require a PIN and cannot supply one.");
|
||||
logger_log(conn->raop->logger, LOGGER_INFO, "*** This client behavior may have been required by mobile device management (MDM)");
|
||||
logger_log(conn->raop->logger, LOGGER_INFO, "*** (such as Apple Configurator or a third-party MDM tool).");
|
||||
} else if (!strcmp(method, "POST") && !strcmp(url, "/pair-setup")) {
|
||||
|
||||
@@ -420,7 +420,7 @@ raop_handler_setup(raop_conn_t *conn,
|
||||
plist_get_bool_val(req_is_remote_control_only_node, &bool_val);
|
||||
if (bool_val) {
|
||||
logger_log(conn->raop->logger, LOGGER_ERR, "Client specified AirPlay2 \"Remote Control\" protocol\n"
|
||||
" UxPlay only supports AirPlay v1 protocol using NTP and timing port");
|
||||
" Only AirPlay v1 protocol (using NTP and timing port) is supported");
|
||||
}
|
||||
}
|
||||
uint64_t string_len;
|
||||
@@ -428,7 +428,7 @@ raop_handler_setup(raop_conn_t *conn,
|
||||
plist_t req_timing_protocol_node = plist_dict_get_item(req_root_node, "timingProtocol");
|
||||
timing_protocol = plist_get_string_ptr(req_timing_protocol_node, &string_len);
|
||||
if (strcmp(timing_protocol, "NTP")) {
|
||||
logger_log(conn->raop->logger, LOGGER_ERR, "Client specified timingProtocol=%s, UxPlay requires timingProtocol= NTP", timing_protocol);
|
||||
logger_log(conn->raop->logger, LOGGER_ERR, "Client specified timingProtocol=%s, but timingProtocol= NTP is required here", timing_protocol);
|
||||
}
|
||||
timing_protocol = NULL;
|
||||
uint64_t timing_rport = 0;
|
||||
|
||||
Reference in New Issue
Block a user