diff options
author | Sergey Yershov <yershov@corp.mail.ru> | 2016-03-01 16:02:08 +0300 |
---|---|---|
committer | Sergey Yershov <yershov@corp.mail.ru> | 2016-03-23 16:50:44 +0300 |
commit | 06e7b8cd9beeeec939a8d46cc1223fc2e272080b (patch) | |
tree | 6ea3e19a50574a7236f631e9cf2654364ec0c552 /platform | |
parent | 4e879b28da332d5e0c50bf297e46ef207198c99e (diff) |
Raise error if no space left on device
Diffstat (limited to 'platform')
-rw-r--r-- | platform/http_thread_apple.mm | 6 |
1 files changed, 5 insertions, 1 deletions
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<DownloadIndicatorProtocol> 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 |