| 404 | } |
| 405 | |
| 406 | void cbm_httpd_conn_close(cbm_http_conn_t *c) { |
| 407 | if (!c) |
| 408 | return; |
| 409 | cbm_httpd_t *owner = c->owner; |
| 410 | if (owner) { |
| 411 | cbm_mutex_lock(&owner->active_mutex); |
| 412 | if (owner->active == c) |
| 413 | owner->active = NULL; |
| 414 | cbm_sock_close(c->fd); |
| 415 | cbm_mutex_unlock(&owner->active_mutex); |
| 416 | } else { |
| 417 | cbm_sock_close(c->fd); |
| 418 | } |
| 419 | free(c); |
| 420 | } |
| 421 | |
| 422 | int cbm_http_conn_status(const cbm_http_conn_t *c) { |
| 423 | return c ? c->response_status : 0; |