mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-16 00:34:19 +00:00
Minor tidying up in OSX URL code.
This commit is contained in:
parent
95b94d6d10
commit
4302cd78ec
1 changed files with 9 additions and 20 deletions
|
|
@ -220,20 +220,12 @@ public:
|
|||
|
||||
void run()
|
||||
{
|
||||
NSUInteger oldRetainCount = [delegate retainCount];
|
||||
connection = [[NSURLConnection alloc] initWithRequest: request
|
||||
delegate: delegate];
|
||||
|
||||
if (oldRetainCount == [delegate retainCount])
|
||||
[delegate retain]; // newer SDK should already retain this, but there were problems in older versions..
|
||||
|
||||
if (connection != nil)
|
||||
while (! threadShouldExit())
|
||||
{
|
||||
while (! threadShouldExit())
|
||||
{
|
||||
JUCE_AUTORELEASEPOOL
|
||||
[[NSRunLoop currentRunLoop] runUntilDate: [NSDate dateWithTimeIntervalSinceNow: 0.01]];
|
||||
}
|
||||
JUCE_AUTORELEASEPOOL
|
||||
[[NSRunLoop currentRunLoop] runUntilDate: [NSDate dateWithTimeIntervalSinceNow: 0.01]];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -304,17 +296,14 @@ public:
|
|||
JUCE_AUTORELEASEPOOL
|
||||
createConnection (progressCallback, progressCallbackContext);
|
||||
|
||||
if (responseHeaders != nullptr && connection != nullptr)
|
||||
if (responseHeaders != nullptr && connection != nullptr && connection->headers != nil)
|
||||
{
|
||||
if (connection->headers != nil)
|
||||
{
|
||||
NSEnumerator* enumerator = [connection->headers keyEnumerator];
|
||||
NSString* key;
|
||||
NSEnumerator* enumerator = [connection->headers keyEnumerator];
|
||||
NSString* key;
|
||||
|
||||
while ((key = [enumerator nextObject]) != nil)
|
||||
responseHeaders->set (nsStringToJuce (key),
|
||||
nsStringToJuce ((NSString*) [connection->headers objectForKey: key]));
|
||||
}
|
||||
while ((key = [enumerator nextObject]) != nil)
|
||||
responseHeaders->set (nsStringToJuce (key),
|
||||
nsStringToJuce ((NSString*) [connection->headers objectForKey: key]));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue