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

Function mime_header_line

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

Source from the content-addressed store, hash-verified

441}
442
443static void mime_header_line(MIME_NODE *node)
444{
445 const HEADER_OPTS *header_info;
446 size_t len = LEN(node->buffer);
447 char *ptr = strrchr(STR(node->buffer), '\n');
448
449 if (ptr) {
450 *ptr-- = 0;
451 len--;
452 if (ptr > STR(node->buffer)) {
453 if (*ptr == '\r') {
454 *ptr = 0;
455 len--;
456 }
457 }
458 if (len == 0)
459 return;
460
461 acl_vstring_truncate(node->buffer, len);
462 }
463
464 header_info = header_opts_find(STR(node->buffer), node->state->key_buffer);
465 if (header_info) {
466 if (header_info->type == HDR_CONTENT_TYPE)
467 mime_content_type(node, header_info);
468 else if (header_info->type == HDR_CONTENT_TRANSFER_ENCODING)
469 mime_content_encoding(node, header_info);
470 else if (node == node->state->root) {
471 /* ˵���ʼ�ͷ */
472
473 if ((header_info->flags & HDR_OPT_RECIP)
474 && (header_info->flags & HDR_OPT_EXTRACT))
475 {
476 /* �����ռ��˵�ַ: To, Cc, Bcc */
477 mail_rcpt(node, header_info);
478 } else if ((header_info->flags & HDR_OPT_SENDER)) {
479 /* ���������˵�ַ: From, Sender,
480 * Replyto, Returnpath
481 */
482 mail_from(node, header_info);
483 } else if ((header_info->flags & HDR_OPT_SUBJECT)) {
484 mail_subject(node, header_info);
485 }
486 } else if (header_info->type == HDR_CONTENT_DISPOSITION) {
487 mime_content_disposition(node, header_info);
488 }
489 }
490
491 if (node->header_list) {
492 HEADER_NV *header = header_split(STR(node->buffer));
493 if (header)
494 node->header_list->push_back(node->header_list, header);
495 }
496
497 ACL_VSTRING_RESET(node->buffer); /* ��ջ����� */
498 node->last_ch = 0;
499 node->last_lf = 0;
500}

Callers 1

mime_state_headFunction · 0.85

Calls 10

acl_vstring_truncateFunction · 0.85
header_opts_findFunction · 0.85
mime_content_typeFunction · 0.85
mime_content_encodingFunction · 0.85
mail_rcptFunction · 0.85
mail_fromFunction · 0.85
mail_subjectFunction · 0.85
mime_content_dispositionFunction · 0.85
header_splitFunction · 0.85
push_backMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…