[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sftp_read receives EOF on second call for a 24kb file


On Thursday 24 October 2013 15:07:46 Kevin Lambert wrote:
> I have found that Darren’s cmake build of 0.5.5 libssh.dll via mingw32 works
> fine for me whereas my build using MSVC 2005 32bit is causing a problem. 
> Two things I had to do to get sftp.c to build were:
> 
> 
> 
> 1.       define htonll as below
> 
> 2.       comment out line 292 #ifndef HAVE_NTOHLL and #endif /* HAVE_NTOHLL
> */ in misc.c to get sftp.c to build.

So the ntohll/htonll functions are broken in VC2005??? At least good to know 
that you fixed it.

> uint64_t htonll(uint64_t value) {
> 
> #ifdef WORDS_BIGENDIAN
> 
>     int num = 42;
> 
>     if (*(char *)&num == 42) {
> 
>         uint32_t high_part = htonl((uint32_t)(value >> 32));
> 
>         uint32_t low_part = htonl((uint32_t)(value & 0xFFFFFFFFLL));
> 
>         return (((uint64_t)low_part) << 32) | high_part;
> 
>     } else {
> 
>         return value;
> 
>     }
> 
> #else
> 
>   return value;
> 
> #endif /* WORDS_BIGENDIAN */
> 
> 
> 
> Was anybody able to get sftp.c to build under MSVC 2005 without making these
> two changes?

I have VS 2013, maybe it is a good idea to update :)


	-- andreas
 

-- 
Andreas Schneider                   GPG-ID: CC014E3D
www.cryptomilk.org                asn@xxxxxxxxxxxxxx


Follow-Ups:
Re: sftp_read receives EOF on second call for a 24kb fileKevin Lambert <klambert@xxxxxxxxx>
References:
RE: sftp_read receives EOF on second call for a 24kb file"Kevin Lambert" <klambert@xxxxxxxxx>
Re: sftp_read receives EOF on second call for a 24kb fileDarren <d.tomlin@xxxxxxxxxxxx>
RE: sftp_read receives EOF on second call for a 24kb file"Kevin Lambert" <klambert@xxxxxxxxx>
Archive administrator: postmaster@lists.cynapses.org