mirror of
https://github.com/morgan9e/UxPlay
synced 2026-04-15 00:34:05 +09:00
rework nohold option for compatibilty with future video streaming
This commit is contained in:
18
lib/raop.c
18
lib/raop.c
@@ -174,10 +174,20 @@ conn_request(void *ptr, http_request_t *request, http_response_t **response) {
|
||||
if (httpd_count_connection_type(conn->raop->httpd, CONNECTION_TYPE_RAOP)) {
|
||||
char ipaddr[40];
|
||||
utils_ipaddress_to_string(conn->remotelen, conn->remote, conn->zone_id, ipaddr, (int) (sizeof(ipaddr)));
|
||||
logger_log(conn->raop->logger, LOGGER_WARNING, "rejecting new connection request from %s", ipaddr);
|
||||
*response = http_response_create();
|
||||
http_response_init(*response, protocol, 409, "Conflict: Server is connected to another client");
|
||||
goto finish;
|
||||
if (httpd_nohold(conn->raop->httpd)) {
|
||||
logger_log(conn->raop->logger, LOGGER_INFO, "\"nohold\" feature: switch to new connection request from %s", ipaddr);
|
||||
if (conn->raop->callbacks.video_reset) {
|
||||
printf("**************************video_reset*************************\n");
|
||||
conn->raop->callbacks.video_reset(conn->raop->callbacks.cls);
|
||||
}
|
||||
httpd_remove_known_connections(conn->raop->httpd);
|
||||
|
||||
} else {
|
||||
logger_log(conn->raop->logger, LOGGER_WARNING, "rejecting new connection request from %s", ipaddr);
|
||||
*response = http_response_create();
|
||||
http_response_init(*response, protocol, 409, "Conflict: Server is connected to another client");
|
||||
goto finish;
|
||||
}
|
||||
}
|
||||
httpd_set_connection_type(conn->raop->httpd, ptr, CONNECTION_TYPE_RAOP);
|
||||
conn->connection_type = CONNECTION_TYPE_RAOP;
|
||||
|
||||
Reference in New Issue
Block a user