Add Rijndael as things to look through.
[oweals/openssl.git] / apps / s_socket.c
index ba10d76b2893cf163152815cc684eacd9a52245d..9812e6d505d4791709fc2ba7b49d1707b97d2d53 100644 (file)
@@ -80,7 +80,9 @@ typedef unsigned int u_int;
 #include <openssl/ssl.h>
 
 static struct hostent *GetHostByName(char *name);
+#ifdef WINDOWS
 static void sock_cleanup(void);
+#endif
 static int sock_init(void);
 static int init_client_ip(int *sock,unsigned char ip[4], int port);
 static int init_server(int *sock, int port);
@@ -130,17 +132,17 @@ static BOOL CALLBACK enumproc(HWND hwnd,LPARAM lParam)
 #endif /* WIN32 */
 #endif /* WINDOWS */
 
+#ifdef WINDOWS
 static void sock_cleanup(void)
        {
-#ifdef WINDOWS
        if (wsa_init_done)
                {
                wsa_init_done=0;
                WSACancelBlockingCall();
                WSACleanup();
                }
-#endif
        }
+#endif
 
 static int sock_init(void)
        {
@@ -207,9 +209,11 @@ static int init_client_ip(int *sock, unsigned char ip[4], int port)
        s=socket(AF_INET,SOCK_STREAM,SOCKET_PROTOCOL);
        if (s == INVALID_SOCKET) { perror("socket"); return(0); }
 
+#ifndef MPE
        i=0;
        i=setsockopt(s,SOL_SOCKET,SO_KEEPALIVE,(char *)&i,sizeof(i));
        if (i < 0) { perror("keepalive"); return(0); }
+#endif
 
        if (connect(s,(struct sockaddr *)&them,sizeof(them)) == -1)
                { close(s); perror("connect"); return(0); }
@@ -239,7 +243,7 @@ int do_server(int port, int *ret, int (*cb)(), char *context)
                        return(0);
                        }
                i=(*cb)(name,sock, context);
-               if (name != NULL) Free(name);
+               if (name != NULL) OPENSSL_free(name);
                SHUTDOWN2(sock);
                if (i < 0)
                        {
@@ -370,9 +374,9 @@ redoit:
                }
        else
                {
-               if ((*host=(char *)Malloc(strlen(h1->h_name)+1)) == NULL)
+               if ((*host=(char *)OPENSSL_malloc(strlen(h1->h_name)+1)) == NULL)
                        {
-                       perror("Malloc");
+                       perror("OPENSSL_malloc");
                        return(0);
                        }
                strcpy(*host,h1->h_name);