okdownload icon indicating copy to clipboard operation
okdownload copied to clipboard

Response code can't handled on internal 200 with current offset

Open JasonDev324 opened this issue 5 years ago • 10 comments

OkDownload Version

v1.0.2-SNAPSHOT

Problem Describe

I occur some problem, I also search on issues and wiki, I even checked the source code, but it can't help, so my real problem is:...

Log

There is the whole log from LogCat when I occur the problem(I know we can use this tool to let log more readable):

JasonDev324 avatar Aug 14 '19 08:08 JasonDev324

I also encountered this problem.

kjt666 avatar Aug 16 '19 01:08 kjt666

The same problem happened, it can be reproduced easily by frequently disconnect and connect network during downloading.

monkey1992 avatar Sep 03 '19 07:09 monkey1992

The location throw this exception is at line 133 of BreakpointRemoteCheck:

if (!isTrialSpecialPass(responseCode, instanceLength, resumable)
                && downloadStrategy.isServerCanceled(responseCode, info.getTotalOffset() != 0)) {
            throw new ServerCanceledException(responseCode, info.getTotalOffset());
}

The offset of BlockInfo is wrongly calculated, so DownloadStrategy#isServerCanceled return true...

monkey1992 avatar Sep 04 '19 10:09 monkey1992

Remove BreakpointInfo from BreakpointStore can avoid this exception, like this:

OkDownload.with().breakpointStore().remove(task.getId());

But the breakpoint retransmission mechanism loses its meaning. TT

monkey1992 avatar Sep 04 '19 10:09 monkey1992

@monkey1992 Why you said the offset of BlockInfo is wrongly calculated?

rantianhua avatar Nov 12 '19 08:11 rantianhua

Any update on this issue?

sametbars avatar Mar 25 '20 16:03 sametbars

Any update on this issue?

congjinruo avatar Apr 16 '20 09:04 congjinruo

Any update on this issue?

Joursion avatar Jul 10 '20 14:07 Joursion

unsubscribe https://github.com/notifications/unsubscribe-auth/ALVMTLS6PQBMMHAYUEV436LR24N7HANCNFSM4ILSLIZA please

On Fri, 10 Jul 2020 at 15:06, Joursion [email protected] wrote:

Any update on this issue?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/lingochamp/okdownload/issues/287#issuecomment-656694857, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALVMTLS6PQBMMHAYUEV436LR24N7HANCNFSM4ILSLIZA .

HassanDev13 avatar Jul 10 '20 17:07 HassanDev13

com.liulishuo.okdownload.core.exception.ServerCanceledException: Response code can't handled on internal 200 with current offset 4128507 2021-12-22 17:16:02.898 20401-20401/com.uiot.smartscreen.ota W/System.err: at com.liulishuo.okdownload.core.download.BreakpointRemoteCheck.check(BreakpointRemoteCheck.java:133) 2021-12-22 17:16:02.900 20401-20401/com.uiot.smartscreen.ota W/System.err: at com.liulishuo.okdownload.core.download.DownloadCall.execute(DownloadCall.java:180) 2021-12-22 17:16:02.901 20401-20401/com.uiot.smartscreen.ota W/System.err: at com.liulishuo.okdownload.core.NamedRunnable.run(NamedRunnable.java:32) 2021-12-22 17:16:02.903 20401-20401/com.uiot.smartscreen.ota W/System.err: at com.liulishuo.okdownload.core.dispatcher.DownloadDispatcher.syncRunCall(DownloadDispatcher.java:369) 2021-12-22 17:16:02.905 20401-20401/com.uiot.smartscreen.ota W/System.err: at com.liulishuo.okdownload.core.dispatcher.DownloadDispatcher.execute(DownloadDispatcher.java:183) 2021-12-22 17:16:02.906 20401-20401/com.uiot.smartscreen.ota W/System.err: at com.liulishuo.okdownload.DownloadTask.execute(DownloadTask.java:535) 2021-12-22 17:16:02.908 20401-20401/com.uiot.smartscreen.ota W/System.err: at com.liulishuo.okdownload.DownloadContext$1.run(DownloadContext.java:124) 2021-12-22 17:16:02.910 20401-20401/com.uiot.smartscreen.ota W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162) 2021-12-22 17:16:02.911 20401-20401/com.uiot.smartscreen.ota W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)

HeZhanHeng avatar Dec 22 '21 09:12 HeZhanHeng