diff --git a/inc/http.h b/inc/http.h index 2ead941..61fdd07 100644 --- a/inc/http.h +++ b/inc/http.h @@ -1,4 +1,4 @@ #include #include "utils.h" -int http_server_start(char *conffile, char *conf_wd,bool stdout_dbg); +int http_server_start(char *conffile, char *conf_wd, bool stdout_dbg); diff --git a/src/cmd/uts-server.c b/src/cmd/uts-server.c index 5c7fcf6..d6927ff 100644 --- a/src/cmd/uts-server.c +++ b/src/cmd/uts-server.c @@ -64,16 +64,18 @@ int main(int argc, char **argv) { int ret = EXIT_SUCCESS; // get the current path, the configuration can be relative to this path - char conf_wd[PATH_MAX]; - if (getcwd(conf_wd, sizeof(conf_wd)) == NULL){ + char conf_wd[PATH_MAX]; + if (getcwd(conf_wd, sizeof(conf_wd)) == NULL) { syslog(LOG_CRIT, "unable to get the current, uts-server start failed"); - return EXIT_FAILURE; - } + return EXIT_FAILURE; + } if (args.daemonize) skeleton_daemon(); - syslog(LOG_NOTICE, "uts-server daemon starting with conf '%s' from working dir '%s'", args.conffile, conf_wd); + syslog(LOG_NOTICE, + "uts-server daemon starting with conf '%s' from working dir '%s'", + args.conffile, conf_wd); while (1) { ret = http_server_start(args.conffile, conf_wd, args.stdout_dbg); diff --git a/src/lib/http.c b/src/lib/http.c index 654f8f9..8f90be2 100644 --- a/src/lib/http.c +++ b/src/lib/http.c @@ -128,7 +128,7 @@ int rfc3161_handler(struct mg_connection *conn, void *context) { return 1; } -int http_server_start(char *conffile, char * conf_wd, bool stdout_dbg) { +int http_server_start(char *conffile, char *conf_wd, bool stdout_dbg) { struct mg_context *ctx; struct mg_callbacks callbacks; @@ -147,8 +147,8 @@ int http_server_start(char *conffile, char * conf_wd, bool stdout_dbg) { mg_set_request_handler(ctx, "/", rfc3161_handler, (void *)ct); // Wait until some signals are received - while ( g_uts_sig == 0 ){ - sleep(1); + while (g_uts_sig == 0) { + sleep(1); } // Stop the server. diff --git a/src/lib/utils.c b/src/lib/utils.c index 840fa58..d34ff02 100644 --- a/src/lib/utils.c +++ b/src/lib/utils.c @@ -90,7 +90,7 @@ void skeleton_daemon() { } /* Open the log file */ - //openlog("uts-server", LOG_PID, LOG_DAEMON); + // openlog("uts-server", LOG_PID, LOG_DAEMON); } void log_hex(rfc3161_context *ct, int priority, char *id, @@ -223,8 +223,8 @@ int set_params(rfc3161_context *ct, char *conf_file, char *conf_wd) { int http_counter = 0; CONF *conf = load_config_file(ct, conf_file); - if(conf == NULL) - goto end; + if (conf == NULL) + goto end; // first pass to set the loglevel as soon as possible for (int i = 0; i < RFC3161_OPTIONS_LEN; i++) {