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

Function frontend_write_cancelled_response

src/daemon/frontend.c:401–417  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

399}
400
401static bool frontend_write_cancelled_response(FILE *out, const frontend_item_t *item) {
402 char cancelled_error[512];
403 (void)snprintf(cancelled_error, sizeof(cancelled_error), "{\"code\":-32800,\"message\":\"%s\"}",
404 cbm_daemon_frontend_cancelled_error_message(item->message));
405 cbm_jsonrpc_response_t response = {
406 .id = item->id,
407 .id_str = item->id_str,
408 .error_json = cancelled_error,
409 .error_code = -32800,
410 };
411 char *encoded = cbm_jsonrpc_format_response(&response);
412 bool written =
413 encoded && frontend_write_response(out, (const uint8_t *)encoded, (uint32_t)strlen(encoded),
414 item->content_length_framed);
415 free(encoded);
416 return written;
417}
418
419static bool frontend_parse_cancellation(const char *message, cbm_jsonrpc_request_t *request_out) {
420 if (!message || !request_out) {

Callers 1

frontend_workerFunction · 0.85

Tested by

no test coverage detected