diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2010-01-26 19:46:30 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2010-01-26 19:46:30 +0000 |
commit | 57749b1b9fd48d068790a16b20d46c7d524c43ea (patch) | |
tree | 22fa2ce5b44559ffb6b68e376f29903cc62181da /ssl/d1_srvr.c | |
parent | 1cdb7854a513b29545135496a51dc02d00088f69 (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/d1_srvr.c')
-rw-r--r-- | ssl/d1_srvr.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/ssl/d1_srvr.c b/ssl/d1_srvr.c index c11e75abf9..eead971d25 100644 --- a/ssl/d1_srvr.c +++ b/ssl/d1_srvr.c @@ -147,7 +147,6 @@ int dtls1_accept(SSL *s) BUF_MEM *buf; unsigned long Time=(unsigned long)time(NULL); void (*cb)(const SSL *ssl,int type,int val)=NULL; - long num1; unsigned long alg_k; int ret= -1; int new_state,state,skip=0; @@ -453,17 +452,14 @@ int dtls1_accept(SSL *s) s->init_num=0; break; - case SSL3_ST_SW_FLUSH: - /* number of bytes to be flushed */ - num1=BIO_ctrl(s->wbio,BIO_CTRL_INFO,0,NULL); - if (num1 > 0) + case SSL3_ST_CW_FLUSH: + 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; |