diff --git a/modules/juce_core/native/juce_mac_Network.mm b/modules/juce_core/native/juce_mac_Network.mm index a0ddef5729..7754e0ba31 100644 --- a/modules/juce_core/native/juce_mac_Network.mm +++ b/modules/juce_core/native/juce_mac_Network.mm @@ -128,7 +128,8 @@ public: hasFailed (false), hasFinished (false), numRedirectsToFollow (maxRedirects), - numRedirects (0) + numRedirects (0), + latestTotalBytes (0) { static DelegateClass cls; delegate = [cls.createInstance() init]; @@ -152,7 +153,7 @@ public: while (isThreadRunning() && ! initialised) { if (callback != nullptr) - callback (context, -1, (int) [[request HTTPBody] length]); + callback (context, latestTotalBytes, (int) [[request HTTPBody] length]); Thread::sleep (1); } @@ -245,8 +246,9 @@ public: initialised = true; } - void didSendBodyData (NSInteger /*totalBytesWritten*/, NSInteger /*totalBytesExpected*/) + void didSendBodyData (NSInteger totalBytesWritten, NSInteger /*totalBytesExpected*/) { + latestTotalBytes = totalBytesWritten; } void finishedLoading() @@ -280,6 +282,7 @@ public: bool initialised, hasFailed, hasFinished; const int numRedirectsToFollow; int numRedirects; + int latestTotalBytes; private: //==============================================================================