From 06e7b8cd9beeeec939a8d46cc1223fc2e272080b Mon Sep 17 00:00:00 2001 From: Sergey Yershov Date: Tue, 1 Mar 2016 16:02:08 +0300 Subject: [PATCH] Raise error if no space left on device --- platform/http_thread_apple.mm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/platform/http_thread_apple.mm b/platform/http_thread_apple.mm index a3ed5e102c..5f6f54e208 100644 --- a/platform/http_thread_apple.mm +++ b/platform/http_thread_apple.mm @@ -188,7 +188,11 @@ static id downloadIndicator = nil; UNUSED_VALUE(connection); int64_t const length = [data length]; m_downloadedBytes += length; - m_callback->OnWrite(m_begRange + m_downloadedBytes - length, [data bytes], length); + if(!m_callback->OnWrite(m_begRange + m_downloadedBytes - length, [data bytes], length)) + { + [m_connection cancel]; + m_callback->OnFinish(-1, m_begRange, m_endRange); + } } - (void) connection:(NSURLConnection *)connection didFailWithError:(NSError *)error