mirror of
https://github.com/kakwa/uts-server
synced 2024-12-04 23:15:54 +01:00
code reformatting
This commit is contained in:
parent
9a05006d1e
commit
5cbcdc4a1d
@ -1,4 +1,4 @@
|
||||
#include <stdbool.h>
|
||||
#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);
|
||||
|
@ -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);
|
||||
|
@ -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.
|
||||
|
@ -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++) {
|
||||
|
Loading…
Reference in New Issue
Block a user