You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description getSize on CachingSteam does not handle cases when the remote steam does not know its size (ie, returns null on getSize). In this case, the size returned by the CachingStream is incorrect. It does a max between null and the cached size, which will always return the cached size even if the full stream was not cached.
How to reproduce
Create a CachingStream from a stream that does not know its size (returning null when calling getSize).
Possible Solution
As a first idea, I am wondering why the getSize on the CachingStream does not only returns the size advertised by the remote stream. However, we could improve this by knowing if the full stream has been cached. In this case, the size is known and it could returns.
Additional context
In the seek function, the case were the remote stream returns null on getSize is correctly handled.
The text was updated successfully, but these errors were encountered:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 2 weeks if no further activity occurs. Thank you for your contributions.
PHP version: 7.3.19
Description
getSize
onCachingSteam
does not handle cases when the remote steam does not know its size (ie, returnsnull
ongetSize
). In this case, the size returned by theCachingStream
is incorrect. It does amax
betweennull
and the cached size, which will always return the cached size even if the full stream was not cached.How to reproduce
Create a
CachingStream
from a stream that does not know its size (returningnull
when callinggetSize
).Possible Solution
As a first idea, I am wondering why the
getSize
on theCachingStream
does not only returns the size advertised by the remote stream. However, we could improve this by knowing if the full stream has been cached. In this case, the size is known and it could returns.Additional context
In the
seek
function, the case were the remote stream returnsnull
ongetSize
is correctly handled.The text was updated successfully, but these errors were encountered: