]> git.seodisparate.com - c_simple_http/commitdiff
Minor refactoring
authorStephen Seo <seo.disparate@gmail.com>
Tue, 10 Sep 2024 06:39:16 +0000 (15:39 +0900)
committerStephen Seo <seo.disparate@gmail.com>
Tue, 10 Sep 2024 06:39:16 +0000 (15:39 +0900)
src/constants.h
src/main.c

index b8f19c8e6d585958ed2ce2add824064d40553e3b..f688fc71df2cd96512fff4ffc38909cf2cd359c6 100644 (file)
@@ -18,6 +18,7 @@
 #define SEODISPARATE_COM_C_SIMPLE_HTTP_CONSTANTS_H_
 
 #define C_SIMPLE_HTTP_SLEEP_NANOS 1000000
+#define C_SIMPLE_HTTP_TRY_CONFIG_RELOAD_NANOS 4000000000
 #define C_SIMPLE_HTTP_RECV_BUF_SIZE 1024
 #define C_SIMPLE_HTTP_CONFIG_BUF_SIZE 1024
 #define C_SIMPLE_HTTP_QUOTE_COUNT_MAX 3
index b43134434781c20e51ade07f71663e75b1920b9d..43624e8fdbf4e5e315eb224c30845e3ec5793ba8 100644 (file)
@@ -162,9 +162,9 @@ int main(int argc, char **argv) {
 
   // xxxx xxx1 - config needs to be reloaded.
   unsigned int flags = 0;
-  const unsigned int config_try_reload_ticks =
-    4000000000 / C_SIMPLE_HTTP_SLEEP_NANOS;
-  unsigned int config_try_reload_ticks_count = 0;
+  const size_t config_try_reload_ticks =
+    C_SIMPLE_HTTP_TRY_CONFIG_RELOAD_NANOS / C_SIMPLE_HTTP_SLEEP_NANOS;
+  size_t config_try_reload_ticks_count = 0;
   unsigned int config_try_reload_attempts = 0;
 
   while (C_SIMPLE_HTTP_KEEP_RUNNING) {