mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
macOS: Support infinite timeouts for URL connections
This commit is contained in:
parent
f93cdf431a
commit
efd0373525
1 changed files with 9 additions and 1 deletions
|
|
@ -1106,9 +1106,17 @@ private:
|
|||
|
||||
if (NSURL* nsURL = [NSURL URLWithString: juceStringToNS (url.toString (! addParametersToRequestBody))])
|
||||
{
|
||||
const auto timeOutSeconds = [this]
|
||||
{
|
||||
if (timeOutMs > 0)
|
||||
return timeOutMs / 1000.0;
|
||||
|
||||
return timeOutMs < 0 ? std::numeric_limits<double>::infinity() : 60.0;
|
||||
}();
|
||||
|
||||
if (NSMutableURLRequest* req = [NSMutableURLRequest requestWithURL: nsURL
|
||||
cachePolicy: NSURLRequestReloadIgnoringLocalCacheData
|
||||
timeoutInterval: timeOutMs <= 0 ? 60.0 : (timeOutMs / 1000.0)])
|
||||
timeoutInterval: timeOutSeconds])
|
||||
{
|
||||
if (NSString* httpMethod = [NSString stringWithUTF8String: httpRequestCmd.toRawUTF8()])
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue