Closed msalle closed 4 years ago
@msalle: Is the current state of the patches up to date with what was discussed/decided in #3?
No, this PR is still in the state where it would only NOT delete when the failure is a 550. For other failure modes it would still follow the code leading to the original deletion of the remote file.
I have an additional branch https://github.com/msalle/UberFTP/tree/no_delete_file / https://github.com/msalle/UberFTP/commit/520540710382a47623656bb99271743bb553e0d0 with almost trivial change just disabling (with an #if 0
to keep the original code around) the deletion. No pull request from that one (yet).
Paul's intermediate solution in https://github.com/gridcf/UberFTP/issues/3#issuecomment-633734711 would be nicer, but difficult to implement.
And do the changes work as expected during a test replicating the situation described in the original GGUS ticket?
Yes, I've extensively tested it with a locally built Uberftp from this branch and both prometheus.desy.de and gridftp.grid.sara.nl.
@msalle: Well, I'd go for the simple change then, though I'd just remove the relevant code, instead of masking it. I mean, it's still kept in the history, so no need to keep it around.
@matyasselmeci @ellert What would you suggest?
I'm closing this PR in favour of #5
This is a simple and not very clean fix for gridcf/UberFTP/issues/3 Either (one of) the
l_write()
or thel_close()
can fail if the remote file already exists, since the data goes over a different channel than the control messages. For large files, it will typically be one of the laterl_write()
statements, for small files probably thel_close()
. Hence we effectively only have theerrmsg
to find out what happened, and therefore do a simplestr(n)cmp
with thiserrmsg
. For this we also need to add a function to get it from the opaqueerrcode_t
. Note that there are other FTP error codes that probably should prevent the delete. Feedback on this would be highly appreciated (-;