-
Notifications
You must be signed in to change notification settings - Fork 92
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
If my OpenFile returns error, second 'STOR' command in sequence fails #30
Comments
Thank you for submitting this. The server is definitely not behaving correctly. It shouldn't start a data connection if it knows it's unable to write the file. I will fix it |
This first fix seems to do the trick. I'll update it with some tests:
|
Thanks for the super quick response! Referring to the test below: The second and third calls fail. Here's my test
My dirver OpenFile func:
|
Yes I think it was clear enough, basically what happened is that for some crazy reason we were:
When what we should have done is:
In other words, the fix simply tries to open the file before we start the transfer connection: |
Ah, I get you!
…On 22 September 2017 at 10:17, Florent Clairambault < ***@***.***> wrote:
Yes I think it was clear enough,
basically what happened is that for some crazy reason we were:
- Accepting the STOR command with a transfer connection (150)
- Failing to open the file
- Replying with an error message (550) - This is a *second* reply,
which should never happen. Your client has no way to deal with that.
- Closing the transfer connection (226)
When what we should have done is:
- Failing to open the file
- Replying an error message (550)
In other words, the fix simply tries to open the file *before* we start
the transfer connection:
https://github.com/fclairamb/ftpserver/pull/32/files#diff-
0c77d2426ef48618dcfde3946f0cd69eR22
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<fclairamb/ftpserver#30 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFRbq7XpwwBSMDjBj-5q-jH6T1ot7dIyks5sk20igaJpZM4PfeQ9>
.
|
Thanks for the quick work! |
@fclairamb Any idea when you will merge and tag this? |
I think tonight, when I'm home. |
Sweet, thank you!
…On 22 Sep 2017 5:33 pm, "Florent Clairambault" ***@***.***> wrote:
I think tonight, when I'm home.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<fclairamb/ftpserver#30 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFRbq541i-3jAsUHZaMftzxnCOX7oWUGks5sk9MwgaJpZM4PfeQ9>
.
|
Looks good! Thanks for the quick turn-around on this. |
So I tried out the new fix but I notice that I still can't make subsequent store requests. I still get 229 Entering Extended Passive Mode. I have a flow as follows: I checked and I'm on master's latest commit. The redacted logs:
|
Might have jumped the gun. This could be due to not closing my ftp client's response Reader before doing the Stor commands. |
I think it was that, false alarm. |
Interesting logs :) What is your "cropworker" doing ? I'm quite interested by how people use this library. For me it is to offer a FTP access to google drive, which I offer with https://zoro.io (but the work isn't really finished around that one). |
I had an internal service for fronting a cdn "bucket" which was using nats (https://nats.io/) for sending files to it. I changed it to ftp since sending files on the queue was a bad pattern. Instead of throwing a fully baked ftp on top I thought something like ftpserver was a better way since I potentially want more dynamic features in the future that we can integrate with our auth. Cropworker is just cropping sections out of pdfs :) The files I'm sending back are those cropped images. Nice idea with Zoro! |
I created release v0.3 which contains a fix for that |
If I send multiple files, and the first returns an error I get
229 Entering Extended Passive Mode (|||41111|)
back as an error from my client. Is this an issue with the client or the server?
Is
229 Entering Extended Passive Mode (|||41111|)
valid for a store response?logs:
The text was updated successfully, but these errors were encountered: