From: Alfredo Pironti Date: Thu, 24 Jan 2013 12:46:15 +0000 (+0100) Subject: Make sure we don't fail if writing gets interrupted X-Git-Tag: gnutls_3_1_7~7 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ef58e5c4a7b0c8a33d38e0726ebcda3fc637ee55;p=thirdparty%2Fgnutls.git Make sure we don't fail if writing gets interrupted --- diff --git a/lib/gnutls_range.c b/lib/gnutls_range.c index 422fc996d9..f3d798b80d 100644 --- a/lib/gnutls_range.c +++ b/lib/gnutls_range.c @@ -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 */