aboutsummaryrefslogtreecommitdiff
path: root/lib/ftp.c
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2013-02-12 18:08:48 +0000
committerSteve Holme <steve_holme@hotmail.com>2013-02-12 18:08:48 +0000
commitb56c9eb48e3cad89d35963f0934571bf5de48ab2 (patch)
tree18f562555fbb0892ce15b25d293ea1edef9a0c95 /lib/ftp.c
parent586f5d36147478d58ea6204bfe8368364663d926 (diff)
pingpong: Optimised the endofresp() function
Reworked the pp->endofresp() function so that the conndata, line and line length are passed down to it just as with Curl_client_write() rather than each implementation of the function having to query these values. Additionally changed the int return type to bool as this is more representative of the function's usage.
Diffstat (limited to 'lib/ftp.c')
-rw-r--r--lib/ftp.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/ftp.c b/lib/ftp.c
index 469b88749..228d834a2 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -598,17 +598,17 @@ static CURLcode AllowServerConnect(struct connectdata *conn, bool *connected)
/* macro to check for the last line in an FTP server response */
#define LASTLINE(line) (STATUSCODE(line) && (' ' == line[3]))
-static int ftp_endofresp(struct pingpong *pp,
- int *code)
+static bool ftp_endofresp(struct connectdata *conn, char *line, size_t len,
+ int *code)
{
- char *line = pp->linestart_resp;
- size_t len = pp->nread_resp;
+ (void)conn;
if((len > 3) && LASTLINE(line)) {
*code = curlx_sltosi(strtol(line, NULL, 10));
- return 1;
+ return TRUE;
}
- return 0;
+
+ return FALSE;
}
static CURLcode ftp_readresp(curl_socket_t sockfd,