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.
This commit is contained in:
Dr. Stephen Henson
2010-01-26 19:46:30 +00:00
parent 1cdb7854a5
commit 57749b1b9f
4 changed files with 30 additions and 48 deletions

View File

@@ -184,7 +184,6 @@ int ssl3_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;
@@ -520,16 +519,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;