diff options
author | justanothercatgirl <sotov@twistea.su> | 2025-04-01 21:37:43 +0300 |
---|---|---|
committer | justanothercatgirl <sotov@twistea.su> | 2025-04-01 21:54:17 +0300 |
commit | a81c5876f2058605cc5f15525591acde3ae16a80 (patch) | |
tree | 37edb55c4733288c9e58a0da960a6e3918a12279 /src/main.c | |
parent | 08403b616f9dad83cb1204eec83ba1252e3eb129 (diff) |
Integrated STE into html generation & cleaned up code
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -49,7 +49,7 @@ enum MHD_Result process_connection(void *cls, struct MHD_Connection *connection, } else if (handler != NULL) { /* endpoint access */ LINFOF("Accessed endpoint at url %s", url); - res = handler(connection, &status); + res = handler(method, connection, &status); } else if ((newurl = arg->query(url + 1)) != NULL) { LINFOF("Redirect from %s to %s", url, newurl); response = "<!DOCTYPE html><html><body>Recirecting...</body></html>"; @@ -118,15 +118,15 @@ int main(int argc, char *argv[]) { const char *dlpath = DEFAULT_ENDPOINTS_PATH; const char *dbpath = DEFAULT_DATABASE_PATH; struct MHD_Daemon *daemon = init(&sig, dlpath, dbpath); - /* while (reload_library == 0) { */ - /* sigsuspend(&sig); */ - /* if (reload_library == 1) { */ - /* reload_dylib(dlpath, dbpath); */ - /* reload_library = 0; */ - /* } */ - /* } */ - getchar(); - if (arg.destructor) arg.destructor(); + while (reload_library == 0) { + sigsuspend(&sig); + if (reload_library == 1) { + reload_dylib(dlpath, dbpath); + reload_library = 0; + } + } + getchar(); /* to be replaced with fork later */ + arg.destructor(); dlclose(arg.dylib); MHD_stop_daemon(daemon); return 0; |