Open mseroczynski opened 5 years ago
So you custom OutputStreamCreator
and you don't support seek? if so, you need custom a ConnectionCountAdapter
and force connection count to 1.
Shouldn't it be logic implemented in library itself?
Are you 100% sure there is nothing to do in library and task should be closed? @rantianhua
Oh, sorry with my misoperation. I'm asking you the way you use FileDownloader.
So, can you show me how do you custom the OutputStreamCreator
?
You said:
Every one of these items is correctly configured NOT TO use multi-connection
How do you configure items don't use multi-connection?
I'm using my OutputStreamCreator to encrypt on the fly but aren't you supposed to disable multi connection for all downloads with isSeekable = false?
Actually, Filedownloader will use single connection if the output stream doesn't support seek:
private boolean isMultiConnectionAvailable() {
//noinspection SimplifiableIfStatement
if (isResumeAvailableOnDB && model.getConnectionCount() <= 1) {
return false;
}
return acceptPartial && supportSeek && !isChunked;
}
So, I need the whole FileDownloader log to check what's the problem.
// if (hostRunnable != null && !isSupportSeek) {
// throw new IllegalAccessException(
// "can't using multi-download when the output stream can't support seek");
// }
This code breaks it. It throws an exception even though i'm NOT using multi-download.
I am using BaseDownloadTask and manage queue on my own. Every one of these items is correctly configured NOT TO use multi-connection (because of encryption with FileBufferedOutputStream), even though i can't download them because of below condition:
Why using hostRunnable crashes out entire downloading (no multi-connection)? Can this be fixed soon?