aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2004-06-07 07:01:29 +0000
committerDaniel Stenberg <daniel@haxx.se>2004-06-07 07:01:29 +0000
commit4c587976079feab63c1ecf55c6e13c689d5cbaa1 (patch)
tree132b8c5e78382a8c37ac011fe1145ad35c8a33c3
parentd620f1e529134196c87e40bb8d2729fa35eeb07b (diff)
When sending info about which host that sends what, include proper direction
to/from, based on a suggestion from Alexander Krasnostavsky
-rw-r--r--lib/sendf.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/lib/sendf.c b/lib/sendf.c
index 275581f56..f6d2374af 100644
--- a/lib/sendf.c
+++ b/lib/sendf.c
@@ -469,10 +469,26 @@ int Curl_debug(struct SessionHandle *data, curl_infotype type,
int rc;
if(data->set.printhost && host) {
char buffer[160];
- snprintf(buffer, sizeof(buffer), "[Chunk to/from %s]", host);
- rc = showit(data, CURLINFO_TEXT, buffer, strlen(buffer));
- if(rc)
- return rc;
+ char *t=NULL;
+ switch (type) {
+ case CURLINFO_HEADER_IN:
+ case CURLINFO_DATA_IN:
+ t = "from";
+ break;
+ case CURLINFO_HEADER_OUT:
+ case CURLINFO_DATA_OUT:
+ t = "to";
+ break;
+ default:
+ break;
+ }
+
+ if(t) {
+ snprintf(buffer, sizeof(buffer), "[Data %s %s]", t, host);
+ rc = showit(data, CURLINFO_TEXT, buffer, strlen(buffer));
+ if(rc)
+ return rc;
+ }
}
rc = showit(data, type, ptr, size);
return rc;