FS-6683: [mod_dingaling] iksemel TLS-Fragments #resolve

This commit is contained in:
Brian West 2017-02-03 17:29:46 -06:00
parent 52728c253c
commit 9b2ad94b6a
1 changed files with 6 additions and 1 deletions

View File

@ -785,7 +785,9 @@ iks_recv (iksparser *prs, int timeout)
#ifdef HAVE_GNUTLS
if (data->flags & SF_SECURE) {
len = gnutls_record_recv (data->sess, data->buf, NET_IO_BUF_SIZE - 1);
if (len == 0) len = -1;
if (len > 0 && len < 5) {
len += gnutls_record_recv (data->sess, data->buf + len, NET_IO_BUF_SIZE - 1 - len);
} else if (len == 0) len = -1;
} else
#elif HAVE_SSL
if (data->flags & SF_SECURE) {
@ -797,6 +799,9 @@ iks_recv (iksparser *prs, int timeout)
return IKS_OK;
} else {
len = SSL_read(data->ssl, data->buf, NET_IO_BUF_SIZE - 1);
if (len > 0 && len < 5) {
len += SSL_read(data->ssl, data->buf + len, NET_IO_BUF_SIZE - 1 - len);
}
}
if( len <= 0 )