37 #include "../util/pool.h" |
37 #include "../util/pool.h" |
38 #include "../public/nsapi.h" |
38 #include "../public/nsapi.h" |
39 #include "../util/plist.h" |
39 #include "../util/plist.h" |
40 #include "../util/date.h" |
40 #include "../util/date.h" |
41 |
41 |
42 #include <ucx/string.h> |
42 #include <cx/string.h> |
43 |
43 |
44 #include "webserver.h" |
44 #include "webserver.h" |
45 #include "log.h" |
45 #include "log.h" |
46 #include "httprequest.h" |
46 #include "httprequest.h" |
47 #include "httplistener.h" |
47 #include "httplistener.h" |
53 static WSBool is_daemon; |
53 static WSBool is_daemon; |
54 |
54 |
55 void test() { |
55 void test() { |
56 time_t t = time(NULL); |
56 time_t t = time(NULL); |
57 pool_handle_t *pool = pool_create(); |
57 pool_handle_t *pool = pool_create(); |
58 sstr_t date = date_format_http(t, pool); |
58 cxmutstr date = date_format_http(t, pool); |
59 printf("%s\n", date.ptr); |
59 printf("%s\n", date.ptr); |
60 } |
60 } |
61 |
61 |
62 |
62 |
63 WSBool main_is_daemon(void) { |
63 WSBool main_is_daemon(void) { |
171 log_ereport(LOG_INFORM, "startup"); |
171 log_ereport(LOG_INFORM, "startup"); |
172 |
172 |
173 int status; |
173 int status; |
174 status = webserver_init(); |
174 status = webserver_init(); |
175 if(status != 0) { |
175 if(status != 0) { |
176 log_ereport(LOG_FAILURE, "Cannot initialize server."); |
176 log_ereport(LOG_FAILURE, "cannot initialize server."); |
177 return EXIT_FAILURE; |
177 return EXIT_FAILURE; |
178 } |
178 } |
179 |
179 |
180 status = webserver_run(); |
180 status = webserver_run(); |
181 if(status != 0) { |
181 if(status != 0) { |