diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2010-01-26 19:40:36 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2010-01-26 19:40:36 +0000 |
commit | cc62974182c4ca65eeba26b07705e3a242ae4580 (patch) | |
tree | 156121b0bb85b50ce7bb9b670b9e2c8232e0c4a8 /ssl/s3_clnt.c | |
parent | 94137885710fe276454f933f9cbfefbe02ead347 (diff) |
PR: 1949
Submitted by: steve@openssl.org
More robust fix and workaround for PR#1949. Don't try to work out if there
is any write pending data as this can be unreliable: always flush.
Diffstat (limited to 'ssl/s3_clnt.c')
-rw-r--r-- | ssl/s3_clnt.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/ssl/s3_clnt.c b/ssl/s3_clnt.c index 9232daf6ba..e5138b6e5e 100644 --- a/ssl/s3_clnt.c +++ b/ssl/s3_clnt.c @@ -167,7 +167,6 @@ int ssl3_connect(SSL *s) { BUF_MEM *buf=NULL; unsigned long Time=(unsigned long)time(NULL),l; - long num1; void (*cb)(const SSL *ssl,int type,int val)=NULL; int ret= -1; int new_state,state,skip=0; @@ -496,16 +495,13 @@ int ssl3_connect(SSL *s) break; case SSL3_ST_CW_FLUSH: - /* number of bytes to be flushed */ - num1=BIO_ctrl(s->wbio,BIO_CTRL_INFO,0,NULL); - if (num1 > 0) + s->rwstate=SSL_WRITING; + if (BIO_flush(s->wbio) <= 0) { - s->rwstate=SSL_WRITING; - num1=BIO_flush(s->wbio); - if (num1 <= 0) { ret= -1; goto end; } - s->rwstate=SSL_NOTHING; + ret= -1; + goto end; } - + s->rwstate=SSL_NOTHING; s->state=s->s3->tmp.next_state; break; |