aboutsummaryrefslogtreecommitdiff
path: root/openssl/apps/s_socket.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-03-30 12:36:28 +0000
committermarha <marha@users.sourceforge.net>2010-03-30 12:36:28 +0000
commitff48c0d9098080b51ea12710029135916d117806 (patch)
tree96e6af9caf170ba21a1027b24e306a07e27d7b75 /openssl/apps/s_socket.c
parentbb731f5ac92655c4860a41fa818a7a63005f8369 (diff)
downloadvcxsrv-ff48c0d9098080b51ea12710029135916d117806.tar.gz
vcxsrv-ff48c0d9098080b51ea12710029135916d117806.tar.bz2
vcxsrv-ff48c0d9098080b51ea12710029135916d117806.zip
svn merge -r514:HEAD ^/branches/released .
Diffstat (limited to 'openssl/apps/s_socket.c')
-rw-r--r--openssl/apps/s_socket.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/openssl/apps/s_socket.c b/openssl/apps/s_socket.c
index 4a922e16a..6b8713de6 100644
--- a/openssl/apps/s_socket.c
+++ b/openssl/apps/s_socket.c
@@ -62,6 +62,12 @@
#include <errno.h>
#include <signal.h>
+#ifdef FLAT_INC
+#include "e_os2.h"
+#else
+#include "../e_os2.h"
+#endif
+
/* With IPv6, it looks like Digital has mixed up the proper order of
recursive header file inclusion, resulting in the compiler complaining
that u_int isn't defined, but only if _POSIX_C_SOURCE is defined, which
@@ -231,13 +237,11 @@ static int ssl_sock_init(void)
int init_client(int *sock, char *host, int port, int type)
{
unsigned char ip[4];
- short p=0;
if (!host_ip(host,&(ip[0])))
{
return(0);
}
- if (p != 0) port=p;
return(init_client_ip(sock,ip,port,type));
}
@@ -266,7 +270,7 @@ static int init_client_ip(int *sock, unsigned char ip[4], int port, int type)
if (s == INVALID_SOCKET) { perror("socket"); return(0); }
-#ifndef OPENSSL_SYS_MPE
+#if defined(SO_KEEPALIVE) && !defined(OPENSSL_SYS_MPE)
if (type == SOCK_STREAM)
{
i=0;
@@ -276,7 +280,7 @@ static int init_client_ip(int *sock, unsigned char ip[4], int port, int type)
#endif
if (connect(s,(struct sockaddr *)&them,sizeof(them)) == -1)
- { close(s); perror("connect"); return(0); }
+ { closesocket(s); perror("connect"); return(0); }
*sock=s;
return(1);
}
@@ -285,7 +289,7 @@ int do_server(int port, int type, int *ret, int (*cb)(char *hostname, int s, uns
{
int sock;
char *name = NULL;
- int accept_socket;
+ int accept_socket = 0;
int i;
if (!init_server(&accept_socket,port,type)) return(0);