Skip to content

Commit 139ea07

Browse files
committed
write the entire sftp buffer block before returning
1 parent e5ce163 commit 139ea07

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ dist
44
build
55
*~
66
*.so
7+
.idea/

ssh2/sftp_handle.pyx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,10 @@ cdef class SFTPHandle:
270270
cdef char *cbuf = buf
271271
cdef ssize_t rc
272272
with nogil:
273-
rc = c_sftp.libssh2_sftp_write(self._handle, cbuf, _size)
273+
while _size > 0:
274+
rc = c_sftp.libssh2_sftp_write(self._handle, cbuf, _size)
275+
cbuf += rc
276+
_size -= rc
274277
return handle_error_codes(rc)
275278

276279
IF EMBEDDED_LIB:

0 commit comments

Comments
 (0)