提交 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
...@@ -861,10 +861,10 @@ int s_client_main(int argc, char **argv) ...@@ -861,10 +861,10 @@ int s_client_main(int argc, char **argv)
int c_nbio = 0, c_msg = 0, c_ign_eof = 0, c_brief = 0; int c_nbio = 0, c_msg = 0, c_ign_eof = 0, c_brief = 0;
int c_tlsextdebug = 0, c_status_req = 0; int c_tlsextdebug = 0, c_status_req = 0;
BIO *bio_c_msg = NULL; BIO *bio_c_msg = NULL;
#if defined(OPENSSL_SYS_VMS) #if defined(OPENSSL_SYS_VMS)
int stdin_sock; int stdin_sock;
TerminalSocket(TERM_SOCK_CREATE, &stdin_sock); TerminalSocket(TERM_SOCK_CREATE, &stdin_sock);
#endif #endif
FD_ZERO(&readfds); FD_ZERO(&readfds);
FD_ZERO(&writefds); FD_ZERO(&writefds);
...@@ -1828,12 +1828,12 @@ int s_client_main(int argc, char **argv) ...@@ -1828,12 +1828,12 @@ int s_client_main(int argc, char **argv)
SSL_set_connect_state(con); SSL_set_connect_state(con);
/* ok, lets connect */ /* ok, lets connect */
#if defined(OPENSSL_SYS_VMS) #if defined(OPENSSL_SYS_VMS)
if (stdin_sock > SSL_get_fd(con)) if (stdin_sock > SSL_get_fd(con))
width = stdin_sock + 1; width = stdin_sock + 1;
else else
width = SSL_get_fd(con) + 1; width = SSL_get_fd(con) + 1;
#else #else
width = SSL_get_fd(con) + 1; width = SSL_get_fd(con) + 1;
#endif #endif
read_tty = 1; read_tty = 1;
...@@ -2296,7 +2296,7 @@ int s_client_main(int argc, char **argv) ...@@ -2296,7 +2296,7 @@ int s_client_main(int argc, char **argv)
goto shut; goto shut;
} }
} }
#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_VMS) #if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_VMS)
/* Assume Windows/DOS/BeOS can always write */ /* Assume Windows/DOS/BeOS can always write */
else if (!ssl_pending && write_tty) else if (!ssl_pending && write_tty)
#else #else
...@@ -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,14 +2417,13 @@ int s_client_main(int argc, char **argv) ...@@ -2422,14 +2417,13 @@ 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)
at_eof = 1; at_eof = 1;
...@@ -2514,7 +2508,7 @@ int s_client_main(int argc, char **argv) ...@@ -2514,7 +2508,7 @@ int s_client_main(int argc, char **argv)
bio_c_out = NULL; bio_c_out = NULL;
BIO_free(bio_c_msg); BIO_free(bio_c_msg);
bio_c_msg = NULL; bio_c_msg = NULL;
#if defined(OPENSSL_SYS_VMS) #if defined(OPENSSL_SYS_VMS)
TerminalSocket(TERM_SOCK_DELETE, &stdin_sock); TerminalSocket(TERM_SOCK_DELETE, &stdin_sock);
#endif #endif
return (ret); return (ret);
......
...@@ -2012,9 +2012,9 @@ static int sv_body(int s, int stype, unsigned char *context) ...@@ -2012,9 +2012,9 @@ static int sv_body(int s, int stype, unsigned char *context)
#else #else
struct timeval *timeoutp; struct timeval *timeoutp;
#endif #endif
#if defined(OPENSSL_SYS_VMS) #if defined(OPENSSL_SYS_VMS)
int stdin_sock; int stdin_sock;
TerminalSocket (TERM_SOCK_CREATE, &stdin_sock); TerminalSocket (TERM_SOCK_CREATE, &stdin_sock);
#endif #endif
buf = app_malloc(bufsize, "server buffer"); buf = app_malloc(bufsize, "server buffer");
...@@ -2117,13 +2117,13 @@ static int sv_body(int s, int stype, unsigned char *context) ...@@ -2117,13 +2117,13 @@ static int sv_body(int s, int stype, unsigned char *context)
} }
#if defined(OPENSSL_SYS_VMS) #if defined(OPENSSL_SYS_VMS)
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,12 +2194,12 @@ static int sv_body(int s, int stype, unsigned char *context) ...@@ -2194,12 +2194,12 @@ 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++)
if (buf[j] == '\n') if (buf[j] == '\n')
...@@ -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");
...@@ -2299,7 +2300,7 @@ static int sv_body(int s, int stype, unsigned char *context) ...@@ -2299,7 +2300,7 @@ static int sv_body(int s, int stype, unsigned char *context)
srp_callback_parm.user = srp_callback_parm.user =
SRP_VBASE_get1_by_user(srp_callback_parm.vb, SRP_VBASE_get1_by_user(srp_callback_parm.vb,
srp_callback_parm.login); srp_callback_parm.login);
if (srp_callback_parm.user) if (srp_callback_parm.user)
BIO_printf(bio_s_out, "LOOKUP done %s\n", BIO_printf(bio_s_out, "LOOKUP done %s\n",
srp_callback_parm.user->info); srp_callback_parm.user->info);
else else
...@@ -2432,8 +2433,8 @@ static int sv_body(int s, int stype, unsigned char *context) ...@@ -2432,8 +2433,8 @@ static int sv_body(int s, int stype, unsigned char *context)
OPENSSL_clear_free(buf, bufsize); OPENSSL_clear_free(buf, bufsize);
if (ret >= 0) if (ret >= 0)
BIO_printf(bio_s_out, "ACCEPT\n"); BIO_printf(bio_s_out, "ACCEPT\n");
#if defined(OPENSSL_SYS_VMS) #if defined(OPENSSL_SYS_VMS)
TerminalSocket (TERM_SOCK_DELETE, &stdin_sock); TerminalSocket (TERM_SOCK_DELETE, &stdin_sock);
#endif #endif
(void)BIO_flush(bio_s_out); (void)BIO_flush(bio_s_out);
return (ret); return (ret);
......
此差异已折叠。
...@@ -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.
先完成此消息的编辑!
想要评论请 注册