[erlang-questions] ftp lib behaviour has changed between ftp-1.0.1 and ftp-1.0.2

Robert Raschke rtrlists@REDACTED
Fri Jul 12 10:43:33 CEST 2019


Hi Ingela,

I just had a case of ftp:recv_bin(FTP, "filename") repeatedly returned only
'ok'.
That is, my hoped for workaround of simply retrying the operation fails.

This makes version 1.0.2 of the ftp lib unusable, I'm afraid.
I will have to revert to an earlier version.

Cheers,
Robby


On Tue, 9 Jul 2019 at 20:49, Ingela Andin <ingela.andin@REDACTED> wrote:

> Hi Robert!
>
> Well it somewhat unexpected that it returns an undocumented value. It
> might be that the correction made to fix a timing bug in the FTP
> application, that
> was exposed by TLS optimizations when running FTP over TLS, uncovered some
> other timing bug. Most of the FTP code is very old and I wished for the
> gen_statem behavior while fixing the bug I just mentioned, so I would not
> be very surprised if there are more race conditions in that code.
>
> Regards Ingela Erlang/OTP team
>
> Den mån 8 juli 2019 kl 18:11 skrev Robert Raschke <rtrlists@REDACTED
> >:
>
>> Hi,
>>
>> I have code that matches on {ok, Result} and {error, Reason} tuples
>> coming from calls to ftp:ls/2 and ftp:recv_bin/2 (on 21.1, ftp-1.0.1) and
>> upgrading to 21.3 (ftp-1.0.2) sometimes returns a simple ok on those calls.
>> This is surprising.
>>
>> 15> f().
>>
>> ok
>>
>> 16> {ok, FTP} = ftp:open("somesite"), ok = ftp:user(FTP, "someuser",
>> "somepwd"), timer:sleep(100), R = ftp:ls(FTP, "/somefolder/*"),
>> ftp:close(FTP), R.
>>
>> {ok,"-rw-r--r--    1 2001       2001           174993 Jul  8 17:16 ..."}
>>
>> 17> f().
>>
>> ok
>>
>> 18> {ok, FTP} = ftp:open("somesite"), ok = ftp:user(FTP, "someuser",
>> "somepwd"), timer:sleep(100), R = ftp:ls(FTP, "/somefolder/*"),
>> ftp:close(FTP), R.
>>
>> ok
>>
>> 19>
>>
>>
>> What might be the reason for this? And is this expected?
>>
>>
>> Cheers,
>>
>> Robby
>>
>>
>> _______________________________________________
>> erlang-questions mailing list
>> erlang-questions@REDACTED
>> http://erlang.org/mailman/listinfo/erlang-questions
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20190712/cf539898/attachment.htm>


More information about the erlang-questions mailing list