mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 16:30:41 +00:00
NSURLSession rewrite (#422)
* clang-format: Do not use tabs * Ignore clangd cache and compile_commands * NSBlockOperation: Fix memory leak * NSHTTPCookie: Fix expires date parsing * NSHTTPCookie: Release DateFormatter after use * NSOperation: Remove all objects at end of execution * Reimplementation of NSURLSession * NSURLSession: Update expiration dates in test * Update ChangeLog * Fix trivial compiler warning caused by missing import * Import GSDispatch.h for definition of DISPATCH_QUEUE_SERIAL * Import common.h early to avoid header conflict * Fix import order to avoid conflicts and ensure we have correct localisation macro * Check for presence of dispatch_cancel * Cancel timer using dispatch_source_cancel() if dispatch_cancel() is missing. * NSURLSession: Replace dispatch_io with dispatch_source in unit test HTTP server --------- Co-authored-by: hmelder <service@hugomelder.com>
This commit is contained in:
parent
e3208590b1
commit
a1913e5540
53 changed files with 5410 additions and 7178 deletions
|
@ -39,6 +39,7 @@ typedef struct {
|
|||
NSMutableDictionary *headers;
|
||||
BOOL shouldHandleCookies;
|
||||
BOOL debug;
|
||||
BOOL assumesHTTP3Capable;
|
||||
id<GSLogDelegate> ioDelegate;
|
||||
NSURL *URL;
|
||||
NSURL *mainDocumentURL;
|
||||
|
@ -56,6 +57,9 @@ typedef struct {
|
|||
@interface _GSMutableInsensitiveDictionary : NSMutableDictionary
|
||||
@end
|
||||
|
||||
@interface _GSInsensitiveDictionary : NSMutableDictionary
|
||||
@end
|
||||
|
||||
@implementation NSURLRequest
|
||||
|
||||
+ (id) allocWithZone: (NSZone*)z
|
||||
|
@ -116,6 +120,7 @@ typedef struct {
|
|||
ASSIGN(inst->bodyStream, this->bodyStream);
|
||||
ASSIGN(inst->method, this->method);
|
||||
inst->shouldHandleCookies = this->shouldHandleCookies;
|
||||
inst->assumesHTTP3Capable = this->assumesHTTP3Capable;
|
||||
inst->debug = this->debug;
|
||||
inst->ioDelegate = this->ioDelegate;
|
||||
inst->headers = [this->headers mutableCopy];
|
||||
|
@ -375,6 +380,11 @@ typedef struct {
|
|||
return [this->headers objectForKey: field];
|
||||
}
|
||||
|
||||
- (BOOL) assumesHTTP3Capable
|
||||
{
|
||||
return this->assumesHTTP3Capable;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
@ -454,6 +464,11 @@ typedef struct {
|
|||
}
|
||||
}
|
||||
|
||||
- (void)setAssumesHTTP3Capable:(BOOL)capable
|
||||
{
|
||||
this->assumesHTTP3Capable = capable;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation NSURLRequest (Private)
|
||||
|
@ -468,6 +483,11 @@ typedef struct {
|
|||
return this->ioDelegate;
|
||||
}
|
||||
|
||||
- (NSDictionary *) _insensitiveHeaders
|
||||
{
|
||||
return [this->headers copy];
|
||||
}
|
||||
|
||||
- (id) _propertyForKey: (NSString*)key
|
||||
{
|
||||
return [this->properties objectForKey: key];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue