| 417 | } |
| 418 | |
| 419 | static void host_http_schedule_retry(host_state_t *host, uint64_t now_ms, const char *reason) { |
| 420 | uint32_t delay = |
| 421 | host->http_retry_delay_ms ? host->http_retry_delay_ms : HOST_HTTP_RETRY_INITIAL_MS; |
| 422 | host->http_retry_at_ms = host_deadline_from(now_ms, delay); |
| 423 | if (delay > host->http_largest_scheduled_retry_ms) { |
| 424 | host->http_largest_scheduled_retry_ms = delay; |
| 425 | } |
| 426 | host->http_retry_delay_ms = |
| 427 | delay >= HOST_HTTP_RETRY_MAX_MS / 2U ? HOST_HTTP_RETRY_MAX_MS : delay * 2U; |
| 428 | char delay_text[32]; |
| 429 | (void)snprintf(delay_text, sizeof(delay_text), "%u", delay); |
| 430 | cbm_log_warn("ui.retry_scheduled", "reason", reason, "delay_ms", delay_text); |
| 431 | } |
| 432 | |
| 433 | static void host_http_reconcile_at(host_state_t *host, uint64_t now_ms, bool force_config_load) { |
| 434 | if (!host || !host->http_ops) { |
no test coverage detected