Commit 17a67ee9 authored by Rob Swindell's avatar Rob Swindell 💬
Browse files

Fix FTPS upload failure: !DATA ERROR 0 receiving on data socket

Don't treat CRYPT_ERROR_COMPLETE (-24) as a socket error during upload since it's an indication that the remote closed the connection and is the normal "end of file/transfer" indicator, not an error. 'rd' is already 0 in this case, so no need to set at all (since recv() returns 0 upon disconnect and that's what we're emulating here).

Fixes issue #309 reported by Jas Hud.
parent 312daa40
Pipeline #2508 passed with stage
in 9 minutes and 32 seconds
......@@ -978,7 +978,8 @@ static void receive_thread(void* arg)
int status = cryptPopData(*xfer.data_sess, buf, sizeof(buf), &rd);
if (status != CRYPT_OK) {
GCES(status, *xfer.data_sock, *xfer.data_sess, estr, "popping data");
rd = -1;
if (status != CRYPT_ERROR_COMPLETE)
rd = SOCKET_ERROR;
}
}
else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment