Does this also work correctly for the case of seek64:ing to EOF?

Looks like it does.

I did the following tests:

seek64 to filesize
read 1024, got 0
seek64 to filesize-100
read 1024, got 100
seek64 to filesize
read 1024, got 0


Also,
seek64 to filesize-100
read 1024, got 100
seek64 to filesize-100
read 1024, got 100
Gives the exact same returned buffer twice.

Finally, seeking past the size also seems to yield the correct behavior.

If yes, then please re-send a patch created by git format-patch after
you have created a clean commit locally. If you are not familiar
enough with git then please say so, and we can make the commit for
you. In that case, please mention what name and email address you
would like the patch to have as author.

Attached!

-Gellule


>From 1f21dd1df652c8086e7c5d835b5b5a38c7147e56 Mon Sep 17 00:00:00 2001
From: Gellule Xg <gellule...@gmail.com>
Date: Thu, 26 Jan 2012 12:21:12 -1000
Subject: [PATCH] Reverting the EOF flag to False when calling seek64 to be
 able to get some data back on a following read.

---
 src/sftp.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

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->u.file.data = NULL;
         }
+
+        /* reset EOF to False */
+        handle->u.file.eof = FALSE;
     }
 }
 
-- 
1.7.7.4

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

Reply via email to