gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnurl] 13/222: FTP: skip CWD to entry dir when target is absolute


From: gnunet
Subject: [gnurl] 13/222: FTP: skip CWD to entry dir when target is absolute
Date: Thu, 07 Nov 2019 00:08:29 +0100

This is an automated email from the git hooks/post-receive script.

ng0 pushed a commit to branch master
in repository gnurl.

commit acf1d2acd17b194966be41e848ffd48b02ecef0c
Author: Zenju <address@hidden>
AuthorDate: Wed Sep 11 20:04:28 2019 +0200

    FTP: skip CWD to entry dir when target is absolute
    
    Closes #4332
---
 lib/ftp.c           | 4 +++-
 tests/data/test1225 | 1 -
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/ftp.c b/lib/ftp.c
index e807a2acd..0793dc1f3 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -877,7 +877,9 @@ static CURLcode ftp_state_cwd(struct connectdata *conn)
     if((conn->data->set.ftp_filemethod == FTPFILE_NOCWD) && !ftpc->cwdcount)
       /* No CWD necessary */
       result = ftp_state_mdtm(conn);
-    else if(conn->bits.reuse && ftpc->entrypath) {
+    else if(conn->bits.reuse && ftpc->entrypath &&
+            /* no need to go to entrypath when we have an absolute path */
+            !(ftpc->dirdepth && ftpc->dirs[0][0] == '/')) {
       /* This is a re-used connection. Since we change directory to where the
          transfer is taking place, we must first get back to the original dir
          where we ended up after login: */
diff --git a/tests/data/test1225 b/tests/data/test1225
index 2b2519c94..09a1abb79 100644
--- a/tests/data/test1225
+++ b/tests/data/test1225
@@ -45,7 +45,6 @@ TYPE I
 SIZE 1225
 RETR 1225
 CWD /
-CWD /
 CWD foo
 CWD bar
 EPSV

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]