summaryrefslogtreecommitdiffstats
path: root/apps/s_server.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2016-09-14 20:54:30 +0200
committerRichard Levitte <richard@levitte.org>2016-09-15 23:28:23 +0200
commit34b3563243d49ba6f551adb39038695b9fb66b49 (patch)
treef664bf21b23f6994c8d8ab9a6b68fb8525bc371a /apps/s_server.c
parent07ebdfab079d1efc2d65e15f9f541fa1861ed4ff (diff)
Reformat to fit OpenSSL source code standards
Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit c7bdb6a31ff0fcae66b451d3f80a684ad77f4966)
Diffstat (limited to 'apps/s_server.c')
-rw-r--r--apps/s_server.c69
1 files changed, 35 insertions, 34 deletions
diff --git a/apps/s_server.c b/apps/s_server.c
index d9a427897b..060a0bb24f 100644
--- a/apps/s_server.c
+++ b/apps/s_server.c
@@ -2012,9 +2012,9 @@ static int sv_body(int s, int stype, unsigned char *context)
#else
struct timeval *timeoutp;
#endif
-#if defined(OPENSSL_SYS_VMS)
- int stdin_sock;
- TerminalSocket (TERM_SOCK_CREATE, &stdin_sock);
+#if defined(OPENSSL_SYS_VMS)
+ int stdin_sock;
+ TerminalSocket (TERM_SOCK_CREATE, &stdin_sock);
#endif
buf = app_malloc(bufsize, "server buffer");
@@ -2117,13 +2117,13 @@ static int sv_body(int s, int stype, unsigned char *context)
}
-#if defined(OPENSSL_SYS_VMS)
- if (stdin_sock > s)
- width = stdin_sock + 1;
- else
- width=s+1;
-#else
- width=s+1;
+#if defined(OPENSSL_SYS_VMS)
+ if (stdin_sock > s)
+ width = stdin_sock + 1;
+ else
+ width = s + 1;
+#else
+ width = s + 1;
#endif
for (;;) {
int read_from_terminal;
@@ -2136,11 +2136,11 @@ static int sv_body(int s, int stype, unsigned char *context)
if (!read_from_sslcon) {
FD_ZERO(&readfds);
#if !defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYS_MSDOS)
- # if defined(OPENSSL_SYS_VMS)
- openssl_fdset(stdin_sock,&readfds);
- # else
- openssl_fdset(stdin),&readfds);
- #endif
+# if defined(OPENSSL_SYS_VMS)
+ openssl_fdset(stdin_sock, &readfds);
+# else
+ openssl_fdset(fileno(stdin), &readfds);
+# endif
#endif
openssl_fdset(s, &readfds);
/*
@@ -2180,11 +2180,11 @@ static int sv_body(int s, int stype, unsigned char *context)
if (i <= 0)
continue;
-#if defined(OPENSSL_SYS_VMS)
- if (FD_ISSET(stdin_sock,&readfds))
-#else
- if (FD_ISSET(fileno(stdin),&readfds))
-#endif
+# if defined(OPENSSL_SYS_VMS)
+ if (FD_ISSET(stdin_sock, &readfds))
+# else
+ if (FD_ISSET(fileno(stdin), &readfds))
+# endif
read_from_terminal = 1;
#endif
if (FD_ISSET(s, &readfds))
@@ -2194,12 +2194,12 @@ static int sv_body(int s, int stype, unsigned char *context)
if (s_crlf) {
int j, lf_num;
- #if defined(OPENSSL_SYS_VMS)
- i=recv(stdin_sock, buf, bufsize/2, 0);
- #else
- i = raw_read_stdin(buf, bufsize / 2)
- #endif
- lf_num = 0;
+#if defined(OPENSSL_SYS_VMS)
+ i=recv(stdin_sock, buf, bufsize / 2, 0);
+#else
+ i = raw_read_stdin(buf, bufsize / 2);
+#endif
+ lf_num = 0;
/* both loops are skipped when i <= 0 */
for (j = 0; j < i; j++)
if (buf[j] == '\n')
@@ -2213,12 +2213,13 @@ static int sv_body(int s, int stype, unsigned char *context)
}
}
assert(lf_num == 0);
- } else
-#if defined(OPENSSL_SYS_VMS)
- i=recv(stdin_sock,buf,bufsize, 0);
+ } else {
+#if defined(OPENSSL_SYS_VMS)
+ i = recv(stdin_sock, buf, bufsize, 0);
#else
- i = raw_read_stdin(buf, bufsize);
-#endif
+ i = raw_read_stdin(buf, bufsize);
+#endif
+ }
if (!s_quiet && !s_brief) {
if ((i <= 0) || (buf[0] == 'Q')) {
BIO_printf(bio_s_out, "DONE\n");
@@ -2299,7 +2300,7 @@ static int sv_body(int s, int stype, unsigned char *context)
srp_callback_parm.user =
SRP_VBASE_get1_by_user(srp_callback_parm.vb,
srp_callback_parm.login);
- if (srp_callback_parm.user)
+ if (srp_callback_parm.user)
BIO_printf(bio_s_out, "LOOKUP done %s\n",
srp_callback_parm.user->info);
else
@@ -2432,8 +2433,8 @@ static int sv_body(int s, int stype, unsigned char *context)
OPENSSL_clear_free(buf, bufsize);
if (ret >= 0)
BIO_printf(bio_s_out, "ACCEPT\n");
-#if defined(OPENSSL_SYS_VMS)
- TerminalSocket (TERM_SOCK_DELETE, &stdin_sock);
+#if defined(OPENSSL_SYS_VMS)
+ TerminalSocket (TERM_SOCK_DELETE, &stdin_sock);
#endif
(void)BIO_flush(bio_s_out);
return (ret);