| 395 | }; |
| 396 | |
| 397 | static bool host_http_stop_join_free(host_state_t *host) { |
| 398 | const host_http_ops_t *ops = host->http_ops; |
| 399 | if (host->http && host->http_started) { |
| 400 | ops->server_stop(ops->context, host->http); |
| 401 | } |
| 402 | if (host->http_started) { |
| 403 | if (ops->thread_join(ops->context, &host->http_thread) != 0) { |
| 404 | return false; |
| 405 | } |
| 406 | host->http_started = false; |
| 407 | } |
| 408 | if (!ops->server_free(ops->context, host->http)) { |
| 409 | return false; |
| 410 | } |
| 411 | host->http = NULL; |
| 412 | return true; |
| 413 | } |
| 414 | |
| 415 | static uint64_t host_deadline_from(uint64_t now_ms, uint32_t delay_ms) { |
| 416 | return now_ms > UINT64_MAX - delay_ms ? UINT64_MAX : now_ms + delay_ms; |
no outgoing calls
no test coverage detected