* Append header to hdr_mask elemnt */
| 553 | * Append header to hdr_mask elemnt |
| 554 | */ |
| 555 | static int append_hf2lst(struct hdr_field** lst, struct hdr_field* hf, |
| 556 | int* msg_total_len) |
| 557 | { |
| 558 | struct hdr_field* temp = *lst; |
| 559 | |
| 560 | if (hf->type != HDR_OTHER_T) { |
| 561 | while (temp->sibling) |
| 562 | temp = temp->sibling; |
| 563 | temp->sibling = hf; |
| 564 | *msg_total_len += hf->body.len + ATTR_DELIM_LEN; |
| 565 | } else { |
| 566 | /* OTHER hdr type */ |
| 567 | while (temp) { |
| 568 | /* Header already exists */ |
| 569 | if (!strncasecmp(temp->name.s, hf->name.s, |
| 570 | temp->name.len)) { |
| 571 | while (temp->sibling) |
| 572 | temp = temp->sibling; |
| 573 | |
| 574 | temp->sibling = hf; |
| 575 | *msg_total_len += hf->body.len + ATTR_DELIM_LEN; |
| 576 | return 0; |
| 577 | } |
| 578 | |
| 579 | if (!temp->next) |
| 580 | break; |
| 581 | |
| 582 | temp = temp->next; |
| 583 | } |
| 584 | |
| 585 | /* First occurence of this header */ |
| 586 | temp->next = hf; |
| 587 | *msg_total_len += hf->name.len + DELIM_LEN; |
| 588 | *msg_total_len += hf->body.len + CRLF_LEN; |
| 589 | } |
| 590 | |
| 591 | return 0; |
| 592 | } |
| 593 | |
| 594 | static mc_whitelist_p mc_dup_whitelist(mc_whitelist_p src) |
| 595 | { |