aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDan Fandrich <dan@coneharvesters.com>2006-10-13 21:02:27 +0000
committerDan Fandrich <dan@coneharvesters.com>2006-10-13 21:02:27 +0000
commit5ccbbe40c2257a24b758008b83de8c5ac018ed28 (patch)
treef2fecb776d5c5473e97a33f4c1e55fbeb1b9c623 /src
parent86f93a53d6a18827668784b98d4fc6824bbaa417 (diff)
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.
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;
}