Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FTP Bug: Curl sends "CWD /" despite CURLFTPMETHOD_NOCWD #1718

Closed
PeterLamare opened this issue Aug 1, 2017 · 1 comment
Closed

FTP Bug: Curl sends "CWD /" despite CURLFTPMETHOD_NOCWD #1718

PeterLamare opened this issue Aug 1, 2017 · 1 comment
Labels

Comments

@PeterLamare
Copy link

Reproduce:
Set CURLFTPMETHOD_NOCWD and access different URLs reusing the same easy handle.

Consequence:
Killing the performance gain of reusing an easy handle by needless CWD round trips.

Fix:
The bug seems to be in src/lib/ftp.c ftp_parse_url_path():
it compares "ftpc->prevpath" with "data->state.path", and sets "ftpc->cwddone = TRUE" if equal.
This is obviously incorrect for CURLFTPMETHOD_NOCWD where the working directory is not set to state.path, instead it should compare "ftpc->prevpath" against ""

-Lama

@bagder
Copy link
Member

bagder commented Aug 1, 2017

I think the condition needs an exception for CURLFTPMETHOD_NOCWD, so that the code also handles the case when the method is actually changed between two requests.

bagder added a commit that referenced this issue Aug 3, 2017
... when reusing a connection. If it didn't do any CWD previously.

Fixes #1718
bagder added a commit that referenced this issue Aug 3, 2017
... by doing two transfers in nocwd mode and check that there's no
superfluous CWD command.
@bagder bagder mentioned this issue Aug 3, 2017
@bagder bagder removed the help wanted label Aug 3, 2017
bagder added a commit that referenced this issue Aug 4, 2017
... when reusing a connection. If it didn't do any CWD previously.

Fixes #1718
bagder added a commit that referenced this issue Aug 4, 2017
... by doing two transfers in nocwd mode and check that there's no
superfluous CWD command.
@lock lock bot locked as resolved and limited conversation to collaborators May 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

2 participants