server icon indicating copy to clipboard operation
server copied to clipboard

fix: Avoid extra stream copy to memory/temp if we can determine the size

Open juliusknorr opened this issue 2 years ago • 1 comments

On my local setup the stream was seekable and reported the proper size, so I think we can actually avoid the extra effort to copy the stream beginning to memory to determin which upload mechanism to use for cases where a size is reported. The fallback is still in place if the stream reports 0 or null as the size.

Introduced with https://github.com/nextcloud/server/pull/27877/files#diff-030e38a9e621019981acf91654c1d8d3a12ab3150dbd9fcc4c280479b8c853dbR144-R148

Test case needed adjustment since the implementation of a NonSeekableStream falsely reported to be seekable on its metadata.

juliusknorr avatar May 23 '23 07:05 juliusknorr

https://github.com/nextcloud/server/pull/38763 might be the reason why this wasn't working as expected on the mentioned setup

juliusknorr avatar Jun 13 '23 19:06 juliusknorr

Man, this would really help. Where did the stream behavior change? Is there a chance that I bakcport it already for our Next (V25) release or later - as MagentaCLOUD will hopefully move fast to V27 in fall?

If I understand it right the behavior change comes from https://github.com/nextcloud/server/pull/34232, which is not merged to stable 24. I assume if I backport both, this could work, right?

Thanks.

tsdicloud avatar Jul 06 '23 06:07 tsdicloud