Append src JSON-escaped, under http_appendf's clamp contract: once *pos has * reached bufsz nothing more is written. */
| 1785 | /* Append src JSON-escaped, under http_appendf's clamp contract: once *pos has |
| 1786 | * reached bufsz nothing more is written. */ |
| 1787 | static void http_append_json_escaped(char *buf, size_t bufsz, int *pos, const char *src) { |
| 1788 | if (*pos < 0) { |
| 1789 | return; |
| 1790 | } |
| 1791 | if ((size_t)*pos >= bufsz) { |
| 1792 | *pos = (int)bufsz; |
| 1793 | return; |
| 1794 | } |
| 1795 | *pos += cbm_json_escape(buf + *pos, (int)(bufsz - (size_t)*pos), src); |
| 1796 | } |
| 1797 | |
| 1798 | /* GET /api/index-status — returns status of all index jobs */ |
| 1799 | static void handle_index_status(cbm_http_server_t *server, cbm_http_conn_t *c) { |
no test coverage detected