This is an automated email from the ASF dual-hosted git repository.
martinzink pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git
The following commit(s) were added to refs/heads/main by this push:
new 78beb249b MINIFICPP-2824 Fix libssh2 configuration failure on Windows
(#2184)
78beb249b is described below
commit 78beb249b31bc0111640c40f8d4a2239ea8e6b01
Author: Gabor Gyimesi <[email protected]>
AuthorDate: Wed May 27 17:10:16 2026 +0200
MINIFICPP-2824 Fix libssh2 configuration failure on Windows (#2184)
---
thirdparty/libssh2/fix-windows-ioctl.patch | 39 ++++++++++++++++++------------
1 file changed, 24 insertions(+), 15 deletions(-)
diff --git a/thirdparty/libssh2/fix-windows-ioctl.patch
b/thirdparty/libssh2/fix-windows-ioctl.patch
index 2c2c61841..f8ea199ad 100644
--- a/thirdparty/libssh2/fix-windows-ioctl.patch
+++ b/thirdparty/libssh2/fix-windows-ioctl.patch
@@ -1,21 +1,30 @@
diff --git a/src/session.c b/src/session.c
-index 212560b8..5e4fc8db 100644
+index 2d77b05e..929de40d 100644
--- a/src/session.c
+++ b/src/session.c
-@@ -291,15 +291,7 @@ session_nonblock(libssh2_socket_t sockfd, /* operate on
this */
- #define SETBLOCK 1
- #endif
+@@ -292,7 +292,12 @@ static int
+ session_nonblock(libssh2_socket_t sockfd, /* operate on this */
+ int nonblock /* TRUE or FALSE */ )
+ {
+-#ifdef HAVE_O_NONBLOCK
++#if defined(_WIN32)
++ unsigned long flags;
++
++ flags = nonblock;
++ return ioctlsocket(sockfd, FIONBIO, &flags);
++#elif defined(HAVE_O_NONBLOCK)
+ /* most recent unix versions */
+ int flags;
--#if defined(HAVE_FIONBIO) && (SETBLOCK == 0)
-- /* older unix versions and VMS*/
-- int flags;
+@@ -314,11 +319,6 @@ session_nonblock(libssh2_socket_t sockfd, /* operate on
this */
+ /* BeOS */
+ long b = nonblock ? 1 : 0;
+ return setsockopt(sockfd, SOL_SOCKET, SO_NONBLOCK, &b, sizeof(b));
+-#elif defined(_WIN32)
+- unsigned long flags;
-
- flags = nonblock;
-- return ioctl(sockfd, FIONBIO, &flags);
--#undef SETBLOCK
--#define SETBLOCK 2
--#endif
-+// removed ioctl() method since it is not supported on Windows
-
- #if defined(HAVE_IOCTLSOCKET) && (SETBLOCK == 0)
- /* Windows? */
+- return ioctlsocket(sockfd, FIONBIO, &flags);
+ #else
+ (void)sockfd;
+ (void)nonblock;