Skip to content

Commit 3a29823

Browse files
committed
stop on error code = negative number
1 parent 139ea07 commit 3a29823

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

ssh2/sftp_handle.pyx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,8 @@ cdef class SFTPHandle:
272272
with nogil:
273273
while _size > 0:
274274
rc = c_sftp.libssh2_sftp_write(self._handle, cbuf, _size)
275+
if rc < 0:
276+
break
275277
cbuf += rc
276278
_size -= rc
277279
return handle_error_codes(rc)

0 commit comments

Comments
 (0)