mirror of
https://github.com/gnustep/libs-base.git
synced 2025-06-02 17:41:05 +00:00
NSURLSession: implement missing body data for data completion handlers
Now using the previously unused "in-memory" body data drain if a task has a completion handler, which requires the full body to be passed on completion. Also consolidated private NSURLSessionTask methods, some of which were previously implemented twice in separate categories with the same name, leading to possible undefined runtime behavior.
This commit is contained in:
parent
153482ea94
commit
82d9917c2c
5 changed files with 138 additions and 131 deletions
|
@ -13,44 +13,8 @@
|
|||
#import "Foundation/NSStream.h"
|
||||
#import "Foundation/NSURL.h"
|
||||
#import "Foundation/NSURLError.h"
|
||||
#import "Foundation/NSURLSession.h"
|
||||
#import "Foundation/NSValue.h"
|
||||
|
||||
|
||||
@interface NSURLSessionTask (Internal)
|
||||
|
||||
- (void) setCountOfBytesExpectedToReceive: (int64_t)count;
|
||||
|
||||
- (void) setCountOfBytesExpectedToSend: (int64_t)count;
|
||||
|
||||
- (dispatch_queue_t) workQueue;
|
||||
|
||||
@end
|
||||
|
||||
@implementation NSURLSessionTask (Internal)
|
||||
|
||||
- (void) setCountOfBytesExpectedToReceive: (int64_t)count
|
||||
{
|
||||
_countOfBytesExpectedToReceive = count;
|
||||
}
|
||||
|
||||
- (void) setCountOfBytesExpectedToSend: (int64_t)count
|
||||
{
|
||||
_countOfBytesExpectedToSend = count;
|
||||
}
|
||||
|
||||
- (GSURLSessionTaskBody*) knownBody
|
||||
{
|
||||
return _knownBody;
|
||||
}
|
||||
|
||||
- (dispatch_queue_t) workQueue
|
||||
{
|
||||
return _workQueue;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@interface GSURLCacherHelper : NSObject
|
||||
|
||||
+ (BOOL) canCacheResponse: (NSCachedURLResponse*)response
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue