summaryrefslogtreecommitdiff
path: root/lib/sendf.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2022-06-01 14:30:55 +0200
committerDaniel Stenberg <daniel@haxx.se>2022-06-01 14:31:49 +0200
commit45de940cebf6ac897674018c460c1e73e7e082ad (patch)
treed269995d65e01d959dd9f2f4227eb64e17988b21 /lib/sendf.c
parentbb130871c0878dbae97128655103b5944505af92 (diff)
downloadcurl-45de940cebf6ac897674018c460c1e73e7e082ad.tar.gz
lib: make more protocol specific struct fields #ifdefed
... so that they don't take up space if the protocols are disabled in the build. Closes #8944
Diffstat (limited to 'lib/sendf.c')
-rw-r--r--lib/sendf.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/lib/sendf.c b/lib/sendf.c
index d7d4d8abd..fd851f153 100644
--- a/lib/sendf.c
+++ b/lib/sendf.c
@@ -52,7 +52,7 @@
#include "curl_memory.h"
#include "memdebug.h"
-#ifdef CURL_DO_LINEEND_CONV
+#if defined(CURL_DO_LINEEND_CONV) && !defined(CURL_DISABLE_FTP)
/*
* convert_lineends() changes CRLF (\r\n) end-of-line markers to a single LF
* (\n), with special processing for CRLF sequences that are split between two
@@ -132,7 +132,7 @@ static size_t convert_lineends(struct Curl_easy *data,
}
return size;
}
-#endif /* CURL_DO_LINEEND_CONV */
+#endif /* CURL_DO_LINEEND_CONV && !CURL_DISABLE_FTP */
#ifdef USE_RECV_BEFORE_SEND_WORKAROUND
bool Curl_recv_has_postponed_data(struct connectdata *conn, int sockindex)
@@ -631,22 +631,15 @@ CURLcode Curl_client_write(struct Curl_easy *data,
char *ptr,
size_t len)
{
- struct connectdata *conn = data->conn;
-
- if(!len)
- return CURLE_OK;
-
+#if !defined(CURL_DISABLE_FTP) && defined(CURL_DO_LINEEND_CONV)
/* FTP data may need conversion. */
if((type & CLIENTWRITE_BODY) &&
- (conn->handler->protocol & PROTO_FAMILY_FTP) &&
- conn->proto.ftpc.transfertype == 'A') {
-
-#ifdef CURL_DO_LINEEND_CONV
+ (data->conn->handler->protocol & PROTO_FAMILY_FTP) &&
+ data->conn->proto.ftpc.transfertype == 'A') {
/* convert end-of-line markers */
len = convert_lineends(data, ptr, len);
-#endif /* CURL_DO_LINEEND_CONV */
}
-
+#endif
return chop_write(data, type, ptr, len);
}