summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSterling Hughes <sterling@bumblebury.com>2001-08-15 07:21:21 +0000
committerSterling Hughes <sterling@bumblebury.com>2001-08-15 07:21:21 +0000
commit7d17713d62b5ca5d88b90c76eff9c4446da6d7b3 (patch)
tree1a1161d84b235748ed30925256c0e4d10f598116
parent546f4dca52cf9689a19dc916a13492e77f8ab436 (diff)
downloadgnurl-7d17713d62b5ca5d88b90c76eff9c4446da6d7b3.tar.gz
gnurl-7d17713d62b5ca5d88b90c76eff9c4446da6d7b3.tar.bz2
gnurl-7d17713d62b5ca5d88b90c76eff9c4446da6d7b3.zip
more _ftp_cwd
-rw-r--r--lib/ftp.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/lib/ftp.c b/lib/ftp.c
index 4c1ba71bc..7afc53e9e 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -632,6 +632,8 @@ CURLcode _ftp_cwd(struct connectdata *conn, char *path)
failf(conn->data, "Couldn't change back to directory %s", path);
return CURLE_FTP_ACCESS_DENIED;
}
+
+ return CURLE_OK;
}
static
@@ -667,9 +669,9 @@ CURLcode _ftp(struct connectdata *conn)
return result;
}
- /* This is a re-used connection. Since we change directory to where the
- transfer is taking place, we must now get back to the original dir
- where we ended up after login: */
+ /* This is a re-used connection. Since we change directory to where the
+ transfer is taking place, we must now get back to the original dir
+ where we ended up after login: */
if (conn->bits.reuse) {
if ((result = _ftp_cwd(conn, ftp->entrypath)) != CURLE_OK)
return result;
@@ -678,15 +680,8 @@ CURLcode _ftp(struct connectdata *conn)
/* change directory first! */
if(ftp->dir && ftp->dir[0]) {
- ftpsendf(conn->firstsocket, conn, "CWD %s", ftp->dir);
- nread = Curl_GetFTPResponse(conn->firstsocket, buf, conn, &ftpcode);
- if(nread < 0)
- return CURLE_OPERATION_TIMEOUTED;
-
- if(ftpcode != 250) {
- failf(data, "Couldn't change to directory %s", ftp->dir);
- return CURLE_FTP_ACCESS_DENIED;
- }
+ if ((result = _ftp_cwd(conn, ftp->dir)) != CURLE_OK)
+ return result;
}
if(data->bits.get_filetime && ftp->file) {