Browse Source

Reimplementing c45ae10d to avoid need to include non-public API and [Ss]ecure.h conflict

Source commit: 6c22595f54cd117f9104f4c146ed9d3219ef7784
Martin Prikryl 2 months ago
parent
commit
3d60a5155d
3 changed files with 7 additions and 6 deletions
  1. 5 0
      libs/neon/src/ne_socket.c
  2. 1 0
      libs/neon/src/ne_socket.h
  3. 1 6
      source/core/WebDAVFileSystem.cpp

+ 5 - 0
libs/neon/src/ne_socket.c

@@ -2282,3 +2282,8 @@ void ne_sock_set_buffers(ne_socket *sock, unsigned int sndbuf)
         do_ne_sock_sndbuf(sock, SO_RCVBUF, 4 * 1024 * 1024);
     }
 }
+
+int ne_sock_sspi_init(void)
+{
+    return ne_sspi_init();
+}

+ 1 - 0
libs/neon/src/ne_socket.h

@@ -345,6 +345,7 @@ int ne_sock_proxy(ne_socket *sock, enum ne_sock_sversion vers,
 void ne_sock_set_buffers(ne_socket *sock, unsigned int sndbuf);
 #include <openssl/ssl.h>
 void ne_init_ssl_session(SSL *ssl, void *userdata);
+int ne_sock_sspi_init(void);
 
 NE_END_DECLS
 

+ 1 - 6
source/core/WebDAVFileSystem.cpp

@@ -17,11 +17,6 @@
 #include <ne_redirect.h>
 #include <ne_xmlreq.h>
 #include <ne_locks.h>
-// ne_sspi.h is not a public interface, so it is not ready to be included from C++
-#define HAVE_SSPI
-NE_BEGIN_DECLS
-#include <ne_sspi.h>
-NE_END_DECLS
 #include <expat.h>
 
 #include "WebDAVFileSystem.h"
@@ -127,7 +122,7 @@ void __fastcall RequireNeon(TTerminal * Terminal)
     // sspi: QuerySecurityPackageInfo [failed] [80090305].
     // sspi: Unable to get negotiate maximum packet size
     // This takes about second, when debugging, that's why it is postponed until the first connection.
-    if (ne_sspi_init() < 0)
+    if (ne_sock_sspi_init() < 0)
     {
       NeonSspiInitialized = 0;
     }