Larger than 2GB online streams do not work

Issue #771 resolved
Former user created an issue

Online stream with Content-Length larger than 2 GB can not be viewed with Serviio. TechnicalMetadata#fileSize is set to -1 and Serviio refuses to serve the file, even though it can successfully extract all the other metadata for the stream.

This bug is probably caused by org.serviio.util.HttpClient#getContentSize() returning integer values obtained from URLConnection#getContentLength() which (according to javadoc) returns -1 if Content-Length is larger than Integer.MAX_VALUE. URLConnection#getContentLengthLong() should be used instead.

Comments (4)

  1. Sami Rantala

    Forgot to mention that this bug only occurs if the stream supports partial responses and Serviio does not transcode the stream. Required changes, tested and found to work:

    • change the return type of HttpClient#getContentSize() to Long

    • use URLConnection#getContentLengthLong() in HttpClient#getContentSize()

    • a minor change in FeedUpdaterThread to make it compile

    ... and it works like a charm :)

  2. Log in to comment