summaryrefslogtreecommitdiffstats
path: root/apps/s_socket.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2005-06-13 03:23:50 +0000
committerRichard Levitte <levitte@openssl.org>2005-06-13 03:23:50 +0000
commitb764ab9537458b37d247a4f7b6d6a5b9657ff6d6 (patch)
tree0c7b902e3f28e1286726f7373a6e9c04d9fa3d59 /apps/s_socket.c
parenta761b89d2feac31acb9acf01b4a5c6694c9064db (diff)
Netware patch submitted by Verdon Walker" <VWalker@novell.com> in PR
1107. He says: This is a followup to the NetWare patch that was applied to beta3. It does the following: - Fixes a problem in the CLib build with undefined symbols. - Adds the ability to use BSD sockets as the default for the OpenSSL socket BIO. NetWare supports 2 flavors of sockets and our Apache developers need BSD sockets as a configurable option when building OpenSSL. This adds that for them. - Updates to the INSTALL.NW file to explain new options. I have tried very hard to make sure all the changes are in NetWare specific files or guarded carefully to make sure they only impact NetWare builds. I have tested the Windows build to make sure it does not break that since we have made changes to mk1mf.pl. We are still working the gcc cross compile for NetWare issue and hope to have a patch for that before beta 6 is released.
Diffstat (limited to 'apps/s_socket.c')
-rw-r--r--apps/s_socket.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/apps/s_socket.c b/apps/s_socket.c
index c022585978..4a922e16a0 100644
--- a/apps/s_socket.c
+++ b/apps/s_socket.c
@@ -87,8 +87,12 @@ typedef unsigned int u_int;
#ifndef OPENSSL_NO_SOCK
+#if defined(OPENSSL_SYS_NETWARE) && defined(NETWARE_BSDSOCK)
+#include "netdb.h"
+#endif
+
static struct hostent *GetHostByName(char *name);
-#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_NETWARE)
+#if defined(OPENSSL_SYS_WINDOWS) || (defined(OPENSSL_SYS_NETWARE) && !defined(NETWARE_BSDSOCK))
static void ssl_sock_cleanup(void);
#endif
static int ssl_sock_init(void);
@@ -104,7 +108,7 @@ static int host_ip(char *str, unsigned char ip[4]);
#define SOCKET_PROTOCOL IPPROTO_TCP
#endif
-#ifdef OPENSSL_SYS_NETWARE
+#if defined(OPENSSL_SYS_NETWARE) && !defined(NETWARE_BSDSOCK)
static int wsa_init_done=0;
#endif
@@ -156,7 +160,7 @@ static void ssl_sock_cleanup(void)
WSACleanup();
}
}
-#elif defined(OPENSSL_SYS_NETWARE)
+#elif defined(OPENSSL_SYS_NETWARE) && !defined(NETWARE_BSDSOCK)
static void sock_cleanup(void)
{
if (wsa_init_done)
@@ -199,7 +203,7 @@ static int ssl_sock_init(void)
SetWindowLong(topWnd,GWL_WNDPROC,(LONG)lpTopHookProc);
#endif /* OPENSSL_SYS_WIN16 */
}
-#elif defined(OPENSSL_SYS_NETWARE)
+#elif defined(OPENSSL_SYS_NETWARE) && !defined(NETWARE_BSDSOCK)
WORD wVerReq;
WSADATA wsaData;
int err;
@@ -398,7 +402,7 @@ redoit:
ret=accept(acc_sock,(struct sockaddr *)&from,(void *)&len);
if (ret == INVALID_SOCKET)
{
-#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_NETWARE)
+#if defined(OPENSSL_SYS_WINDOWS) || (defined(OPENSSL_SYS_NETWARE) && !defined(NETWARE_BSDSOCK))
i=WSAGetLastError();
BIO_printf(bio_err,"accept error %d\n",i);
#else