Fix source where indent will not be able to cope
[openssl.git] / demos / easy_tls / easy-tls.c
index f79076a42b06840069fce935ddea05e7933e145c..2e06d06d91177703db452cfd309622d60ca2dff1 100644 (file)
@@ -1,9 +1,9 @@
 /* -*- Mode: C; c-file-style: "bsd" -*- */
-/*
+/*-
  * easy-tls.c -- generic TLS proxy.
- * $Id: easy-tls.c,v 1.2 2001/09/24 07:54:09 bodo Exp $
+ * $Id: easy-tls.c,v 1.4 2002/03/05 09:07:16 bodo Exp $
  */
-/*
+/*-
  (c) Copyright 1999 Bodo Moeller.  All rights reserved.
 
  This is free software; you can redistributed and/or modify it
@@ -14,7 +14,7 @@
  or
    -  the following license:
 */
-/*
+/*-
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that each of the following
  * conditions is met:
@@ -62,7 +62,7 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
  * OF THE POSSIBILITY OF SUCH DAMAGE.
  */
-/*
+/*-
  * Attribution for OpenSSL library:
  *
  * This product includes cryptographic software written by Eric Young
@@ -73,7 +73,7 @@
  */
 
 static char const rcsid[] =
-"$Id: easy-tls.c,v 1.2 2001/09/24 07:54:09 bodo Exp $";
+"$Id: easy-tls.c,v 1.4 2002/03/05 09:07:16 bodo Exp $";
 
 #include <assert.h>
 #include <errno.h>
@@ -124,7 +124,8 @@ static char const rcsid[] =
 # include TLS_APP
 #endif
 
-/* Applications can define:
+/*-
+ * Applications can define:
  *   TLS_APP_PROCESS_INIT -- void ...(int fd, int client_p, void *apparg)
  *   TLS_CUMULATE_ERRORS 
  *   TLS_ERROR_BUFSIZ
@@ -185,7 +186,8 @@ tls_start_proxy_defaultargs(void)
     return ret;
 }
 
-/* Slice in TLS proxy process at fd.
+/*- 
+ * Slice in TLS proxy process at fd.
  * Return value:
  *   0    ok  (*pid is set to child's PID if pid != NULL),
  *   < 0  look at errno
@@ -567,8 +569,13 @@ no_passphrase_callback(char *buf, int num, int w, void *arg)
     return -1;
 }
 
+#if OPENSSL_VERSION_NUMBER >= 0x00907000L
+static int
+verify_dont_fail_cb(X509_STORE_CTX *c, void *unused_arg)
+#else
 static int
 verify_dont_fail_cb(X509_STORE_CTX *c)
+#endif
 {
     int i;
     
@@ -802,8 +809,9 @@ max(int a, int b)
     return a > b ? a : b;
 }
 
+/* timeout, -1 means no timeout */
 static void
-tls_sockets_select(int read_select_1, int read_select_2, int write_select_1, int write_select_2, int seconds /* timeout, -1 means no timeout */)
+tls_sockets_select(int read_select_1, int read_select_2, int write_select_1, int write_select_2, int seconds)
 {
     int maxfd, n;
     fd_set reads, writes;
@@ -966,7 +974,7 @@ tls_proxy(int clear_fd, int tls_fd, int info_fd, SSL_CTX *ctx, int client_p)
     
     /* loop finishes as soon as we detect that one side closed;
      * when all (program and OS) buffers have enough space,
-     * the data from the last succesful read in each direction is transferred
+     * the data from the last successful read in each direction is transferred
      * before close */
     do {
        int clear_read_select = 0, clear_write_select = 0,