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