From 1a1897b43bbec15d8ee65f704fcf7b242e14ef44 Mon Sep 17 00:00:00 2001 From: jules Date: Fri, 5 Aug 2016 15:38:33 +0100 Subject: [PATCH] Made the OSX HTTP stream respond to the return value of the open-stream callback function --- modules/juce_core/native/juce_mac_Network.mm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/juce_core/native/juce_mac_Network.mm b/modules/juce_core/native/juce_mac_Network.mm index afde564fe6..77ee0f6afe 100644 --- a/modules/juce_core/native/juce_mac_Network.mm +++ b/modules/juce_core/native/juce_mac_Network.mm @@ -145,7 +145,8 @@ public: while (isThreadRunning() && ! initialised) { if (callback != nullptr) - callback (context, (int) latestTotalBytes, (int) [[request HTTPBody] length]); + if (! callback (context, (int) latestTotalBytes, (int) [[request HTTPBody] length])) + return false; Thread::sleep (1); } @@ -398,7 +399,8 @@ public: while (isThreadRunning() && ! initialised) { if (callback != nullptr) - callback (context, latestTotalBytes, (int) [[request HTTPBody] length]); + if (! callback (context, latestTotalBytes, (int) [[request HTTPBody] length])) + return false; Thread::sleep (1); }