mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-11-24 00:47:21 +08:00
修复HTTP-TS 媒体帧超时 (#4793)
这个修复是因为有时的可能由于上游网络flow损坏,会导致http-ts拉流时连接不会断开, 只有几kb的速度. 这样实际上流媒体是无法正常播放的, 但是又因为能读取到非常少的数据, 不会触发超时. 等于链接假死在那里了.常见与跨域/跨洲传输时. 所以这个pr就是用于判断如果媒体帧长时间接收不全, 就也应该认为是超时断开. 后面还会提交一个新的pr, 主要是配合这个pr实现"PlayerProxy 无感重连与 muxer 保留策略", 这样就能在遇到坏flow时, 自动重连, 但是播放器无感知, 也不会断开.
This commit is contained in:
@@ -263,6 +263,10 @@ protected:
|
||||
virtual bool onRedirectUrl(const std::string &url, bool temporary) { return true; };
|
||||
|
||||
protected:
|
||||
// complete timeout 生效时,HTTP body timeout 按约定失效。
|
||||
// HTTP body timeout is disabled while complete timeout is in effect.
|
||||
size_t getEffectiveBodyTimeout() const { return _wait_complete_ms > 0 ? 0 : _wait_body_ms; }
|
||||
|
||||
//// HttpRequestSplitter override ////
|
||||
ssize_t onRecvHeader(const char *data, size_t len) override;
|
||||
void onRecvContent(const char *data, size_t len) override;
|
||||
|
||||
Reference in New Issue
Block a user