When sending info about which host that sends what, include proper direction
to/from, based on a suggestion from Alexander Krasnostavsky
This commit is contained in:
Родитель
d620f1e529
Коммит
4c58797607
24
lib/sendf.c
24
lib/sendf.c
|
@ -469,10 +469,26 @@ int Curl_debug(struct SessionHandle *data, curl_infotype type,
|
||||||
int rc;
|
int rc;
|
||||||
if(data->set.printhost && host) {
|
if(data->set.printhost && host) {
|
||||||
char buffer[160];
|
char buffer[160];
|
||||||
snprintf(buffer, sizeof(buffer), "[Chunk to/from %s]", host);
|
char *t=NULL;
|
||||||
rc = showit(data, CURLINFO_TEXT, buffer, strlen(buffer));
|
switch (type) {
|
||||||
if(rc)
|
case CURLINFO_HEADER_IN:
|
||||||
return rc;
|
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);
|
rc = showit(data, type, ptr, size);
|
||||||
return rc;
|
return rc;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче