summaryrefslogtreecommitdiff
path: root/lib/sendf.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2005-01-21 09:32:32 +0000
committerDaniel Stenberg <daniel@haxx.se>2005-01-21 09:32:32 +0000
commit7e42cb61f75890832792c082510ec610f4c32cbe (patch)
tree3c73a5796491a7ad59dfa1d2e151141d02e276ad /lib/sendf.c
parent6c038680f9a0de30f2a0b60c1e02bfb74006c851 (diff)
downloadcurl-7e42cb61f75890832792c082510ec610f4c32cbe.tar.gz
FTP third transfer support overhaul. See CHANGES for details.
Diffstat (limited to 'lib/sendf.c')
-rw-r--r--lib/sendf.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/sendf.c b/lib/sendf.c
index 4094c3239..95a88a27c 100644
--- a/lib/sendf.c
+++ b/lib/sendf.c
@@ -204,8 +204,7 @@ CURLcode Curl_sendf(curl_socket_t sockfd, struct connectdata *conn,
break;
if(data->set.verbose)
- Curl_debug(data, CURLINFO_DATA_OUT, sptr, bytes_written,
- conn->host.dispname);
+ Curl_debug(data, CURLINFO_DATA_OUT, sptr, bytes_written, conn);
if((size_t)bytes_written != write_len) {
/* if not all was written at once, we must advance the pointer, decrease
@@ -468,18 +467,22 @@ static int showit(struct SessionHandle *data, curl_infotype type,
}
int Curl_debug(struct SessionHandle *data, curl_infotype type,
- char *ptr, size_t size, char *host)
+ char *ptr, size_t size,
+ struct connectdata *conn)
{
int rc;
- if(data->set.printhost && host) {
+ if(data->set.printhost && conn && conn->host.dispname) {
char buffer[160];
const char *t=NULL;
+ const char *w="Data";
switch (type) {
case CURLINFO_HEADER_IN:
+ w = "Header";
case CURLINFO_DATA_IN:
t = "from";
break;
case CURLINFO_HEADER_OUT:
+ w = "Header";
case CURLINFO_DATA_OUT:
t = "to";
break;
@@ -488,7 +491,10 @@ int Curl_debug(struct SessionHandle *data, curl_infotype type,
}
if(t) {
- snprintf(buffer, sizeof(buffer), "[Data %s %s]", t, host);
+ snprintf(buffer, sizeof(buffer), "[%s %s %s%s]", w, t,
+ conn->xfertype==NORMAL?"":
+ (conn->xfertype==SOURCE3RD?"source ":"target "),
+ conn->host.dispname);
rc = showit(data, CURLINFO_TEXT, buffer, strlen(buffer));
if(rc)
return rc;