Fix error when server does not send CertificateStatus message
[openssl.git] / apps / s_socket.c
index c1faffc4944c802bc8468355632e6d726f203bae..75053e959125927a8d44dca55617202cdcbc3ec3 100644 (file)
@@ -266,7 +266,7 @@ static int init_client_ip(int *sock, const unsigned char ip[4], int port,
     else                        /* ( type == SOCK_DGRAM) */
         s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
 
-    if (s == INVALID_SOCKET) {
+    if (s == (int)INVALID_SOCKET) {
         perror("socket");
         return (0);
     }
@@ -303,7 +303,7 @@ int init_client_unix(int *sock, const char *server)
         return (0);
 
     s = socket(AF_UNIX, SOCK_STREAM, 0);
-    if (s == INVALID_SOCKET) {
+    if (s == (int)INVALID_SOCKET) {
         perror("socket");
         return (0);
     }
@@ -428,7 +428,7 @@ static int init_server_long(int *sock, int port, char *ip, int type)
     else                        /* type == SOCK_DGRAM */
         s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
 
-    if (s == INVALID_SOCKET)
+    if (s == (int)INVALID_SOCKET)
         goto err;
 # if defined SOL_SOCKET && defined SO_REUSEADDR
     {
@@ -472,7 +472,7 @@ static int init_server_unix(int *sock, const char *path)
         return (0);
 
     s = socket(AF_UNIX, SOCK_STREAM, 0);
-    if (s == INVALID_SOCKET)
+    if (s == (int)INVALID_SOCKET)
         goto err;
 
     memset(&server, 0, sizeof(server));
@@ -527,7 +527,7 @@ static int do_accept(int acc_sock, int *sock, char **host)
      * can either go for (int *) or (void *).
      */
     ret = accept(acc_sock, (struct sockaddr *)&from, (void *)&len);
-    if (ret == INVALID_SOCKET) {
+    if (ret == (int)INVALID_SOCKET) {
 # if defined(OPENSSL_SYS_WINDOWS) || (defined(OPENSSL_SYS_NETWARE) && !defined(NETWARE_BSDSOCK))
         int i;
         i = WSAGetLastError();
@@ -560,7 +560,7 @@ static int do_accept(int acc_sock, int *sock, char **host)
         /* return(0); */
     } else {
         *host = app_malloc(strlen(h1->h_name) + 1, "copy hostname");
-        BUF_strlcpy(*host, h1->h_name, strlen(h1->h_name) + 1);
+        OPENSSL_strlcpy(*host, h1->h_name, strlen(h1->h_name) + 1);
 
         h2 = gethostbyname(*host);
         if (h2 == NULL) {
@@ -589,7 +589,7 @@ static int do_accept_unix(int acc_sock, int *sock)
 
  redoit:
     ret = accept(acc_sock, NULL, NULL);
-    if (ret == INVALID_SOCKET) {
+    if (ret == (int)INVALID_SOCKET) {
         if (errno == EINTR) {
             /*
              * check_timeout();