FileDownloader icon indicating copy to clipboard operation
FileDownloader copied to clipboard

Bug in FetchDataTask [1.7.6]

Open mseroczynski opened this issue 6 years ago • 8 comments

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:

            if (hostRunnable != null && !isSupportSeek) {
                throw new IllegalAccessException(
                        "can't using multi-download when the output stream can't support seek");
            }

Why using hostRunnable crashes out entire downloading (no multi-connection)? Can this be fixed soon?

mseroczynski avatar Mar 25 '19 10:03 mseroczynski

So you custom OutputStreamCreator and you don't support seek? if so, you need custom a ConnectionCountAdapter and force connection count to 1.

rantianhua avatar Aug 21 '19 12:08 rantianhua

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

mseroczynski avatar Aug 21 '19 12:08 mseroczynski

Oh, sorry with my misoperation. I'm asking you the way you use FileDownloader.

rantianhua avatar Aug 22 '19 00:08 rantianhua

So, can you show me how do you custom the OutputStreamCreator ?

rantianhua avatar Aug 22 '19 00:08 rantianhua

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?

rantianhua avatar Aug 22 '19 00:08 rantianhua

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?

mseroczynski avatar Aug 22 '19 07:08 mseroczynski

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.

rantianhua avatar Aug 31 '19 09:08 rantianhua

//            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.

mseroczynski avatar Dec 03 '19 10:12 mseroczynski