Subject: EOF and seek64 bug?

EOF and seek64 bug?

From: Gellule Xg <>
Date: Thu, 26 Jan 2012 09:43:45 -1000

Dear libssh2-devel mailing list,

While interleaving some sftp_seek64 with sftp_read to read different
section of a file, all stays fine until I reach EOF. After that, I can
never get anything back from sftp_read after using sftp_seek64 to get
away from EOF. I've tried with the following patch, and at least for me,
things seem to work better.



PS: I sent an E-mail to this list before registering, and this one
after. Hopefully, I am not double-posting.

diff --git a/src/sftp.c b/src/sftp.c
index 32b215a..48da9f2 100644
--- a/src/sftp.c
+++ b/src/sftp.c
@@ -1933,6 +1933,9 @@ libssh2_sftp_seek64(LIBSSH2_SFTP_HANDLE *handle,
libssh2_uint64_t offset)
              handle->u.file.data_left = handle->u.file.data_len = 0;
              handle-> = NULL;
+ /* reset EOF to False */
+ handle->u.file.eof = FALSE;

Received on 2012-01-26