summaryrefslogtreecommitdiffstats
path: root/ssl/d1_clnt.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2010-01-26 20:47:37 +0100
committerDr. Stephen Henson <steve@openssl.org>2010-01-26 20:47:37 +0100
commitd5e7f2f2c3262c0dbf21363259b0477082c7b98e (patch)
tree0635805e77e1f11e97b7859398501cce0e743e46 /ssl/d1_clnt.c
parentPR: 2138 (diff)
downloadopenssl-d5e7f2f2c3262c0dbf21363259b0477082c7b98e.tar.xz
openssl-d5e7f2f2c3262c0dbf21363259b0477082c7b98e.zip
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/d1_clnt.c')
-rw-r--r--ssl/d1_clnt.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/ssl/d1_clnt.c b/ssl/d1_clnt.c
index 5317a51180..5bc9eb6603 100644
--- a/ssl/d1_clnt.c
+++ b/ssl/d1_clnt.c
@@ -148,7 +148,6 @@ int dtls1_connect(SSL *s)
{
BUF_MEM *buf=NULL;
unsigned long Time=(unsigned long)time(NULL);
- long num1;
void (*cb)(const SSL *ssl,int type,int val)=NULL;
int ret= -1;
int new_state,state,skip=0;;
@@ -511,16 +510,13 @@ int dtls1_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;