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

Function curl_dump_data

http.c:959–985  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

957}
958
959static void curl_dump_data(const char *text, unsigned char *ptr, size_t size)
960{
961 size_t i;
962 struct strbuf out = STRBUF_INIT;
963 unsigned int width = 60;
964
965 strbuf_addf(&out, "%s, %10.10ld bytes (0x%8.8lx)\n",
966 text, (long)size, (long)size);
967 trace_strbuf(&trace_curl, &out);
968
969 for (i = 0; i < size; i += width) {
970 size_t w;
971
972 strbuf_reset(&out);
973 strbuf_addf(&out, "%s: ", text);
974 for (w = 0; (w < width) && (i + w < size); w++) {
975 unsigned char ch = ptr[i + w];
976
977 strbuf_addch(&out,
978 (ch >= 0x20) && (ch < 0x80)
979 ? ch : '.');
980 }
981 strbuf_addch(&out, '\n');
982 trace_strbuf(&trace_curl, &out);
983 }
984 strbuf_release(&out);
985}
986
987static void curl_dump_info(char *data, size_t size)
988{

Callers 1

curl_traceFunction · 0.85

Calls 3

strbuf_addfFunction · 0.85
strbuf_addchFunction · 0.85
strbuf_releaseFunction · 0.85

Tested by

no test coverage detected