MCPcopy Index your code
hub / github.com/git/git / curl_dump_header

Function curl_dump_header

http.c:934–957  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

932}
933
934static void curl_dump_header(const char *text, unsigned char *ptr, size_t size, int hide_sensitive_header)
935{
936 struct strbuf out = STRBUF_INIT;
937 struct strbuf **headers, **header;
938
939 strbuf_addf(&out, "%s, %10.10ld bytes (0x%8.8lx)\n",
940 text, (long)size, (long)size);
941 trace_strbuf(&trace_curl, &out);
942 strbuf_reset(&out);
943 strbuf_add(&out, ptr, size);
944 headers = strbuf_split_max(&out, '\n', 0);
945
946 for (header = headers; *header; header++) {
947 if (hide_sensitive_header)
948 redact_sensitive_header(*header, 0);
949 strbuf_insertstr((*header), 0, text);
950 strbuf_insertstr((*header), strlen(text), ": ");
951 strbuf_rtrim((*header));
952 strbuf_addch((*header), '\n');
953 trace_strbuf(&trace_curl, (*header));
954 }
955 strbuf_list_free(headers);
956 strbuf_release(&out);
957}
958
959static void curl_dump_data(const char *text, unsigned char *ptr, size_t size)
960{

Callers 1

curl_traceFunction · 0.85

Calls 9

strbuf_addfFunction · 0.85
strbuf_addFunction · 0.85
strbuf_split_maxFunction · 0.85
redact_sensitive_headerFunction · 0.85
strbuf_insertstrFunction · 0.85
strbuf_rtrimFunction · 0.85
strbuf_addchFunction · 0.85
strbuf_list_freeFunction · 0.85
strbuf_releaseFunction · 0.85

Tested by

no test coverage detected