Subject: Re: libssh2_sftp_init() hangs with zlib compression turned on

Re: libssh2_sftp_init() hangs with zlib compression turned on

From: Gebi Miguel <gebi.miguel_at_gmail.com>
Date: Tue, 14 Jan 2020 01:27:53 -0800

Trying to "back out" a little to maybe see the big picture I ran cmake again, first just "cmake .." for a base line, then including zlib support to compare to the base line:

cmake .. -DENABLE_ZLIB_COMPRESSION=ON -DZLIB_LIBRARY=../../zlib-1.2.11/myBuildOrig/Debug/zlibstaticd.lib -DZLIB_INCLUDE_DIR=../../zlib-1.2.11

There is a difference in the cmake output that puzzles me. Without zlib support I'm seeing this:

...
-- Performing Test HAVE_IOCTLSOCKET
-- Performing Test HAVE_IOCTLSOCKET - Success
-- Looking for include file arpa/inet.h
-- Looking for include file arpa/inet.h - not found
...

With zlib enabled the output changes to:

-- Performing Test HAVE_IOCTLSOCKET
-- Performing Test HAVE_IOCTLSOCKET - Failed
-- Performing Test HAVE_IOCTLSOCKET_CASE
-- Performing Test HAVE_IOCTLSOCKET_CASE - Failed
-- Performing Test HAVE_SO_NONBLOCK
-- Performing Test HAVE_SO_NONBLOCK - Failed
-- Looking for include file arpa/inet.h
-- Looking for include file arpa/inet.h - not found

As a result, the header file libssh2_config.h is different, without zlib support it contains these lines:

/* Socket non-blocking support */
/* #undef HAVE_O_NONBLOCK */
/* #undef HAVE_FIONBIO */
#define HAVE_IOCTLSOCKET
/* #undef HAVE_IOCTLSOCKET_CASE */
/* #undef HAVE_SO_NONBLOCK */
/* #undef HAVE_DISABLED_NONBLOCKING */

With zlib enabled this same section in libssh2_config.h changes to:

/* Socket non-blocking support */
/* #undef HAVE_O_NONBLOCK */
/* #undef HAVE_FIONBIO */
/* #undef HAVE_IOCTLSOCKET */
/* #undef HAVE_IOCTLSOCKET_CASE */
/* #undef HAVE_SO_NONBLOCK */
#define HAVE_DISABLED_NONBLOCKING

Otherwise the files are identical. Could that be why I'm getting stuck in recv()?

_______________________________________________
libssh2-devel https://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2020-01-14