This patch modifies the code so that all socket writes/reads are done in binary mode, with decoding/encoding only occurring when transmitting metadata to/from the socket. This ensures that the contents of the file itself are transmitted completely verbatim, preventing a potential exception and/or data corruption if the contents are not plain ASCII.
As a side effect, this change also fixes a hang which would occur if a file on the remote system contained CR+LF line endings.
This patch modifies the code so that all socket writes/reads are done in binary mode, with decoding/encoding only occurring when transmitting metadata to/from the socket. This ensures that the contents of the file itself are transmitted completely verbatim, preventing a potential exception and/or data corruption if the contents are not plain ASCII.
As a side effect, this change also fixes a hang which would occur if a file on the remote system contained CR+LF line endings.