1
0
mirror of https://github.com/kakwa/uts-server synced 2024-12-04 23:15:54 +01:00

code reformat

This commit is contained in:
kakwa 2016-11-02 18:58:14 +01:00
parent fc1a736672
commit ef97018644
7 changed files with 69 additions and 75 deletions

View File

@ -1,11 +1,11 @@
#include <stdlib.h>
#include <stdbool.h>
#include <stdint.h>
#include <stddef.h> /* for offsetof() macro */
#include <string.h>
#include <pthread.h>
#include <civetweb.h>
#include <openssl/ts.h>
#include <pthread.h>
#include <stdbool.h>
#include <stddef.h> /* for offsetof() macro */
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#define HTTP_OPTIONS 1
#define LOGLEVEL_OPTIONS 2

View File

@ -1,8 +1,8 @@
#include <stdbool.h>
#include "utils.h"
#include <stdbool.h>
struct tuser_data {
char *first_message;
char *first_message;
};
int http_server_start(char *conffile, char *conf_wd, bool stdout_dbg);

View File

@ -1,16 +1,16 @@
#include <openssl/opensslconf.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <sys/syslog.h>
#include "context.h"
#include <openssl/bio.h>
#include <openssl/bn.h>
#include <openssl/err.h>
#include <openssl/opensslconf.h>
#include <openssl/pem.h>
#include <openssl/rand.h>
#include <openssl/ts.h>
#include <openssl/bn.h>
#include "context.h"
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/syslog.h>
/* Name of config entry that defines the OID file. */
#define OID_SECTION "oids"

View File

@ -1,15 +1,15 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <unistd.h>
#include <getopt.h>
#include "http.h"
#include <argp.h>
#include <sys/syslog.h>
#include <ctype.h>
#include <getopt.h>
#include <libgen.h>
#include <limits.h>
#include <linux/limits.h>
#include "http.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/syslog.h>
#include <unistd.h>
const char *argp_program_version = UTS_VERSION;

View File

@ -1,15 +1,15 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <civetweb.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <sys/syslog.h>
#include <unistd.h>
#include <time.h>
#include "http.h"
#include <civetweb.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdlib.h>
#include <string.h>
#include <string.h>
#include <sys/syslog.h>
#include <time.h>
#include <unistd.h>
static char *rand_string(char *str, size_t size) {
const char charset[] = "1234567890ABCDEF";

View File

@ -3,25 +3,25 @@
* * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "utils.h"
#include <civetweb.h>
#include <openssl/opensslconf.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <sys/syslog.h>
#include <openssl/bio.h>
#include <openssl/bn.h>
#include <openssl/err.h>
#include <openssl/ssl.h>
#include <openssl/opensslconf.h>
#include <openssl/pem.h>
#include <openssl/rand.h>
#include <openssl/ssl.h>
#include <openssl/ts.h>
#include <openssl/bn.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdlib.h>
#include <string.h>
#include <string.h>
#include <sys/syslog.h>
#include <syslog.h>
#include "utils.h"
int add_oid_section(rfc3161_context *ct, CONF *conf) {
char *p;
@ -120,7 +120,7 @@ TS_RESP_CTX *create_tsctx(rfc3161_context *ct, CONF *conf, const char *section,
TS_RESP_CTX *resp_ctx = NULL;
// recover the section defining the default tsa
//if ((section = TS_CONF_get_tsa_section(conf, section)) == NULL) {
// if ((section = TS_CONF_get_tsa_section(conf, section)) == NULL) {
// uts_logger(ct, LOG_ERR, "failed to get or use '%s' in section [ %s ]",
// "default_tsa", "tsa");
// goto end;

View File

@ -1,18 +1,18 @@
#include "utils.h"
#include <errno.h>
#include <fcntl.h>
#include <openssl/bio.h>
#include <signal.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <syslog.h>
#include <stdarg.h>
#include <openssl/bio.h>
#include <errno.h>
#include <string.h>
#include <syslog.h>
#include <sys/stat.h>
#include <fcntl.h>
#include "utils.h"
#include <sys/stat.h>
#include <sys/types.h>
#include <syslog.h>
#include <syslog.h>
#include <unistd.h>
static void signal_handler_general(int sig_num) {
g_uts_sig = sig_num;
@ -22,18 +22,11 @@ static void signal_handler_up(int sig_num) {
g_uts_sig_up = sig_num;
}
CODE prioritynames[] = {{"alert", LOG_ALERT},
{"crit", LOG_CRIT},
{"debug", LOG_DEBUG},
{"emerg", LOG_EMERG},
{"err", LOG_ERR},
{"error", LOG_ERR},
{"info", LOG_INFO},
{"notice", LOG_NOTICE},
{"panic", LOG_EMERG},
{"warn", LOG_WARNING},
{"warning", LOG_WARNING},
{NULL, -1}};
CODE prioritynames[] = {
{"alert", LOG_ALERT}, {"crit", LOG_CRIT}, {"debug", LOG_DEBUG},
{"emerg", LOG_EMERG}, {"err", LOG_ERR}, {"error", LOG_ERR},
{"info", LOG_INFO}, {"notice", LOG_NOTICE}, {"panic", LOG_EMERG},
{"warn", LOG_WARNING}, {"warning", LOG_WARNING}, {NULL, -1}};
int init_pid(char *pidfile_path) {
// if pidfile_path is null, the user did not request one
@ -362,12 +355,13 @@ int set_params(rfc3161_context *ct, char *conf_file, char *conf_wd) {
ct->ts_ctx_pool = calloc(numthreads, sizeof(ts_resp_ctx_wrapper));
ct->numthreads = numthreads;
for (int i = 0; i < numthreads; i++) {
ct->ts_ctx_pool[i].ts_ctx = create_tsctx(ct, ct->conf, TSA_SECTION, NULL);
ct->ts_ctx_pool[i].ts_ctx =
create_tsctx(ct, ct->conf, TSA_SECTION, NULL);
ct->ts_ctx_pool[i].available = 1;
if (ct->ts_ctx_pool[i].ts_ctx == NULL){
if (ct->ts_ctx_pool[i].ts_ctx == NULL) {
ret = 0;
break;
}
break;
}
}
// like any good daemon, return to '/' once the configuration is loaded
chdir("/");