Merge changes for NSURLSession from EngageHub (formerly Brainstorm).

This commit is contained in:
Richard Frith-Macdonald 2020-11-29 06:57:47 -05:00
parent d015cebbf3
commit 1b7bf26bea
70 changed files with 7980 additions and 192 deletions

View file

@ -39,6 +39,7 @@ typedef struct {
NSMutableDictionary *headers;
BOOL shouldHandleCookies;
BOOL debug;
id<GSLogDelegate> ioDelegate;
NSURL *URL;
NSURL *mainDocumentURL;
NSURLRequestCachePolicy cachePolicy;
@ -116,6 +117,7 @@ typedef struct {
ASSIGN(inst->method, this->method);
inst->shouldHandleCookies = this->shouldHandleCookies;
inst->debug = this->debug;
inst->ioDelegate = this->ioDelegate;
inst->headers = [this->headers mutableCopy];
}
}
@ -284,6 +286,16 @@ typedef struct {
return old;
}
- (id<GSLogDelegate>) setDebugLogDelegate: (id<GSLogDelegate>)d
{
id<GSLogDelegate> old = this->ioDelegate;
NSAssert(nil == d || [d conformsToProtocol: @protocol(GSLogDelegate)],
NSInvalidArgumentException);
this->ioDelegate = d;
return old;
}
- (NSTimeInterval) timeoutInterval
{
return this->timeoutInterval;
@ -444,6 +456,11 @@ typedef struct {
return this->debug;
}
- (id<GSLogDelegate>) _debugLogDelegate
{
return this->ioDelegate;
}
- (id) _propertyForKey: (NSString*)key
{
return [this->properties objectForKey: key];