Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increases a single network request in batchRequest for a successful or failed callback #415

Open
wants to merge 25 commits into
base: changelog
Choose a base branch
from
Open
Changes from 2 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
cfabe70
ADD: reset manager with custom configuration
ll128 Sep 26, 2016
7c3e604
MOD: bump version to 2.0.2
ll128 Sep 26, 2016
3bda051
ADD: github template
skyline75489 Oct 15, 2016
2dae897
ADD: pull request template
skyline75489 Oct 15, 2016
ef2cf80
MOD: better expression
skyline75489 Oct 16, 2016
c9fb60c
MOD: update issue template
skyline75489 Oct 16, 2016
63374a9
MOD: some expression
skyline75489 Oct 16, 2016
87f1f23
MOD: separate test dir
Oct 17, 2016
f479e0e
MOD: move urlString:appendParameter away from main project, fix #239
Oct 17, 2016
923a2bd
MOD: add more assertions, refine logic
Oct 17, 2016
c2feda5
Merge pull request #255 from yuantiku/changelog
maojj Oct 18, 2016
3fbe22c
Merge pull request #258 from skyline75489/github-template
maojj Oct 18, 2016
ba46931
MERGE: merge dev_2.0.0 to master
Oct 18, 2016
277de20
FIX: Download task exist file overwrite and cleanup if fail.
lancy Nov 2, 2016
44d079e
FIX: typo
zy9 Jun 22, 2017
efb9c69
FIX: Save resume data at request cancel.
songzeyao Dec 13, 2016
0f734a1
FIX: typo
skyline75489 Sep 2, 2017
2a93b21
Merge pull request #292 from songzeyao/master
lancy Sep 4, 2017
6089772
Merge pull request #381 from skyline75489/fix/279
lancy Sep 4, 2017
c2effae
Merge pull request #354 from zy9/fix-typo
lancy Sep 4, 2017
b6f58a1
FIX: 2.0_MigrationGuide_cn.md
Huang-Libo May 15, 2017
b84d86b
Merge pull request #339 from Huang-Libo/patch-1
urakalee Sep 5, 2017
a2ad5de
MOD: bump version to 2.0.4
Sep 5, 2017
4030398
Monitoring of any request in multiple network requests
Dec 26, 2017
370f0a2
删除测试文件
Dec 26, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion YTKNetwork/YTKNetworkAgent.m
Original file line number Diff line number Diff line change
@@ -241,7 +241,16 @@ - (void)addRequest:(YTKBaseRequest *)request {
- (void)cancelRequest:(YTKBaseRequest *)request {
NSParameterAssert(request != nil);

[request.requestTask cancel];
if (request.resumableDownloadPath) {
NSURLSessionDownloadTask *requestTask = (NSURLSessionDownloadTask *)request.requestTask;
[requestTask cancelByProducingResumeData:^(NSData *resumeData) {
NSURL *localUrl = [self incompleteDownloadTempPathForDownloadPath:request.resumableDownloadPath];
[resumeData writeToURL:localUrl atomically:YES];
}];
} else {
[request.requestTask cancel];
}

[self removeRequestFromRecord:request];
[request clearCompletionBlock];
}