mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-30 09:03:23 -05:00
Rename servername variable to a more appropriate libname
This commit is contained in:
parent
b918d14e38
commit
d228e0dcb8
14
src/main.c
14
src/main.c
@ -224,7 +224,7 @@ static int
|
|||||||
register_services(char *ffid, int no_rsp, int no_daap)
|
register_services(char *ffid, int no_rsp, int no_daap)
|
||||||
{
|
{
|
||||||
cfg_t *lib;
|
cfg_t *lib;
|
||||||
char *servername;
|
char *libname;
|
||||||
char *password;
|
char *password;
|
||||||
char *txtrecord[10];
|
char *txtrecord[10];
|
||||||
char records[9][128];
|
char records[9][128];
|
||||||
@ -237,8 +237,8 @@ register_services(char *ffid, int no_rsp, int no_daap)
|
|||||||
|
|
||||||
lib = cfg_getnsec(cfg, "library", 0);
|
lib = cfg_getnsec(cfg, "library", 0);
|
||||||
|
|
||||||
servername = cfg_getstr(lib, "name");
|
libname = cfg_getstr(lib, "name");
|
||||||
hash = djb_hash(servername, strlen(servername));
|
hash = djb_hash(libname, strlen(libname));
|
||||||
|
|
||||||
for (i = 0; i < (sizeof(records) / sizeof(records[0])); i++)
|
for (i = 0; i < (sizeof(records) / sizeof(records[0])); i++)
|
||||||
{
|
{
|
||||||
@ -251,7 +251,7 @@ register_services(char *ffid, int no_rsp, int no_daap)
|
|||||||
snprintf(txtrecord[0], 128, "txtvers=1");
|
snprintf(txtrecord[0], 128, "txtvers=1");
|
||||||
snprintf(txtrecord[1], 128, "Database ID=%0X", hash);
|
snprintf(txtrecord[1], 128, "Database ID=%0X", hash);
|
||||||
snprintf(txtrecord[2], 128, "Machine ID=%0X", hash);
|
snprintf(txtrecord[2], 128, "Machine ID=%0X", hash);
|
||||||
snprintf(txtrecord[3], 128, "Machine Name=%s", servername);
|
snprintf(txtrecord[3], 128, "Machine Name=%s", libname);
|
||||||
snprintf(txtrecord[4], 128, "mtd-version=%s", VERSION);
|
snprintf(txtrecord[4], 128, "mtd-version=%s", VERSION);
|
||||||
snprintf(txtrecord[5], 128, "iTSh Version=131073"); /* iTunes 6.0.4 */
|
snprintf(txtrecord[5], 128, "iTSh Version=131073"); /* iTunes 6.0.4 */
|
||||||
snprintf(txtrecord[6], 128, "Version=196610"); /* iTunes 6.0.4 */
|
snprintf(txtrecord[6], 128, "Version=196610"); /* iTunes 6.0.4 */
|
||||||
@ -269,14 +269,14 @@ register_services(char *ffid, int no_rsp, int no_daap)
|
|||||||
port = cfg_getint(lib, "port");
|
port = cfg_getint(lib, "port");
|
||||||
|
|
||||||
/* Register web server service */
|
/* Register web server service */
|
||||||
ret = mdns_register(servername, "_http._tcp", port, txtrecord);
|
ret = mdns_register(libname, "_http._tcp", port, txtrecord);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
/* Register RSP service */
|
/* Register RSP service */
|
||||||
if (!no_rsp)
|
if (!no_rsp)
|
||||||
{
|
{
|
||||||
ret = mdns_register(servername, "_rsp._tcp", port, txtrecord);
|
ret = mdns_register(libname, "_rsp._tcp", port, txtrecord);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -284,7 +284,7 @@ register_services(char *ffid, int no_rsp, int no_daap)
|
|||||||
/* Register DAAP service */
|
/* Register DAAP service */
|
||||||
if (!no_daap)
|
if (!no_daap)
|
||||||
{
|
{
|
||||||
ret = mdns_register(servername, "_daap._tcp", port, txtrecord);
|
ret = mdns_register(libname, "_daap._tcp", port, txtrecord);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user