X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/blobdiff_plain/d76bbdea349bf3856172ce9599e657d566e91162..4265e5d362914f3732b4035dcf67162e525e0142:/server/server.c diff --git a/server/server.c b/server/server.c index 767fa31..feaac7e 100644 --- a/server/server.c +++ b/server/server.c @@ -541,13 +541,13 @@ static int c_queue(struct conn *c, queue_fix_sofar(playing); if((l = trackdb_get(playing->track, "_length")) && (length = atol(l))) { - time(&when); + xtime(&when); when += length - playing->sofar + config->gap; } } else /* Nothing is playing but playing is enabled, so whatever is * first in the queue can be expected to start immediately. */ - time(&when); + xtime(&when); } for(q = qhead.next; q != &qhead; q = q->next) { /* fill in estimated start time */ @@ -894,7 +894,7 @@ static void logclient(const char *msg, void *user) { return; } sink_printf(ev_writer_sink(c->w), "%"PRIxMAX" %s\n", - (uintmax_t)time(0), msg); + (uintmax_t)xtime(0), msg); } static int c_log(struct conn *c, @@ -904,7 +904,7 @@ static int c_log(struct conn *c, sink_writes(ev_writer_sink(c->w), "254 OK\n"); /* pump out initial state */ - time(&now); + xtime(&now); sink_printf(ev_writer_sink(c->w), "%"PRIxMAX" state %s\n", (uintmax_t)now, playing_is_enabled() ? "enable_play" : "disable_play"); @@ -1105,9 +1105,12 @@ static int c_rtp_address(struct conn *c, char attribute((unused)) **vec, int attribute((unused)) nvec) { if(api == &uaudio_rtp) { + char **addr; + + netaddress_format(&config->broadcast, NULL, &addr); sink_printf(ev_writer_sink(c->w), "252 %s %s\n", - quoteutf8(config->broadcast.s[0]), - quoteutf8(config->broadcast.s[1])); + quoteutf8(addr[1]), + quoteutf8(addr[2])); } else sink_writes(ev_writer_sink(c->w), "550 No RTP\n"); return 1; @@ -1259,7 +1262,7 @@ static int c_edituser(struct conn *c, if(d->lo) sink_printf(ev_writer_sink(d->w), "%"PRIxMAX" rights_changed %s\n", - (uintmax_t)time(0), + (uintmax_t)xtime(0), quoteutf8(new_rights)); } } @@ -1440,7 +1443,7 @@ static int c_reminder(struct conn *c, if(!last_reminder) last_reminder = hash_new(sizeof (time_t)); last = hash_find(last_reminder, vec[0]); - time(&now); + xtime(&now); if(last && now < *last + config->reminder_interval) { error(0, "sent a password reminder to '%s' too recently", vec[0]); sink_writes(ev_writer_sink(c->w), "550 Cannot send a reminder email\n"); @@ -1847,6 +1850,7 @@ int server_start(ev_source *ev, int pf, l->pf = pf; if(ev_listen(ev, fd, listen_callback, l, "server listener")) exit(EXIT_FAILURE); + info("listening on %s", name); return fd; }