]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Make sure we don't fail if writing gets interrupted
authorAlfredo Pironti <alfredo@pironti.eu>
Thu, 24 Jan 2013 12:46:15 +0000 (13:46 +0100)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Mon, 4 Feb 2013 08:28:41 +0000 (09:28 +0100)
lib/gnutls_range.c

index 422fc996d9e19cdc918545d9730db063d9e47401..f3d798b80d11ca7ca27297d8b41a187f791d580a 100644 (file)
@@ -281,6 +281,15 @@ gnutls_record_send_range (gnutls_session_t session, const void *data,
                                    next_fragment_length, 
                                    cur_range.high,
                                    MBUFFER_FLUSH);
+
+      while (ret == GNUTLS_E_AGAIN || ret == GNUTLS_E_INTERRUPTED)
+        {
+         ret = _gnutls_send_tlen_int (session, GNUTLS_APPLICATION_DATA, -1,
+                                                                  EPOCH_WRITE_CURRENT,
+                                                                  NULL, 0, 0,
+                                                                  MBUFFER_FLUSH);
+        }
+
       if (ret < 0)
         {
           return ret;           /* already gnutls_assert_val'd */