Skip to content

fix(player): route non-TorrServer loopback streams to OkHttpDataSource - #2

Open
haaihond wants to merge 1 commit into
ram130:fix/buffer-engine-follow-up-pt2-vod-cachefrom
haaihond:fix/torrserver-port-routing
Open

haaihond wants to merge 1 commit into
ram130:fix/buffer-engine-follow-up-pt2-vod-cachefrom
haaihond:fix/torrserver-port-routing

Conversation

@haaihond

Copy link
Copy Markdown

Quick follow-up for your buffer PR: DefaultDataSource routes all 127.0.0.1 traffic into LocalhostZeroCopyDataSource, which sends Connection: close and drops the TCP connection on every container seek.

While TorrServer is fine with that, it breaks streaming contexts for persistent local servers (like Usenet or local proxies), increasing MKV startup time.

This commit scopes the zero-copy data source strictly to TorrServer (checking ports 8090/8091 and ?link=), and keeps other loopback streams on pooled OkHttp. Added unit tests to ensure zero regressions for TorrServer and external streams.

LocalhostZeroCopyDataSource intercepts 127.0.0.1 and injects Connection: close on every chunk, which breaks container seeks and streaming contexts in non-torrent loopback servers (e.g. Usenet). Scopes zero-copy data source strictly to TorrServer while routing other loopback streams to pooled OkHttpDataSource.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant