]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
If gnutls_record_send fails with GNUTLS_E_AGAIN or GNUTLS_E_INTERRUPTED, the document...
authorTim Kosse <tim.kosse@filezilla-project.org>
Fri, 10 May 2013 17:49:38 +0000 (19:49 +0200)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Sat, 11 May 2013 07:49:41 +0000 (09:49 +0200)
Commit 2ec84d6 broke this usage of gnutls_record_send. This patch fixes the problem.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
lib/gnutls_record.c

index eea9372f5e62e4a9254cd39550214768883cacd6..ca9376e7abc3726bb09d79a84463647ac38aa65e 100644 (file)
@@ -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);