提交 c7bdb6a3 编写于 作者: R Richard Levitte

Reformat to fit OpenSSL source code standards

Reviewed-by: NAndy Polyakov <appro@openssl.org>
Reviewed-by: NRich Salz <rsalz@openssl.org>
上级 0d0723e8
...@@ -2388,25 +2388,20 @@ int s_client_main(int argc, char **argv) ...@@ -2388,25 +2388,20 @@ int s_client_main(int argc, char **argv)
/* OPENSSL_SYS_MSDOS includes OPENSSL_SYS_WINDOWS */ /* OPENSSL_SYS_MSDOS includes OPENSSL_SYS_WINDOWS */
#if defined(OPENSSL_SYS_MSDOS) #if defined(OPENSSL_SYS_MSDOS)
else if (has_stdin_waiting()) else if (has_stdin_waiting())
#elif defined(OPENSSL_SYS_VMS)
else if (FD_ISSET(stdin_sock, &readfds))
#else #else
else if (FD_ISSET(fileno(stdin), &readfds))
#if defined(OPENSSL_SYS_VMS)
else if (FD_ISSET(stdin_sock,&readfds))
#else
else if (FD_ISSET(fileno(stdin),&readfds))
#endif
#endif #endif
{ {
if (crlf) { if (crlf) {
int j, lf_num; int j, lf_num;
#if defined(OPENSSL_SYS_VMS)
i = recv(stdin_sock, cbuf, BUFSIZZ / 2, 0);
#else
i = raw_read_stdin(cbuf, BUFSIZZ / 2); i = raw_read_stdin(cbuf, BUFSIZZ / 2);
#if defined(OPENSSL_SYS_VMS) #endif
i = recv(stdin_sock, cbuf, BUFSIZZ/2, 0);
#else
i = raw_read_stdin(cbuf, BUFSIZZ/2);
#endif
lf_num = 0; lf_num = 0;
/* both loops are skipped when i <= 0 */ /* both loops are skipped when i <= 0 */
...@@ -2422,13 +2417,12 @@ int s_client_main(int argc, char **argv) ...@@ -2422,13 +2417,12 @@ int s_client_main(int argc, char **argv)
} }
} }
assert(lf_num == 0); assert(lf_num == 0);
} else } else {
{ #if defined(OPENSSL_SYS_VMS)
#if defined(OPENSSL_SYS_VMS)
i = recv(stdin_sock, cbuf, BUFSIZZ, 0); i = recv(stdin_sock, cbuf, BUFSIZZ, 0);
#else #else
i = raw_read_stdin(cbuf, BUFSIZZ); i = raw_read_stdin(cbuf, BUFSIZZ);
#endif #endif
} }
#if !defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYS_MSDOS) #if !defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYS_MSDOS)
if (i == 0) if (i == 0)
......
...@@ -2121,9 +2121,9 @@ static int sv_body(int s, int stype, unsigned char *context) ...@@ -2121,9 +2121,9 @@ static int sv_body(int s, int stype, unsigned char *context)
if (stdin_sock > s) if (stdin_sock > s)
width = stdin_sock + 1; width = stdin_sock + 1;
else else
width=s+1; width = s + 1;
#else #else
width=s+1; width = s + 1;
#endif #endif
for (;;) { for (;;) {
int read_from_terminal; int read_from_terminal;
...@@ -2136,11 +2136,11 @@ static int sv_body(int s, int stype, unsigned char *context) ...@@ -2136,11 +2136,11 @@ static int sv_body(int s, int stype, unsigned char *context)
if (!read_from_sslcon) { if (!read_from_sslcon) {
FD_ZERO(&readfds); FD_ZERO(&readfds);
#if !defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYS_MSDOS) #if !defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYS_MSDOS)
# if defined(OPENSSL_SYS_VMS) # if defined(OPENSSL_SYS_VMS)
openssl_fdset(stdin_sock,&readfds); openssl_fdset(stdin_sock, &readfds);
# else # else
openssl_fdset(stdin),&readfds); openssl_fdset(fileno(stdin), &readfds);
#endif # endif
#endif #endif
openssl_fdset(s, &readfds); openssl_fdset(s, &readfds);
/* /*
...@@ -2180,11 +2180,11 @@ static int sv_body(int s, int stype, unsigned char *context) ...@@ -2180,11 +2180,11 @@ static int sv_body(int s, int stype, unsigned char *context)
if (i <= 0) if (i <= 0)
continue; continue;
#if defined(OPENSSL_SYS_VMS) # if defined(OPENSSL_SYS_VMS)
if (FD_ISSET(stdin_sock,&readfds)) if (FD_ISSET(stdin_sock, &readfds))
#else # else
if (FD_ISSET(fileno(stdin),&readfds)) if (FD_ISSET(fileno(stdin), &readfds))
#endif # endif
read_from_terminal = 1; read_from_terminal = 1;
#endif #endif
if (FD_ISSET(s, &readfds)) if (FD_ISSET(s, &readfds))
...@@ -2194,11 +2194,11 @@ static int sv_body(int s, int stype, unsigned char *context) ...@@ -2194,11 +2194,11 @@ static int sv_body(int s, int stype, unsigned char *context)
if (s_crlf) { if (s_crlf) {
int j, lf_num; int j, lf_num;
#if defined(OPENSSL_SYS_VMS) #if defined(OPENSSL_SYS_VMS)
i=recv(stdin_sock, buf, bufsize/2, 0); i=recv(stdin_sock, buf, bufsize / 2, 0);
#else #else
i = raw_read_stdin(buf, bufsize / 2) i = raw_read_stdin(buf, bufsize / 2);
#endif #endif
lf_num = 0; lf_num = 0;
/* both loops are skipped when i <= 0 */ /* both loops are skipped when i <= 0 */
for (j = 0; j < i; j++) for (j = 0; j < i; j++)
...@@ -2213,12 +2213,13 @@ static int sv_body(int s, int stype, unsigned char *context) ...@@ -2213,12 +2213,13 @@ static int sv_body(int s, int stype, unsigned char *context)
} }
} }
assert(lf_num == 0); assert(lf_num == 0);
} else } else {
#if defined(OPENSSL_SYS_VMS) #if defined(OPENSSL_SYS_VMS)
i=recv(stdin_sock,buf,bufsize, 0); i = recv(stdin_sock, buf, bufsize, 0);
#else #else
i = raw_read_stdin(buf, bufsize); i = raw_read_stdin(buf, bufsize);
#endif #endif
}
if (!s_quiet && !s_brief) { if (!s_quiet && !s_brief) {
if ((i <= 0) || (buf[0] == 'Q')) { if ((i <= 0) || (buf[0] == 'Q')) {
BIO_printf(bio_s_out, "DONE\n"); BIO_printf(bio_s_out, "DONE\n");
......
此差异已折叠。
...@@ -8,19 +8,19 @@ ...@@ -8,19 +8,19 @@
*/ */
#ifndef TERM_SOCK_H #ifndef TERM_SOCK_H
#define TERM_SOCK_H # define TERM_SOCK_H
/* /*
** Terminal Socket Function Codes ** Terminal Socket Function Codes
*/ */
#define TERM_SOCK_CREATE 1 # define TERM_SOCK_CREATE 1
#define TERM_SOCK_DELETE 2 # define TERM_SOCK_DELETE 2
/* /*
** Terminal Socket Status Codes ** Terminal Socket Status Codes
*/ */
#define TERM_SOCK_FAILURE 0 # define TERM_SOCK_FAILURE 0
#define TERM_SOCK_SUCCESS 1 # define TERM_SOCK_SUCCESS 1
/* /*
** Terminal Socket Prototype ** Terminal Socket Prototype
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册