Fix ct_test to not assume it's in the source directory
[openssl.git] / apps / s_socket.c
index 5d66ab993a4959154012ffbc59dc9d73cc84c398..00556bccb0ced139999d3427ff34434ea4fe96fd 100644 (file)
@@ -167,9 +167,9 @@ int init_client(int *sock, const char *host, const char *port,
 
     ret = 0;
     for (ai = res; ai != NULL; ai = BIO_ADDRINFO_next(ai)) {
-        /* Admitedly, these checks are quite paranoid, we should
-           not get anything in the BIO_ADDRINFO chain that we haven't
-           asked for */
+        /* Admittedly, these checks are quite paranoid, we should not get
+         * anything in the BIO_ADDRINFO chain that we haven't
+         * asked for. */
         OPENSSL_assert((family == AF_UNSPEC || family == BIO_ADDRINFO_family(res))
                        && (type == 0 || type == BIO_ADDRINFO_socktype(res)));
 
@@ -238,9 +238,8 @@ int do_server(int *accept_sock, const char *host, const char *port,
         return 0;
     }
 
-    /* Admitedly, these checks are quite paranoid, we should
-       not get anything in the BIO_ADDRINFO chain that we haven't
-       asked for */
+    /* Admittedly, these checks are quite paranoid, we should not get
+     * anything in the BIO_ADDRINFO chain that we haven't asked for */
     OPENSSL_assert((family == AF_UNSPEC || family == BIO_ADDRINFO_family(res))
                    && (type == 0 || type == BIO_ADDRINFO_socktype(res)));
 
@@ -267,11 +266,11 @@ int do_server(int *accept_sock, const char *host, const char *port,
             } while (sock < 0 && BIO_sock_should_retry(ret));
             if (sock < 0) {
                 ERR_print_errors(bio_err);
-                SHUTDOWN(asock);
+                BIO_closesocket(asock);
                 break;
             }
             i = (*cb)(sock, type, context);
-            SHUTDOWN2(sock);
+            BIO_closesocket(sock);
         } else {
             i = (*cb)(asock, type, context);
         }
@@ -279,7 +278,7 @@ int do_server(int *accept_sock, const char *host, const char *port,
         if (naccept != -1)
             naccept--;
         if (i < 0 || naccept == 0) {
-            SHUTDOWN2(asock);
+            BIO_closesocket(asock);
             ret = i;
             break;
         }