| 957 | } |
| 958 | |
| 959 | static 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 | |
| 987 | static void curl_dump_info(char *data, size_t size) |
| 988 | { |
no test coverage detected