Fixed to keep reading data until the SSL internal buffer is empty.

Before this fix only 2048 bytes were read,
the rest were buffered inside SSL until another message arrived!!!
This commit is contained in:
David Galeano 2013-01-10 10:35:32 +08:00 committed by Andy Green
parent 4fbc40c07d
commit 7ffbe1bfca

View file

@ -1998,6 +1998,7 @@ bail3:
break;
#ifdef LWS_OPENSSL_SUPPORT
read_pending:
if (wsi->ssl)
eff_buf.token_len = SSL_read(wsi->ssl, buf, sizeof buf);
else
@ -2070,6 +2071,11 @@ bail3:
eff_buf.token = NULL;
eff_buf.token_len = 0;
}
#ifdef LWS_OPENSSL_SUPPORT
if (wsi->ssl && SSL_pending(wsi->ssl))
goto read_pending;
#endif
break;
}