git-ftp icon indicating copy to clipboard operation
git-ftp copied to clipboard

Use same SFTP connection for data and .git-ftp-log transfers?

Open macbookandrew opened this issue 9 years ago • 1 comments

Is it possible to use the same connection for the data uploads and the log transfers?

I’m having issues with one particular server where it seems to randomly close the connection on some SSH connection attempts, often allowing the file uploads but closing the connection before the .git-ftp-log is uploaded.

Is there a particular reason it’s uploaded with a separate connection from the data transfer?

Thanks for a great tool—I use it many times a day!

macbookandrew avatar Sep 26 '16 19:09 macbookandrew

Thank you for the feedback. There is actually a reason for this, even though it's not very good.

First, the changed files are uploaded. Only if that command succeeds, the log file is uploaded as well. So the first upload command has to end so that we can check if it succeeded. Without that check, the old commit id would be overwritten and you were not able to try the same upload again.

That said, it doesn't really work as well as intended. Curl, which is used to perform the upload, does not fail as long as the last file was uploaded successfully. That means, we actually don't detect some random upload failures.

It would be good to rewrite that part of the code to detect errors based on curl's output. In that case we could give appropriate feedback for a failed upload. In that case, it could be good to upload all files in one go. The last command to upload the log file could be piped to the process after the rest succeeded.

We just need someone who would like to implement that.

mkllnk avatar Sep 27 '16 01:09 mkllnk