From 5ccbbe40c2257a24b758008b83de8c5ac018ed28 Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Fri, 13 Oct 2006 21:02:27 +0000 Subject: The tagging of application/x-www-form-urlencoded POST body data sent to the CURLOPT_DEBUGFUNCTION callback has been fixed (it was erroneously included as part of the header). A message was also added to the command line tool to show when data is being sent, enabled when --verbose is used. --- src/main.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'src') 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; } -- cgit v1.2.3