MCPcopy Create free account
hub / github.com/acl-dev/acl / mime_content_disposition

Function mime_content_disposition

lib_acl_cpp/src/mime/internal/mime_state_parse.cpp:259–289  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

257}
258
259static void mime_content_disposition(MIME_NODE *node,
260 const HEADER_OPTS *header_info)
261{
262 const char *cp = STR(node->buffer) + strlen(header_info->name) + 1;
263 ssize_t tok_count;
264
265#define PARSE_CONTENT_DISPOSITION(state, ptr) \
266 header_token(state->token, MIME_MAX_TOKEN, \
267 state->token_buffer, ptr, RFC2045_TSPECIALS, ';')
268
269 while (1) {
270 tok_count = PARSE_CONTENT_DISPOSITION(node->state, &cp);
271 if (tok_count <= 0)
272 break;
273
274 if (tok_count < 3 || node->state->token[1].type != '=')
275 continue;
276
277 if (TOKEN_MATCH(node->state->token[0], "filename")
278 && node->header_filename == NULL)
279 {
280 node->header_filename =
281 acl_mystrdup(node->state->token[2].u.value);
282 } else if (TOKEN_MATCH(node->state->token[0], "name")
283 && node->header_name == NULL)
284 {
285 node->header_name =
286 acl_mystrdup(node->state->token[2].u.value);
287 }
288 }
289}
290
291/* mime_state_downgrade - convert 8-bit data to quoted-printable */
292

Callers 1

mime_header_lineFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…