diff options
Diffstat (limited to 'deps/openssl/openssl/apps/s_socket.c')
-rw-r--r-- | deps/openssl/openssl/apps/s_socket.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/deps/openssl/openssl/apps/s_socket.c b/deps/openssl/openssl/apps/s_socket.c index 6d1d7d749d..c08544a13c 100644 --- a/deps/openssl/openssl/apps/s_socket.c +++ b/deps/openssl/openssl/apps/s_socket.c @@ -237,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)); } @@ -272,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; @@ -282,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); } @@ -291,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); |