| 370 | } |
| 371 | |
| 372 | static bool frontend_write_response(FILE *out, const uint8_t *response, uint32_t response_length, |
| 373 | bool content_length_framed) { |
| 374 | bool written = false; |
| 375 | if (content_length_framed) { |
| 376 | written = fprintf(out, "Content-Length: %u\r\n\r\n", response_length) >= 0 && |
| 377 | fwrite(response, 1, response_length, out) == response_length; |
| 378 | } else { |
| 379 | written = |
| 380 | fwrite(response, 1, response_length, out) == response_length && fputc('\n', out) != EOF; |
| 381 | } |
| 382 | return fflush(out) == 0 && written; |
| 383 | } |
| 384 | |
| 385 | const char *cbm_daemon_frontend_cancelled_error_message(const char *request_message) { |
| 386 | static const char plain[] = "Request cancelled"; |
no test coverage detected