kore

An easy to use, scalable and secure web application framework for writing web APIs in C.
Commits | Files | Refs | README | LICENSE | git clone https://git.kore.io/kore.git

commit 37443df6b0cc72a1b471c076546d51df47fce079
parent 311e658d577a39f30c5ec37640043796925d437f
Author: Joris Vink <joris@coders.se>
Date:   Thu,  9 Feb 2017 13:36:08 +0100

Slightly change kore_parent_configure() again.

- Call it before loading configurations when built as single binaries.
- Call it right before forking workers when built as a dso.

Diffstat:
src/kore.c | 15++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/src/kore.c b/src/kore.c @@ -122,7 +122,9 @@ version(void) int main(int argc, char *argv[]) { +#if defined(KORE_SINGLE_BINARY) struct kore_runtime_call *rcall; +#endif int ch, flags; flags = 0; @@ -198,12 +200,12 @@ main(int argc, char *argv[]) usage(); #else kore_module_load(NULL, NULL, KORE_MODULE_NATIVE); -#endif rcall = kore_runtime_getcall("kore_parent_configure"); if (rcall != NULL) { kore_runtime_execute(rcall); kore_free(rcall); } +#endif kore_parse_config(); kore_platform_init(); @@ -416,6 +418,9 @@ kore_server_start(void) { u_int32_t tmp; int quit; +#if !defined(KORE_SINGLE_BINARY) + struct kore_runtime_call *rcall; +#endif if (foreground == 0 && daemon(1, 1) == -1) fatal("cannot daemon(): %s", errno_s); @@ -434,6 +439,14 @@ kore_server_start(void) #if defined(KORE_USE_JSONRPC) kore_log(LOG_NOTICE, "jsonrpc built-in enabled"); #endif +#if !defined(KORE_SINGLE_BINARY) + rcall = kore_runtime_getcall("kore_parent_configure"); + if (rcall != NULL) { + kore_runtime_execute(rcall); + kore_free(rcall); + } +#endif + kore_platform_proctitle("kore [parent]"); kore_msg_init(); kore_worker_init();