提交 c7ac31e2 编写于 作者: B Bodo Möller

Bugfix: s_client occasionally would sleep in select() when it should

have checked SSL_pending() first.
Submitted by:
Reviewed by:
PR:
上级 9d892e28
...@@ -5,6 +5,10 @@ ...@@ -5,6 +5,10 @@
Changes between 0.9.2b and 0.9.3 Changes between 0.9.2b and 0.9.3
*) Bugfix: s_client occasionally would sleep in select() when
it should have checked SSL_pending() first.
[Bodo Moeller]
*) New functions DSA_do_sign and DSA_do_verify to provide access to *) New functions DSA_do_sign and DSA_do_verify to provide access to
the raw DSA values prior to ASN.1 encoding. the raw DSA values prior to ASN.1 encoding.
[Ulf Möller] [Ulf Möller]
......
...@@ -154,7 +154,7 @@ char **argv; ...@@ -154,7 +154,7 @@ char **argv;
char *cert_file=NULL,*key_file=NULL; char *cert_file=NULL,*key_file=NULL;
char *CApath=NULL,*CAfile=NULL,*cipher=NULL; char *CApath=NULL,*CAfile=NULL,*cipher=NULL;
int reconnect=0,badop=0,verify=SSL_VERIFY_NONE,bugs=0; int reconnect=0,badop=0,verify=SSL_VERIFY_NONE,bugs=0;
int write_tty,read_tty,write_ssl,read_ssl,tty_on; int write_tty,read_tty,write_ssl,read_ssl,tty_on,ssl_pending;
SSL_CTX *ctx=NULL; SSL_CTX *ctx=NULL;
int ret=1,in_init=1,i,nbio_test=0; int ret=1,in_init=1,i,nbio_test=0;
SSL_METHOD *meth=NULL; SSL_METHOD *meth=NULL;
...@@ -439,7 +439,11 @@ re_start: ...@@ -439,7 +439,11 @@ re_start:
} }
} }
ssl_pending = read_ssl && SSL_pending(con);
if (!ssl_pending)
#ifndef WINDOWS #ifndef WINDOWS
{
if (tty_on) if (tty_on)
{ {
if (read_tty) FD_SET(fileno(stdin),&readfds); if (read_tty) FD_SET(fileno(stdin),&readfds);
...@@ -462,8 +466,9 @@ re_start: ...@@ -462,8 +466,9 @@ re_start:
goto shut; goto shut;
/* goto end; */ /* goto end; */
} }
}
if (FD_ISSET(SSL_get_fd(con),&writefds)) if (!ssl_pending && FD_ISSET(SSL_get_fd(con),&writefds))
{ {
k=SSL_write(con,&(cbuf[cbuf_off]), k=SSL_write(con,&(cbuf[cbuf_off]),
(unsigned int)cbuf_len); (unsigned int)cbuf_len);
...@@ -531,7 +536,7 @@ re_start: ...@@ -531,7 +536,7 @@ re_start:
} }
} }
#ifndef WINDOWS #ifndef WINDOWS
else if (FD_ISSET(fileno(stdout),&writefds)) else if (!ssl_pending && FD_ISSET(fileno(stdout),&writefds))
{ {
i=write(fileno(stdout),&(sbuf[sbuf_off]),sbuf_len); i=write(fileno(stdout),&(sbuf[sbuf_off]),sbuf_len);
...@@ -551,7 +556,7 @@ re_start: ...@@ -551,7 +556,7 @@ re_start:
} }
} }
#endif #endif
else if (FD_ISSET(SSL_get_fd(con),&readfds)) else if (ssl_pending || FD_ISSET(SSL_get_fd(con),&readfds))
{ {
#ifdef RENEG #ifdef RENEG
{ static int iiii; if (++iiii == 52) { SSL_renegotiate(con); iiii=0; } } { static int iiii; if (++iiii == 52) { SSL_renegotiate(con); iiii=0; } }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册