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

Function copy_header_value

src/ui/httpd.c:239–251  ·  view source on GitHub ↗

Copy a trimmed header value into out. */

Source from the content-addressed store, hash-verified

237
238/* Copy a trimmed header value into out. */
239static void copy_header_value(const char *val, const char *val_end, char *out, size_t outsz) {
240 while (val < val_end && (*val == ' ' || *val == '\t'))
241 val++;
242 while (val_end > val && (val_end[-1] == ' ' || val_end[-1] == '\t'))
243 val_end--;
244 size_t n = (size_t)(val_end - val);
245 if (n >= outsz) {
246 out[0] = '\0'; /* oversize values are ignored, never truncated */
247 return;
248 }
249 memcpy(out, val, n);
250 out[n] = '\0';
251}
252
253int cbm_http_parse_head(const char *data, size_t len, cbm_http_req_t *req, size_t *body_offset,
254 size_t *content_length) {

Callers 1

cbm_http_parse_headFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected