diff --git a/src/connection.c b/src/connection.c index d35ee4d0..9a8e3a3a 100644 --- a/src/connection.c +++ b/src/connection.c @@ -1064,6 +1064,10 @@ static void _handle_get_request(client_t *client) { } } + if (source->no_mount) { + client_send_error_by_id(client, ICECAST_ERROR_CON_MOUNT_NO_FOR_DIRECT_ACCESS); + break; + } /* Set max listening duration in case not already set. */ if (client->con->discon_time == 0) { diff --git a/src/errors.c b/src/errors.c index 899ed7ce..f25bd1ff 100644 --- a/src/errors.c +++ b/src/errors.c @@ -99,6 +99,9 @@ static const icecast_error_t __errors[] = { {.id = ICECAST_ERROR_CON_UPGRADE_ERROR, .http_status = 400 /* XXX */, .uuid = "ec16f654-f262-415f-ab91-95703ae33704", .message = "Can not upgrade protocol"}, + {.id = ICECAST_ERROR_CON_MOUNT_NO_FOR_DIRECT_ACCESS, .http_status = 400 /* XXX */, + .uuid = "652548c6-2a7d-4c73-a1c5-e53759032bd1", + .message = "Mountpoint is not available for direct access"}, {.id = ICECAST_ERROR_FSERV_FILE_NOT_FOUND, .http_status = 404, .uuid = "18c32b43-0d8e-469d-b434-10133cdd06ad", .message = "The file you requested could not be found"}, diff --git a/src/errors.h b/src/errors.h index 1a6828c5..5ed45401 100644 --- a/src/errors.h +++ b/src/errors.h @@ -37,6 +37,7 @@ typedef enum { ICECAST_ERROR_CON_UNIMPLEMENTED, ICECAST_ERROR_CON_UNKNOWN_REQUEST, ICECAST_ERROR_CON_UPGRADE_ERROR, + ICECAST_ERROR_CON_MOUNT_NO_FOR_DIRECT_ACCESS, ICECAST_ERROR_FSERV_FILE_NOT_FOUND, ICECAST_ERROR_FSERV_FILE_NOT_READABLE, ICECAST_ERROR_FSERV_REQUEST_RANGE_NOT_SATISFIABLE, diff --git a/src/source.c b/src/source.c index 487b98ab..ea0eba41 100644 --- a/src/source.c +++ b/src/source.c @@ -1000,6 +1000,7 @@ static void source_apply_mount (ice_config_t *config, source_t *source, mount_pr source->max_listeners = mountinfo->max_listeners; source->fallback_override = mountinfo->fallback_override; source->hidden = mountinfo->hidden; + source->no_mount = mountinfo->no_mount; } /* if a setting is available in the mount details then use it, else diff --git a/src/source.h b/src/source.h index 755b911d..e35e9d90 100644 --- a/src/source.h +++ b/src/source.h @@ -76,6 +76,7 @@ struct source_tag { int on_demand; int on_demand_req; int hidden; + int no_mount; // copy of mount_proxy->no_mount time_t last_read; int short_delay;