| 578 | } |
| 579 | |
| 580 | void http_hdr_fprint(ACL_VSTREAM *fp, const HTTP_HDR *hh, const char *msg) |
| 581 | { |
| 582 | HTTP_HDR_ENTRY *entry; |
| 583 | int n, i; |
| 584 | |
| 585 | if (fp == NULL || hh == NULL) { |
| 586 | acl_msg_error("%s(%d): input invalid", __FUNCTION__, __LINE__); |
| 587 | return; |
| 588 | } |
| 589 | |
| 590 | n = acl_array_size(hh->entry_lnk); |
| 591 | if (n <= 0) { |
| 592 | acl_msg_info("%s, %s(%d): array empty", |
| 593 | __FUNCTION__, __FILE__, __LINE__); |
| 594 | return; |
| 595 | } |
| 596 | |
| 597 | if (msg && *msg) |
| 598 | acl_vstream_fprintf(fp, "---------- in %s - (%s) -------\r\n", |
| 599 | __FUNCTION__, msg); |
| 600 | entry = (HTTP_HDR_ENTRY *) acl_array_index(hh->entry_lnk, 0); |
| 601 | if (entry) |
| 602 | acl_vstream_fprintf(fp, "%s %s\r\n", entry->name, entry->value); |
| 603 | for (i = 1; i < n; i++) { |
| 604 | entry = (HTTP_HDR_ENTRY *) acl_array_index(hh->entry_lnk, i); |
| 605 | if (entry == NULL) |
| 606 | break; |
| 607 | if (entry->off == 0) |
| 608 | acl_vstream_fprintf(fp, "%s: %s\r\n", |
| 609 | entry->name, entry->value); |
| 610 | } |
| 611 | |
| 612 | if (msg && *msg) |
| 613 | acl_vstream_fprintf(fp, "------------ end -------------\r\n"); |
| 614 | } |
| 615 | |
| 616 | void http_hdr_sprint(ACL_VSTRING *bf, const HTTP_HDR *hh, const char *msg) |
| 617 | { |
no test coverage detected
searching dependent graphs…