MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / cbm_httpd_close

Function cbm_httpd_close

src/ui/httpd.c:298–313  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

296}
297
298bool cbm_httpd_close(cbm_httpd_t *d) {
299 if (!d)
300 return true;
301 cbm_mutex_lock(&d->active_mutex);
302 d->interrupted = true;
303 if (d->active) {
304 socket_shutdown(d->active->fd);
305 cbm_mutex_unlock(&d->active_mutex);
306 return false;
307 }
308 cbm_mutex_unlock(&d->active_mutex);
309 cbm_sock_close(d->fd);
310 cbm_mutex_destroy(&d->active_mutex);
311 free(d);
312 return true;
313}
314
315void cbm_httpd_set_send_deadline_for_test(cbm_httpd_t *d, int ms) {
316 /* Lets a test pin the send deadline far above (or below) the default so

Callers 2

cbm_http_server_freeFunction · 0.85
test_httpd.cFile · 0.85

Calls 4

cbm_mutex_lockFunction · 0.85
socket_shutdownFunction · 0.85
cbm_mutex_unlockFunction · 0.85
cbm_mutex_destroyFunction · 0.85

Tested by

no test coverage detected