From: Brian West Date: Fri, 3 Feb 2017 23:29:46 +0000 (-0600) Subject: FS-6683: [mod_dingaling] iksemel TLS-Fragments #resolve X-Git-Tag: v1.8.0~871 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9b2ad94b6ad7ba9fb66269c1d20aa772e6a9e14a;p=thirdparty%2Ffreeswitch.git FS-6683: [mod_dingaling] iksemel TLS-Fragments #resolve --- diff --git a/libs/iksemel/src/stream.c b/libs/iksemel/src/stream.c index eda6cb0fe7..a35f29223a 100644 --- a/libs/iksemel/src/stream.c +++ b/libs/iksemel/src/stream.c @@ -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 )