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

Function http_hdr_fprint

lib_protocol/src/http/http_hdr.c:580–614  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

578}
579
580void 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
616void http_hdr_sprint(ACL_VSTRING *bf, const HTTP_HDR *hh, const char *msg)
617{

Callers 3

fprint_headerMethod · 0.85
get_urlFunction · 0.85
get_header_readyFunction · 0.85

Calls 5

acl_msg_errorFunction · 0.85
acl_array_sizeFunction · 0.85
acl_msg_infoFunction · 0.85
acl_vstream_fprintfFunction · 0.85
acl_array_indexFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…