aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/main.c b/src/main.c
index 0798364fb..af3f4355f 100644
--- a/src/main.c
+++ b/src/main.c
@@ -2986,11 +2986,12 @@ int my_trace(CURL *handle, curl_infotype type,
* own.
*/
static const char * const s_infotype[] = {
- "*", "<", ">"
+ "*", "<", ">", "{", "}", "{", "}"
};
size_t i;
size_t st=0;
static bool newl = FALSE;
+ static bool traced_data = FALSE;
switch(type) {
case CURLINFO_HEADER_OUT:
@@ -3008,20 +3009,35 @@ int my_trace(CURL *handle, curl_infotype type,
if(!newl)
fprintf(config->trace_stream, "%s%s ", timebuf, s_infotype[type]);
fwrite(data+st, i-st+1, 1, config->trace_stream);
+ newl = (bool)(size && (data[size-1] != '\n'));
+ traced_data = FALSE;
break;
case CURLINFO_TEXT:
case CURLINFO_HEADER_IN:
if(!newl)
fprintf(config->trace_stream, "%s%s ", timebuf, s_infotype[type]);
fwrite(data, size, 1, config->trace_stream);
+ newl = (bool)(size && (data[size-1] != '\n'));
+ traced_data = FALSE;
+ break;
+ case CURLINFO_DATA_OUT:
+ case CURLINFO_DATA_IN:
+ case CURLINFO_SSL_DATA_IN:
+ case CURLINFO_SSL_DATA_OUT:
+ if(!traced_data) {
+ if(!newl)
+ fprintf(config->trace_stream, "%s%s ", timebuf, s_infotype[type]);
+ fprintf(config->trace_stream, "[data not shown]\n");
+ newl = FALSE;
+ traced_data = TRUE;
+ }
break;
default: /* nada */
newl = FALSE;
+ traced_data = FALSE;
break;
}
- newl = (bool)(size && (data[size-1] != '\n'));
-
return 0;
}