aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSterling Hughes <sterling@bumblebury.com>2001-08-15 06:58:56 +0000
committerSterling Hughes <sterling@bumblebury.com>2001-08-15 06:58:56 +0000
commit09a9b57bae8ce887d5398efe891d38a7cb20cc0f (patch)
tree61c734551e00555ead3c141e19cc1fb0cbd33e8b
parent10ab0821887f1e82e6ffbca0ba82c1619d3684bb (diff)
This can be used in another place (Curl_ftp_done :)...
declare at the top of the file, put the private functions at the bottom of the file, however, this is clearer imho (since _ftp is already there).
-rw-r--r--lib/ftp.c24
1 files changed, 5 insertions, 19 deletions
diff --git a/lib/ftp.c b/lib/ftp.c
index 2537ed789..5938a8955 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -91,6 +91,9 @@
#include "memdebug.h"
#endif
+/* Used in more than one place in the file */
+static CURLcode _ftp_sendquote(struct connectdata *conn, struct curl_slist *quote);
+
/* easy-to-use macro: */
#define ftpsendf Curl_ftpsendf
@@ -575,25 +578,8 @@ CURLcode Curl_ftp_done(struct connectdata *conn)
/* Send any post-transfer QUOTE strings? */
if(data->postquote) {
- qitem = data->postquote;
- /* Send all QUOTE strings in same order as on command-line */
- while (qitem) {
- /* Send string */
- if (qitem->data) {
- ftpsendf(conn->firstsocket, conn, "%s", qitem->data);
-
- nread = Curl_GetFTPResponse(conn->firstsocket, buf, conn, &ftpcode);
- if(nread < 0)
- return CURLE_OPERATION_TIMEOUTED;
-
- if (ftpcode >= 400) {
- failf(data, "QUOT string not accepted: %s",
- qitem->data);
- return CURLE_FTP_QUOTE_ERROR;
- }
- }
- qitem = qitem->next;
- }
+ CURLcode result = _ftp_sendquote(conn, data->postquote);
+ return result;
}
return CURLE_OK;