kakwa
666584fba4
fix double free at shutdown
2017-06-15 20:20:09 +02:00
kakwa
cdbbcabfd7
cleaning duplicate #include of headers
2017-05-07 15:39:44 +02:00
kakwa
2a512a8d6a
reformat code
2017-04-22 02:33:05 +02:00
kakwa
b4fce3ffa6
fix include
2017-04-22 02:23:43 +02:00
kakwa
84e015ec26
add handling of NULL strings in logs
...
replace NULL char * by const char * "<undef>" in log messages
as printf("%s", NULL) behavior is not formalized.
2017-04-22 01:42:58 +02:00
kakwa
3542a13ab1
using more portable dirname() function
...
* removing include of <string.h> (which include GNU dirname, which
doesn't follow posix spec, and force using libgen.h
* removing #ifdef for FreeBSD handling of dirname as it's not necessary
anymore.
2017-01-28 03:21:11 +01:00
kakwa
53823817cf
including module to include argp
2017-01-27 00:28:46 +01:00
kakwa
158f49dc46
format code
2016-12-04 13:39:27 +01:00
kakwa
9391f6348a
adding a few #define to handle multiple openssl API version
2016-12-04 13:38:09 +01:00
kakwa
4bdd9f0272
adapt code to newer openssl API
2016-12-04 13:18:33 +01:00
kakwa
ef97018644
code reformat
2016-11-02 18:58:14 +01:00
kakwa
3461d11f94
Merge branch 'master' of https://github.com/kakwa/uts-server
2016-09-14 20:16:37 +02:00
kakwa
c434ed4f38
exit at the first TS_RESP_CTX initialization fail
2016-09-14 20:15:18 +02:00
kakwa
3374a29d11
fix compilation error due to unspecified -std and missing -D and include
2016-09-14 20:08:21 +02:00
kakwa
060e7315d0
remove the awkward default_tsa parameter
...
default_tsa pointing to a specific tsa section doesn't make sense.
removing it.
2016-09-12 22:21:22 +02:00
kakwa
a6d73bfd49
code cleaning an reorganization
2016-09-12 08:39:03 +02:00
kakwa
f92cb7213e
fix potential memleak + comments
2016-09-12 08:20:07 +02:00
kakwa
3080d00e45
fix relative path loading for https certificate/key/ca file
2016-09-11 23:55:38 +02:00
kakwa
32f60e7487
fix the order of some strings in some log messages
2016-09-11 22:09:39 +02:00
kakwa
c68c9b85ad
the max serial size is 160 bits, not 160 bytes...
2016-09-11 22:04:03 +02:00
kakwa
96587d3461
add many comments
2016-09-11 22:01:22 +02:00
kakwa
9babc43333
implement logging of startup civetweb error
2016-09-11 21:09:35 +02:00
kakwa
bac488ae30
adding error handling in case civetweb fails to start
2016-09-11 20:07:14 +02:00
kakwa
0e006a0a61
http headers are case-insensitive replacing strcmp by strcasecmp
2016-09-11 18:27:51 +02:00
kakwa
6df936d408
more consistent log messages
2016-09-09 08:26:31 +02:00
kakwa
e948177a41
enabling multi-threads support
...
as TS_RESP_CTX is not thread safe, this commit implement a pool of
TS_RESP_CTX in which a thread can pick one in a thread safe maner.
* implement a ts_resp_ctx_wrapper containing a TS_RESP_CTX and a
lock and bool to mark the availability of the TS_RESP_CTX
* implement the get_ctxw to recover a given TS_RESP_CTX in a thread safe
maner
* adapt the rest of the code to accomodate the new way of doing things
* set the default number of threads to 10 as it's now safe to do so
2016-09-08 23:21:53 +02:00
kakwa
e31b09f41e
adding a switch to disable request debug log treatement
2016-09-08 21:18:15 +02:00
kakwa
b7bff24915
switching success log to debug
2016-09-08 21:17:35 +02:00
kakwa
d2d2648e7e
better help in command line
2016-09-06 08:51:48 +02:00
kakwa
225c2d3a7c
better handling of error codes
2016-09-05 23:20:29 +02:00
kakwa
8af08d6482
fix segfault in case of a bad request
...
* if the request is wrong, the request handler tried to access the
none allocated serial, which crashes the process.
2016-09-05 23:09:00 +02:00
kakwa
6d11e0d2ae
fixing memory leak on query data
2016-09-05 22:37:03 +02:00
kakwa
0fc57d5396
fix more memleaks
2016-09-05 20:48:50 +02:00
kakwa
236f0cf04c
fix some memory leaks on openssl context cleanup
2016-09-05 20:24:47 +02:00
kakwa
aa97d4699d
fix memleak
2016-09-05 20:06:15 +02:00
kakwa
49870f87b7
some code cleaning
2016-09-02 08:18:48 +02:00
kakwa
6727b81bd2
fix another memleak
2016-09-02 08:12:38 +02:00
kakwa
d104de63d5
adding a function to free the ssl context
2016-09-02 08:00:04 +02:00
kakwa
627f9c5973
just to be safe, strlen + 1 allocated
2016-09-02 07:43:39 +02:00
kakwa
92b289e100
better memory management and extraction of the openssl initialization
2016-09-02 07:42:23 +02:00
kakwa
21e2a4de85
implement better query and response logging
...
* recover the serial
* add the serial in many logs
* add response log
* add timer
2016-09-02 00:36:25 +02:00
kakwa
e732e7cb8e
fix command line in case the pid file is not set
2016-09-01 21:10:26 +02:00
kakwa
a3f65c7050
fix the way relative paths are handled and pid file handler
...
* add a pid file option on command line + implement it
* make the relative path in conf param relative to the configuration
file directory and not the running directory
2016-09-01 19:43:29 +02:00
kakwa
5cbcdc4a1d
code reformatting
2016-09-01 08:29:07 +02:00
kakwa
9a05006d1e
fix default log_level, and fix chdir
...
* the chdir was done after the loading of the conf file, reversing it
* in case log_level is not set, the application would segfault, now
handled properly (default is info)
* remove logging to the daemon facility
2016-09-01 08:25:28 +02:00
kakwa
43984fd1b5
fix ordering between daemonize and get working dir
2016-09-01 08:13:57 +02:00
kakwa
6e687f2fe2
passing the launch working dir to the configuration handler
...
as many configuration paths can be relative to the execution working
directory, this directory is recorded at launch time, and the set_params
function does a chdir(<start work dir>); <load conf>; chdir("/") when
it's called.
2016-09-01 07:59:02 +02:00
kakwa
93ead7ee99
implementing a somewhat proper signal handler
2016-08-31 07:57:51 +02:00
kakwa
f3a950dc41
source formatting
2016-08-31 07:37:13 +02:00
kakwa
ce19f74858
fix ordering between start log and actual start
2016-08-31 07:36:27 +02:00