LIBSSH2_API void
 libssh2_sftp_seek64(LIBSSH2_SFTP_HANDLE *handle, libssh2_uint64_t offset)
 {
-    if(handle)
-        handle->u.file.offset = handle->u.file.offset_sent = offset;
+  if(handle) {
+    handle->u.file.offset = handle->u.file.offset_sent = offset;
+    /* discard the request */
+    sftp_packetlist_flush(handle);
+
+    /* free the left received data */
+    if (handle->u.file.data_left) {
+      LIBSSH2_FREE(handle->sftp->channel->session, handle->u.file.data);
+      handle->u.file.data_left = handle->u.file.data_len = 0;
+      handle->u.file.data = NULL;
+    }
+  }
 }

Just my point about the problem.
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

Reply via email to