diff --git a/src/log.c b/src/log.c index c59c184..3f078fd 100755 --- a/src/log.c +++ b/src/log.c @@ -1,6 +1,6 @@ /* log.c * - Functions for logging in ices - * Copyright (c) 2000 Alexander Haväng + * Copyright (c) 2000 Alexander Haväng * Copyright (c) 2001 Brendan Cully * * This program is free software; you can redistribute it and/or @@ -20,6 +20,7 @@ */ #include "definitions.h" +#include extern ices_config_t ices_config; @@ -140,7 +141,12 @@ char *ices_log_get_error(void) { /* Function to log string to both console and file */ static void ices_log_string(char *format, char *string) { + time_t t = time(NULL); + char tstr[48]; + strftime(tstr, sizeof(tstr), "%Y.%m.%d %H:%M:%S", localtime(&t)); + if (ices_config.logfile) { + fprintf (ices_config.logfile, "%s: ", tstr); fprintf(ices_config.logfile, format, string); #ifndef HAVE_SETLINEBUF fflush(ices_config.logfile); @@ -148,8 +154,10 @@ static void ices_log_string(char *format, char *string) { } /* Don't log to console when daemonized */ - if (!ices_config.daemon) + if (!ices_config.daemon) { + fprintf (stdout, "%s: ", tstr); fprintf(stdout, format, string); + } } /* Open the ices logfile, create it if needed */ diff --git a/src/playlist/pm_python.c b/src/playlist/pm_python.c index 7c2c89a..930e8a4 100644 --- a/src/playlist/pm_python.c +++ b/src/playlist/pm_python.c @@ -1,6 +1,6 @@ /* playlist_python.c * - Interpreter functions for python - * Copyright (c) 2000 Alexander Haväng + * Copyright (c) 2000 Alexander Haväng * Copyright (c) 2001-3 Brendan Cully * * This program is free software; you can redistribute it and/or @@ -97,7 +97,7 @@ static char *playlist_python_get_next(void) { PyObject* res; char* rc = NULL; - if ((res = python_eval(pl_get_next_hook)) && PyString_Check(res)) + if ((res = python_eval(pl_get_next_hook)) && PyObject_TypeCheck(res, &PyBaseString_Type)) rc = ices_util_strdup(PyString_AsString(res)); else ices_log_error("ices_get_next failed"); @@ -112,7 +112,7 @@ static char*playlist_python_get_metadata(void) { char* rc = NULL; if (pl_get_metadata_hook) { - if ((res = python_eval(pl_get_metadata_hook)) && PyString_Check(res)) + if ((res = python_eval(pl_get_metadata_hook)) && PyObject_TypeCheck(res, &PyBaseString_Type)) rc = ices_util_strdup(PyString_AsString(res)); else ices_log_error("ices_get_metadata failed"); diff --git a/src/setup.c b/src/setup.c index 0fe512c..9efad3e 100644 --- a/src/setup.c +++ b/src/setup.c @@ -490,9 +490,10 @@ static void ices_setup_activate_libshout_changes(const ices_config_t *ices_confi shout_set_user(conn, stream->user); shout_set_password(conn, stream->password); shout_set_format(conn, SHOUT_FORMAT_MP3); - if (stream->protocol == icy_protocol_e) + if (stream->protocol == icy_protocol_e) { shout_set_protocol(conn, SHOUT_PROTOCOL_ICY); - else if (stream->protocol == http_protocol_e) + shout_set_tls(conn, SHOUT_TLS_DISABLED); + } else if (stream->protocol == http_protocol_e) shout_set_protocol(conn, SHOUT_PROTOCOL_HTTP); else shout_set_protocol(conn, SHOUT_PROTOCOL_XAUDIOCAST);