Problems after upgrade to 2.0.4.21

Dealing with backends for implementing parallel uploads original post said this. I have no opinion myself:

I’ve started looking into a theory that the below on file transfers is doing an incomplete clone, therefore coming up with an FTPClient with CurrentDataType uninitialized, and therefore 0, and therefore ASCII:

I’m not sure if I can patch this in the debugger (haven’t tried yet), and am not set up on Windows to build. Another way of testing if it’s the problem is to set EnableThreadSafeDataConnections to false if we dare:

Current data type not set when using EnableThreadSafeDataConnections #184 was a similar partial clone, and Fix download file data type bug. #202 added the DownloadDataType and UploadDataType, but it looks like those are for the high-level API whereas Duplicati downloads use the low-level API. The TYPE I before the SIZE might be a force-to-binary, and TYPE A after it might be a return to the incorrect CurrentDataType:

This needs a whole lot more testing (and I’d like to come up with a simpler test case if a FluentFTP issue gets filed, but once again I’m somewhat limited in C# build abilities…) but that’s the update I wanted to do.

EDIT:

Looking at the prior fix, and the current CloneConnection calls in FtpClient_LowLevel.cs, I notice there are SetDataType* calls done afterwards for an OpenReadAsync, OpenWrite, OpenWriteAsync, OpenAppend, and OpenAppendAsync, however in OpenRead (which is what Duplicati uses) the SetDataType precedes CloneConnection. Maybe the ordering fixes up the incomplete cloning, except for the case Duplicati uses?

EDIT 2:

Getting way too speculative, possibly attempted fix for #318 made the problem more visible by being more definite about setting the connection transfer type to what’s usually the right value, but in our case is wrong. That would be a good outcome, because downgrading to some version before this recent fix might help us.