Skip to content

Commit

Permalink
ADD: reset manager with custom configuration
Browse files Browse the repository at this point in the history
Change-Id: I782ccf0e88b343b0b01cdd27224df080ebb64a75
  • Loading branch information
ll128 committed Sep 26, 2016
1 parent b107e94 commit cfabe70
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion YTKNetwork/YTKNetworkAgent.m
Expand Up @@ -62,7 +62,7 @@ - (instancetype)init {
self = [super init];
if (self) {
_config = [YTKNetworkConfig sharedConfig];
_manager = [AFHTTPSessionManager manager];
_manager = [[AFHTTPSessionManager alloc] initWithSessionConfiguration:_config.sessionConfiguration];
_requestsRecord = [NSMutableDictionary dictionary];
_processingQueue = dispatch_queue_create("com.yuantiku.networkagent.processing", DISPATCH_QUEUE_CONCURRENT);
_allStatusCodes = [NSIndexSet indexSetWithIndexesInRange:NSMakeRange(100, 500)];
Expand Down
2 changes: 2 additions & 0 deletions YTKNetwork/YTKNetworkConfig.h
Expand Up @@ -70,6 +70,8 @@ NS_ASSUME_NONNULL_BEGIN
@property (strong, nonatomic, readonly) NSArray<id<YTKCacheDirPathFilterProtocol>> *cacheDirPathFilters;
/// Security policy will be used by AFNetworking. See also `AFSecurityPolicy`.
@property (strong, nonatomic) AFSecurityPolicy *securityPolicy;
/// SessionConfiguration will be used to initialize AFHTTPSessionManager. Default is nil.
@property (strong, nonatomic) NSURLSessionConfiguration* sessionConfiguration;

/// Add a new URL filter.
- (void)addUrlFilter:(id<YTKUrlFilterProtocol>)filter;
Expand Down

0 comments on commit cfabe70

Please sign in to comment.