| 408 | }; |
| 409 | |
| 410 | static bool host_http_stop_join_free(host_state_t *host) { |
| 411 | const host_http_ops_t *ops = host->http_ops; |
| 412 | if (host->http && host->http_started) { |
| 413 | ops->server_stop(ops->context, host->http); |
| 414 | } |
| 415 | if (host->http_started) { |
| 416 | if (ops->thread_join(ops->context, &host->http_thread) != 0) { |
| 417 | return false; |
| 418 | } |
| 419 | host->http_started = false; |
| 420 | } |
| 421 | if (!ops->server_free(ops->context, host->http)) { |
| 422 | return false; |
| 423 | } |
| 424 | host->http = NULL; |
| 425 | return true; |
| 426 | } |
| 427 | |
| 428 | static uint64_t host_deadline_from(uint64_t now_ms, uint32_t delay_ms) { |
| 429 | return now_ms > UINT64_MAX - delay_ms ? UINT64_MAX : now_ms + delay_ms; |
no outgoing calls
no test coverage detected