From: Tim Kosse Date: Fri, 10 May 2013 17:49:38 +0000 (+0200) Subject: If gnutls_record_send fails with GNUTLS_E_AGAIN or GNUTLS_E_INTERRUPTED, the document... X-Git-Tag: gnutls_3_2_1~54 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0a442f272faee883df1ab907917e35aa5d0ea7a0;p=thirdparty%2Fgnutls.git If gnutls_record_send fails with GNUTLS_E_AGAIN or GNUTLS_E_INTERRUPTED, the documentation allows passing null for the data and size on retry. Commit 2ec84d6 broke this usage of gnutls_record_send. This patch fixes the problem. Signed-off-by: Nikos Mavrogiannopoulos --- diff --git a/lib/gnutls_record.c b/lib/gnutls_record.c index eea9372f5e..ca9376e7ab 100644 --- a/lib/gnutls_record.c +++ b/lib/gnutls_record.c @@ -500,9 +500,6 @@ _gnutls_send_tlen_int (gnutls_session_t session, content_type_t type, else send_data_size = data_size; - if (unlikely(send_data_size == 0)) - return gnutls_assert_val(GNUTLS_E_INTERNAL_ERROR); - /* Only encrypt if we don't have data to send * from the previous run. - probably interrupted. */ @@ -518,6 +515,9 @@ _gnutls_send_tlen_int (gnutls_session_t session, content_type_t type, } else { + if (unlikely(send_data_size == 0)) + return gnutls_assert_val(GNUTLS_E_INTERNAL_ERROR); + /* now proceed to packet encryption */ cipher_size = MAX_RECORD_SEND_SIZE(session);