aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/curl/lib/sendf.c
diff options
context:
space:
mode:
authorrobot-contrib <robot-contrib@yandex-team.com>2022-07-12 12:03:53 +0300
committerrobot-contrib <robot-contrib@yandex-team.com>2022-07-12 12:03:53 +0300
commiteeebfbedb3ea4cab5c0aac178b683b7dd26b0bf6 (patch)
tree4783d362be8e22467d0f5eb581ce6f65e33acb04 /contrib/libs/curl/lib/sendf.c
parent4213b519b93b5e3d657bc362837adfea82579dcc (diff)
downloadydb-eeebfbedb3ea4cab5c0aac178b683b7dd26b0bf6.tar.gz
Update contrib/libs/curl to 7.84.0
Diffstat (limited to 'contrib/libs/curl/lib/sendf.c')
-rw-r--r--contrib/libs/curl/lib/sendf.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/contrib/libs/curl/lib/sendf.c b/contrib/libs/curl/lib/sendf.c
index d7d4d8abd4..a210284579 100644
--- a/contrib/libs/curl/lib/sendf.c
+++ b/contrib/libs/curl/lib/sendf.c
@@ -18,6 +18,8 @@
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
+ * SPDX-License-Identifier: curl
+ *
***************************************************************************/
#include "curl_setup.h"
@@ -52,7 +54,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 +134,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 +633,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);
}