Minor refactoring
All checks were successful
Run Unit Tests / build-and-run-unit-tests (push) Successful in 39s
All checks were successful
Run Unit Tests / build-and-run-unit-tests (push) Successful in 39s
This commit is contained in:
parent
5303bbe5fd
commit
a56adb171f
2 changed files with 4 additions and 3 deletions
|
@ -19,6 +19,8 @@
|
|||
|
||||
#define C_SIMPLE_HTTP_SLEEP_NANOS 1000000
|
||||
#define C_SIMPLE_HTTP_TRY_CONFIG_RELOAD_NANOS 4000000000
|
||||
#define C_SIMPLE_HTTP_TRY_CONFIG_RELOAD_TICKS \
|
||||
(C_SIMPLE_HTTP_TRY_CONFIG_RELOAD_NANOS / C_SIMPLE_HTTP_SLEEP_NANOS)
|
||||
#define C_SIMPLE_HTTP_RECV_BUF_SIZE 1024
|
||||
#define C_SIMPLE_HTTP_CONFIG_BUF_SIZE 1024
|
||||
#define C_SIMPLE_HTTP_QUOTE_COUNT_MAX 3
|
||||
|
|
|
@ -162,8 +162,6 @@ int main(int argc, char **argv) {
|
|||
|
||||
// xxxx xxx1 - config needs to be reloaded.
|
||||
unsigned int flags = 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;
|
||||
|
||||
|
@ -171,7 +169,8 @@ int main(int argc, char **argv) {
|
|||
nanosleep(&sleep_time, NULL);
|
||||
if ((flags & 0x1) != 0) {
|
||||
++config_try_reload_ticks_count;
|
||||
if (config_try_reload_ticks_count >= config_try_reload_ticks) {
|
||||
if (config_try_reload_ticks_count
|
||||
>= C_SIMPLE_HTTP_TRY_CONFIG_RELOAD_TICKS) {
|
||||
config_try_reload_ticks_count = 0;
|
||||
++config_try_reload_attempts;
|
||||
fprintf(
|
||||
|
|
Loading…
Reference in a new issue