Skip to content

Commit

Permalink
add hijack option on mount to allow replacment. not enabled by default
Browse files Browse the repository at this point in the history
This allows an incoming source client to replace an existing stream, typical use
would be to replace a relay which restarts again on exit.  This would happen
before listeners drop via an fallback.
  • Loading branch information
karlheyes committed Mar 5, 2023
1 parent 2b68371 commit b8a34a3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/auth.c
Original file line number Diff line number Diff line change
Expand Up @@ -939,6 +939,8 @@ int auth_check_source (client_t *client, const char *mount)
if (mountinfo)
{
ret = 1;
if (mountinfo->hijack)
client->flags |= CLIENT_HIJACKER;
if (auth_stream_authenticate (client, mount, mountinfo) > 0)
break;
ret = -1;
Expand Down
1 change: 1 addition & 0 deletions src/cfgfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -1404,6 +1404,7 @@ static int _parse_mount (cfg_xml *cfg, void *arg)
{ "fallback-mount", _parse_fallback, &mount->fallback },
{ "fallback-override", config_get_bool, &mount->fallback_override },
{ "fallback-when-full", config_get_bool, &mount->fallback_when_full },
{ "hijack", config_get_bool, &mount->hijack },
{ "allow-chunked", config_get_bool, &mount->allow_chunked },
{ "max-listeners", config_get_int, &mount->max_listeners },
{ "max-bandwidth", config_get_bitrate, &mount->max_bandwidth },
Expand Down
1 change: 1 addition & 0 deletions src/cfgfile.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ typedef struct _mount_proxy {
int allow_chunked; /* allow chunked transfers */
int mp3_meta_interval; /* outgoing per-stream metadata interval */
int max_send_size;
int hijack; // an authenticated source can hijack and exist stream
int filter_theora; /* prevent theora pages getting queued */
int url_ogg_meta; /* enable to allow updates via url requests for ogg */
int ogg_passthrough; /* enable to prevent the ogg stream being rebuilt */
Expand Down

0 comments on commit b8a34a3

Please sign in to comment.