mirror of https://github.com/axmolengine/axmol.git
fix downloader will not be conitnue (#17761)
if already has started six data task, then start 7th task will suspend, it will not be run
This commit is contained in:
parent
58b8e77d74
commit
59f9c35f34
|
@ -62,6 +62,12 @@ class DataTaskHandler extends BinaryHttpResponseHandler {
|
|||
LogD("onSuccess(i:" + i + " headers:" + headers);
|
||||
_downloader.onFinish(_id, 0, null, binaryData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinish() {
|
||||
// onFinish called after onSuccess/onFailure
|
||||
_downloader.runNextTaskIfExists();
|
||||
}
|
||||
}
|
||||
|
||||
class HeadTaskHandler extends AsyncHttpResponseHandler {
|
||||
|
@ -98,6 +104,12 @@ class HeadTaskHandler extends AsyncHttpResponseHandler {
|
|||
Cocos2dxDownloader.createTask(_downloader, _id, _url, _path);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinish() {
|
||||
// onFinish called after onSuccess/onFailure
|
||||
_downloader.runNextTaskIfExists();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(int statusCode, Header[] headers, byte[] responseBody, Throwable throwable) {
|
||||
LogD("onFailure(code:" + statusCode + " headers:" + headers + " throwable:" + throwable + " id:" + _id);
|
||||
|
|
Loading…
Reference in New Issue