Subject: [libssh2] advisability of using struct stat in libssh2_scp_recv()

[libssh2] advisability of using struct stat in libssh2_scp_recv()

From: Peter O'Gorman <libssh2-devel_at_mlists.thewrittenword.com>
Date: Thu, 26 Apr 2007 21:31:20 -0500

Hi,

So, we built curl with libssh2 from yesterday, then tried to copy a
95MB file from remote linux machine to local solaris machine.

While libssh2 correctly found the size of the file, curl thought it
was a 4492PB file. Yes, that's 4492 petabytes.

The reason for this is fairly simple, curl has AC_SYS_LARGEFILE in its
configure, libssh2 does not, so curl's idea of the offset to and sizeof
st_size is not the same as libssh2's. So it has an insane idea of the
filesize.

We can, of course, fix this locally by ensuring that our libssh2 and
curl have largefile options when built, but it seems like it would be
a good idea to avoid this problem by changing the prototype for
libssh2_scp_recv. I suggest using a libssh2_stat structure that will
not change size or offsets with compiler options.

Thanks,
Peter

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
libssh2-devel mailing list
libssh2-devel_at_lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libssh2-devel
Received on 2007-04-27