mirror of
https://gitlab.xiph.org/xiph/icecast-server.git
synced 2025-02-02 15:07:36 -05:00
Feature: Allow <resource> to match on a specific listen-socket
This commit is contained in:
parent
2febabcddd
commit
d9e96a55e7
@ -596,6 +596,7 @@ static void config_clear_resource(resource_t *resource)
|
|||||||
xmlFree(resource->vhost);
|
xmlFree(resource->vhost);
|
||||||
xmlFree(resource->module);
|
xmlFree(resource->module);
|
||||||
xmlFree(resource->handler);
|
xmlFree(resource->handler);
|
||||||
|
free(resource->listen_socket);
|
||||||
free(resource);
|
free(resource);
|
||||||
resource = nextresource;
|
resource = nextresource;
|
||||||
}
|
}
|
||||||
@ -2007,6 +2008,12 @@ static void _parse_resource(xmlDocPtr doc,
|
|||||||
|
|
||||||
resource->bind_address = (char *)xmlGetProp(node, XMLSTR("bind-address"));
|
resource->bind_address = (char *)xmlGetProp(node, XMLSTR("bind-address"));
|
||||||
|
|
||||||
|
temp = (char *)xmlGetProp(node, XMLSTR("listen-socket"));
|
||||||
|
if (temp) {
|
||||||
|
resource->listen_socket = config_href_to_id(temp);
|
||||||
|
xmlFree(temp);
|
||||||
|
}
|
||||||
|
|
||||||
resource->vhost = (char *)xmlGetProp(node, XMLSTR("vhost"));
|
resource->vhost = (char *)xmlGetProp(node, XMLSTR("vhost"));
|
||||||
|
|
||||||
resource->module = (char *)xmlGetProp(node, XMLSTR("module"));
|
resource->module = (char *)xmlGetProp(node, XMLSTR("module"));
|
||||||
|
@ -139,6 +139,7 @@ typedef struct _resource {
|
|||||||
char *destination;
|
char *destination;
|
||||||
int port;
|
int port;
|
||||||
char *bind_address;
|
char *bind_address;
|
||||||
|
char *listen_socket;
|
||||||
char *vhost;
|
char *vhost;
|
||||||
char *module;
|
char *module;
|
||||||
char *handler;
|
char *handler;
|
||||||
|
@ -1176,6 +1176,9 @@ static int _handle_resources(client_t *client, char **uri)
|
|||||||
if (resource->bind_address != NULL && serverhost != NULL && strcmp(resource->bind_address, serverhost) != 0)
|
if (resource->bind_address != NULL && serverhost != NULL && strcmp(resource->bind_address, serverhost) != 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (resource->listen_socket != NULL && (listen_sock->id == NULL || strcmp(resource->listen_socket, listen_sock->id) != 0))
|
||||||
|
continue;
|
||||||
|
|
||||||
/* Check for the vhost to match. */
|
/* Check for the vhost to match. */
|
||||||
if (resource->vhost != NULL && vhost != NULL && strcmp(resource->vhost, vhost) != 0)
|
if (resource->vhost != NULL && vhost != NULL && strcmp(resource->vhost, vhost) != 0)
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
Reference in New Issue
Block a user