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

Function curl_trace

http.c:999–1047  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

997}
998
999static int curl_trace(CURL *handle UNUSED, curl_infotype type,
1000 char *data, size_t size,
1001 void *userp UNUSED)
1002{
1003 const char *text;
1004 enum { NO_FILTER = 0, DO_FILTER = 1 };
1005
1006 switch (type) {
1007 case CURLINFO_TEXT:
1008 curl_dump_info(data, size);
1009 break;
1010 case CURLINFO_HEADER_OUT:
1011 text = "=> Send header";
1012 curl_dump_header(text, (unsigned char *)data, size, DO_FILTER);
1013 break;
1014 case CURLINFO_DATA_OUT:
1015 if (trace_curl_data) {
1016 text = "=> Send data";
1017 curl_dump_data(text, (unsigned char *)data, size);
1018 }
1019 break;
1020 case CURLINFO_SSL_DATA_OUT:
1021 if (trace_curl_data) {
1022 text = "=> Send SSL data";
1023 curl_dump_data(text, (unsigned char *)data, size);
1024 }
1025 break;
1026 case CURLINFO_HEADER_IN:
1027 text = "<= Recv header";
1028 curl_dump_header(text, (unsigned char *)data, size, NO_FILTER);
1029 break;
1030 case CURLINFO_DATA_IN:
1031 if (trace_curl_data) {
1032 text = "<= Recv data";
1033 curl_dump_data(text, (unsigned char *)data, size);
1034 }
1035 break;
1036 case CURLINFO_SSL_DATA_IN:
1037 if (trace_curl_data) {
1038 text = "<= Recv SSL data";
1039 curl_dump_data(text, (unsigned char *)data, size);
1040 }
1041 break;
1042
1043 default: /* we ignore unknown types by default */
1044 return 0;
1045 }
1046 return 0;
1047}
1048
1049void http_trace_curl_no_data(void)
1050{

Callers

nothing calls this directly

Calls 3

curl_dump_infoFunction · 0.85
curl_dump_headerFunction · 0.85
curl_dump_dataFunction · 0.85

Tested by

no test coverage detected