Skip to content

Commit

Permalink
When sending info about which host that sends what, include proper di…
Browse files Browse the repository at this point in the history
…rection

to/from, based on a suggestion from Alexander Krasnostavsky
  • Loading branch information
bagder committed Jun 7, 2004
1 parent d620f1e commit 4c58797
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions lib/sendf.c
Expand Up @@ -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;
Expand Down

0 comments on commit 4c58797

Please sign in to comment.