mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-27 15:45:56 -05:00
Allow nulls in txt entry for rend registration
This commit is contained in:
parent
1ca265d4c5
commit
f6bab734d1
11
src/plugin.c
11
src/plugin.c
@ -48,7 +48,7 @@ typedef struct tag_pluginentry {
|
|||||||
char *versionstring;
|
char *versionstring;
|
||||||
regex_t regex;
|
regex_t regex;
|
||||||
void *functions;
|
void *functions;
|
||||||
PLUGIN_REND_INFO **rend_info;
|
PLUGIN_REND_INFO *rend_info;
|
||||||
struct tag_pluginentry *next;
|
struct tag_pluginentry *next;
|
||||||
} PLUGIN_ENTRY;
|
} PLUGIN_ENTRY;
|
||||||
|
|
||||||
@ -325,6 +325,7 @@ void plugin_url_handle(WS_CONNINFO *pwsc) {
|
|||||||
int plugin_rend_register(char *name, int port, char *iface) {
|
int plugin_rend_register(char *name, int port, char *iface) {
|
||||||
PLUGIN_ENTRY *ppi;
|
PLUGIN_ENTRY *ppi;
|
||||||
PLUGIN_REND_INFO *pri;
|
PLUGIN_REND_INFO *pri;
|
||||||
|
char *txt;
|
||||||
|
|
||||||
_plugin_readlock();
|
_plugin_readlock();
|
||||||
ppi = _plugin_list.next;
|
ppi = _plugin_list.next;
|
||||||
@ -332,10 +333,14 @@ int plugin_rend_register(char *name, int port, char *iface) {
|
|||||||
while(ppi) {
|
while(ppi) {
|
||||||
DPRINTF(E_DBG,L_PLUG,"Checking %s\n",ppi->versionstring);
|
DPRINTF(E_DBG,L_PLUG,"Checking %s\n",ppi->versionstring);
|
||||||
if(ppi->rend_info) {
|
if(ppi->rend_info) {
|
||||||
pri = *(ppi->rend_info);
|
pri = ppi->rend_info;
|
||||||
while(pri->type) {
|
while(pri->type) {
|
||||||
|
txt = pri->txt;
|
||||||
|
if(!pri->txt)
|
||||||
|
txt = "";
|
||||||
|
|
||||||
DPRINTF(E_DBG,L_PLUG,"Registering %s\n",pri->type);
|
DPRINTF(E_DBG,L_PLUG,"Registering %s\n",pri->type);
|
||||||
rend_register(name,pri->type,port,iface,pri->txt);
|
rend_register(name,pri->type,port,iface,txt);
|
||||||
pri++;
|
pri++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,7 @@ typedef struct tag_plugin_info {
|
|||||||
char *url; /* for output plugins */
|
char *url; /* for output plugins */
|
||||||
void *handler_functions;
|
void *handler_functions;
|
||||||
void *pi; /* exported functions */
|
void *pi; /* exported functions */
|
||||||
PLUGIN_REND_INFO **rend_info;
|
PLUGIN_REND_INFO *rend_info;
|
||||||
} PLUGIN_INFO;
|
} PLUGIN_INFO;
|
||||||
|
|
||||||
/* version 1 plugin imports */
|
/* version 1 plugin imports */
|
||||||
|
@ -35,7 +35,7 @@ typedef struct tag_plugin_info {
|
|||||||
char *url; /* regex of namespace to handle if OUTPUT type */
|
char *url; /* regex of namespace to handle if OUTPUT type */
|
||||||
void *handler_functions;
|
void *handler_functions;
|
||||||
void *fn; /* input functions*/
|
void *fn; /* input functions*/
|
||||||
PLUGIN_REND_INFO **rend_info;
|
PLUGIN_REND_INFO *rend_info;
|
||||||
} PLUGIN_INFO;
|
} PLUGIN_INFO;
|
||||||
|
|
||||||
/* xml helpers for output plugins */
|
/* xml helpers for output plugins */
|
||||||
|
Loading…
Reference in New Issue
Block a user