summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libssl/src/apps/s_socket.c54
1 files changed, 0 insertions, 54 deletions
diff --git a/src/lib/libssl/src/apps/s_socket.c b/src/lib/libssl/src/apps/s_socket.c
index 07f9934b32..cc02b51b6d 100644
--- a/src/lib/libssl/src/apps/s_socket.c
+++ b/src/lib/libssl/src/apps/s_socket.c
@@ -84,14 +84,8 @@
84 84
85#ifndef OPENSSL_NO_SOCK 85#ifndef OPENSSL_NO_SOCK
86 86
87#if defined(OPENSSL_SYS_NETWARE) && defined(NETWARE_BSDSOCK)
88#include "netdb.h"
89#endif
90 87
91static struct hostent *GetHostByName(char *name); 88static struct hostent *GetHostByName(char *name);
92#if defined(OPENSSL_SYS_WINDOWS) || (defined(OPENSSL_SYS_NETWARE) && !defined(NETWARE_BSDSOCK))
93static void ssl_sock_cleanup(void);
94#endif
95static int ssl_sock_init(void); 89static int ssl_sock_init(void);
96static int init_server(int *sock, int port, int type); 90static int init_server(int *sock, int port, int type);
97static int init_server_long(int *sock, int port,char *ip, int type); 91static int init_server_long(int *sock, int port,char *ip, int type);
@@ -99,51 +93,11 @@ static int do_accept(int acc_sock, int *sock, char **host);
99 93
100#define SOCKET_PROTOCOL IPPROTO_TCP 94#define SOCKET_PROTOCOL IPPROTO_TCP
101 95
102#if defined(OPENSSL_SYS_NETWARE) && !defined(NETWARE_BSDSOCK)
103static int wsa_init_done=0;
104#endif
105 96
106 97
107#if defined(OPENSSL_SYS_NETWARE) && !defined(NETWARE_BSDSOCK)
108static void sock_cleanup(void)
109 {
110 if (wsa_init_done)
111 {
112 wsa_init_done=0;
113 WSACleanup();
114 }
115 }
116#endif
117 98
118static int ssl_sock_init(void) 99static int ssl_sock_init(void)
119 { 100 {
120#ifdef WATT32
121 extern int _watt_do_exit;
122 _watt_do_exit = 0;
123 if (sock_init())
124 return (0);
125#elif defined(OPENSSL_SYS_NETWARE) && !defined(NETWARE_BSDSOCK)
126 WORD wVerReq;
127 WSADATA wsaData;
128 int err;
129
130 if (!wsa_init_done)
131 {
132
133# ifdef SIGINT
134 signal(SIGINT,(void (*)(int))sock_cleanup);
135# endif
136
137 wsa_init_done=1;
138 wVerReq = MAKEWORD( 2, 0 );
139 err = WSAStartup(wVerReq,&wsaData);
140 if (err != 0)
141 {
142 BIO_printf(bio_err,"unable to start WINSOCK2, error code=%d\n",err);
143 return(0);
144 }
145 }
146#endif /* OPENSSL_SYS_WINDOWS */
147 return(1); 101 return(1);
148 } 102 }
149 103
@@ -174,14 +128,12 @@ int init_client(int *sock, char *host, char *port, int type, int af)
174 { 128 {
175 s=socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol); 129 s=socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
176 if (s == -1) { continue; } 130 if (s == -1) { continue; }
177#ifndef OPENSSL_SYS_MPE
178 if (type == SOCK_STREAM) 131 if (type == SOCK_STREAM)
179 { 132 {
180 i=0; 133 i=0;
181 i=setsockopt(s,SOL_SOCKET,SO_KEEPALIVE,(char *)&i,sizeof(i)); 134 i=setsockopt(s,SOL_SOCKET,SO_KEEPALIVE,(char *)&i,sizeof(i));
182 if (i < 0) { perror("keepalive"); return(0); } 135 if (i < 0) { perror("keepalive"); return(0); }
183 } 136 }
184#endif
185 if ((i = connect(s, ai->ai_addr, ai->ai_addrlen)) == 0) 137 if ((i = connect(s, ai->ai_addr, ai->ai_addrlen)) == 0)
186 { *sock=s; freeaddrinfo(ai_top); return (1); } 138 { *sock=s; freeaddrinfo(ai_top); return (1); }
187 139
@@ -315,11 +267,6 @@ redoit:
315 ret=accept(acc_sock,(struct sockaddr *)&from,(void *)&len); 267 ret=accept(acc_sock,(struct sockaddr *)&from,(void *)&len);
316 if (ret == -1) 268 if (ret == -1)
317 { 269 {
318#if defined(OPENSSL_SYS_WINDOWS) || (defined(OPENSSL_SYS_NETWARE) && !defined(NETWARE_BSDSOCK))
319 int i;
320 i=WSAGetLastError();
321 BIO_printf(bio_err,"accept error %d\n",i);
322#else
323 if (errno == EINTR) 270 if (errno == EINTR)
324 { 271 {
325 /*check_timeout(); */ 272 /*check_timeout(); */
@@ -327,7 +274,6 @@ redoit:
327 } 274 }
328 fprintf(stderr,"errno=%d ",errno); 275 fprintf(stderr,"errno=%d ",errno);
329 perror("accept"); 276 perror("accept");
330#endif
331 return(0); 277 return(0);
332 } 278 }
333 279