Skip to content
This repository was archived by the owner on May 7, 2025. It is now read-only.
This repository was archived by the owner on May 7, 2025. It is now read-only.

HTTP byte range request is fulfilled with binary response of whole remaining stream? #44

Closed
@danielweck

Description

@danielweck

First, the input stream is seeked from the beginning (also, note the endAt variable passed to the HTTP "Content-Range" header):
https://github.com/readium/SDKLauncher-Android/blob/develop/SDKLauncher-Android/src/org/readium/sdk/android/launcher/util/EpubServer.java#L173
PS: which in itself is wrong, because the contract of skip() is to seek from the current position, see readium/readium-sdk#103

Then, the buffered response is returned for the entire remaining length of the input stream, rather than until the aforementioned endAt boundary:
https://github.com/readium/SDKLauncher-Android/blob/develop/SDKLauncher-Android/src/fi/iki/elonen/NanoHTTPD.java#L612

This may explain the performance issues I observe when loading video/audio-containing HTML documents, although my hardware device is pretty old, so it's hard to tell.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions