diff options
author | Jakub Jelen <jjelen@redhat.com> | 2018-08-26 21:38:06 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2018-08-27 09:29:24 +0200 |
commit | ae3825dfb2c6364bc088353640d59b0546b8d6f6 (patch) | |
tree | a8155884e36c296b68e011395bf2f0a77ba40a93 /src/packet_cb.c | |
parent | 8f1e995cec1e2438eb8460731f6f62c1aa50518d (diff) | |
download | libssh-ae3825dfb2c6364bc088353640d59b0546b8d6f6.tar.gz libssh-ae3825dfb2c6364bc088353640d59b0546b8d6f6.tar.xz libssh-ae3825dfb2c6364bc088353640d59b0546b8d6f6.zip |
sftp: Avoid race condition reading incomplete data messages
This changes amends f561e6bcb361999088fe377f750dbacbc5e0102f which
introduces same check in one place, but miss it in other two places.
We encountered this issue with qemu using SFTP to transfer large
data chunks and in some cases, the file transfer was interrupted
without any reason. From the debug messages, it showed up that
last part of data message/packet was not handled in the time
of the sftp_read() call, therefore the ssh_channel_read() returned
zero (there was no more data to read yet), which made the whole
transfer fail hard instead of retrying later.
The proposed change is reusing the code from previously referenced
commit also in the other places.
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'src/packet_cb.c')
0 files changed, 0 insertions, 0 deletions