Closed jm33-m0 closed 1 year ago
Now both sides use io.Copy
to transfer file data, not sure what causes the connection to cancel for C2 side before it can save the whole file.
Every time it fails at a certain point. From agent side I can see no errors and io.Copy
finishes its job without complaining, C2 should be able to receive every byte of the file, but instead it complains that the download can't be finished before connection is closed.
In agent.ftp
file, sendFile2CC
has two deferred connection closing action, there's a chance that the first cancel
kills the connection before it finishes its job. Removing cancel
solves this issue.
As shown in the screenshot,
get
command fails at 99%, saying the H2 connection is canceled, if we retryget
it will download the remaining bytes.