Make MDNS mandatory and Avahi the default (and only) backend

This commit is contained in:
Julien BLACHE
2009-04-01 16:20:53 +02:00
parent 185864e799
commit eb5cccca06
5 changed files with 11 additions and 50 deletions

View File

@@ -5,12 +5,6 @@ SUBDIRS = plugins
sbin_PROGRAMS = mt-daapd
bin_PROGRAMS = wavstreamer
LDADD=
if COND_REND_AVAHI
ARENDSRC=rend-avahi.c
endif
if COND_OGGVORBIS
OGGVORBISSRC=scan-ogg.c
endif
@@ -38,6 +32,8 @@ endif
wavstreamer_SOURCES = wavstreamer.c
mt_daapd_CPPFLAGS = @AVAHI_CFLAGS@
mt_daapd_LDADD = @AVAHI_LIBS@
mt_daapd_SOURCES = main.c daapd.h rend.h webserver.c \
webserver.h configfile.c configfile.h err.c err.h restart.c restart.h \
mp3-scanner.h mp3-scanner.c \
@@ -49,7 +45,8 @@ mt_daapd_SOURCES = main.c daapd.h rend.h webserver.c \
os-unix.h os-unix.c os.h plugin.c plugin.h db-sql-updates.c \
ssl.h io.h io.c io-errors.h io-plugin.h \
bsd-snprintf.c bsd-snprintf.h \
$(ARENDSRC) $(OGGVORBISSRC) \
rend-avahi.c \
$(OGGVORBISSRC) \
$(FLACSRC) $(MUSEPACKSRC) $(SQLITE3DB) $(SQLDB) \
$(UPNP)

View File

@@ -59,10 +59,7 @@
#include "restart.h"
#include "xml-rpc.h"
#include "upnp.h"
#ifndef WITHOUT_MDNS
# include "rend.h"
#endif
#include "rend.h"
/*
@@ -661,10 +658,8 @@ void config_emit_literal(WS_CONNINFO *pwsc, void *value, char *arg) {
* \param arg any args passwd with the meta command. Also unused
*/
void config_emit_service_status(WS_CONNINFO *pwsc, void *value, char *arg) {
#ifndef WITHOUT_MDNS
int mdns_running;
char *html;
#endif
char buf[256];
int r_days, r_hours, r_mins, r_secs;
int scanning;
@@ -674,7 +669,7 @@ void config_emit_service_status(WS_CONNINFO *pwsc, void *value, char *arg) {
ws_writefd(pwsc,"<th align=\"left\">Status</th><th align=\"left\">Control</th></tr>\n");
ws_writefd(pwsc,"<tr><td>Rendezvous</td>");
#ifndef WITHOUT_MDNS
if(config.use_mdns) {
mdns_running=!rend_running();
@@ -689,9 +684,6 @@ void config_emit_service_status(WS_CONNINFO *pwsc, void *value, char *arg) {
} else {
ws_writefd(pwsc,"<td>Not configured</td><td>&nbsp;</td></tr>\n");
}
#else
ws_writefd(pwsc,"<td>No Support</td><td>&nbsp;</td></tr>\n");
#endif
ws_writefd(pwsc,"<tr><td>DAAP Server</td><td>%s</td>",config.stop ? "Stopping":"Running");
if(config.stop) {

View File

@@ -89,15 +89,13 @@
#include "plugin.h"
#include "util.h"
#include "upnp.h"
#include "rend.h"
#include "io.h"
#ifdef HAVE_GETOPT_H
# include "getopt.h"
#endif
#ifndef WITHOUT_MDNS
# include "rend.h"
#endif
/** Seconds to sleep before checking for a shutdown or reload */
#define MAIN_SLEEP_INTERVAL 2
@@ -485,7 +483,6 @@ int main(int argc, char *argv[]) {
runas = conf_alloc_string("general","runas","nobody");
#ifndef WITHOUT_MDNS
if(config.use_mdns) {
DPRINTF(E_LOG,L_MAIN,"Starting rendezvous daemon\n");
if(rend_init(runas)) {
@@ -493,7 +490,6 @@ int main(int argc, char *argv[]) {
strerror(errno));
}
}
#endif
if(!os_init(config.foreground,runas)) {
DPRINTF(E_LOG,L_MAIN,"Could not initialize server\n");
@@ -514,11 +510,9 @@ int main(int argc, char *argv[]) {
if(err) {
DPRINTF(E_LOG,L_MAIN|L_DB,"Error opening db: %s\n",perr);
#ifndef WITHOUT_MDNS
if(config.use_mdns) {
rend_stop();
}
#endif
os_deinit();
exit(EXIT_FAILURE);
}
@@ -582,7 +576,6 @@ int main(int argc, char *argv[]) {
ws_registerhandler(config.server, "/",main_handler,main_auth,
0,1);
#ifndef WITHOUT_MDNS
if(config.use_mdns) { /* register services */
servername = conf_get_servername();
@@ -618,7 +611,6 @@ int main(int argc, char *argv[]) {
free(servername);
free(iface);
}
#endif
end_time=(int) time(NULL);
@@ -676,12 +668,10 @@ int main(int argc, char *argv[]) {
DPRINTF(E_LOG,L_MAIN,"Stopping gracefully\n");
#ifndef WITHOUT_MDNS
if(config.use_mdns) {
DPRINTF(E_LOG,L_MAIN|L_REND,"Stopping rendezvous daemon\n");
rend_stop();
}
#endif
#ifdef UPNP
upnp_deinit();

View File

@@ -530,15 +530,12 @@ void xml_get_stats(WS_CONNINFO *pwsc) {
xml_output(pxml,"name","Rendezvous");
#ifndef WITHOUT_MDNS
if(config.use_mdns) {
xml_output(pxml,"status",rend_running() ? "Running" : "Stopped"); /* ??? */
} else {
xml_output(pxml,"status","Disabled");
}
#else
ws_writefd(pwsc,"<td>No Support</td><td>&nbsp;</td></tr>\n");
#endif
xml_pop(pxml); /* service */
xml_push(pxml,"service");