Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edge: Should disable HLS/DASH on edge server. #1066

Closed
RocFang opened this issue Feb 7, 2018 · 4 comments
Closed

Edge: Should disable HLS/DASH on edge server. #1066

RocFang opened this issue Feb 7, 2018 · 4 comments
Assignees
Labels
Enhancement Improvement or enhancement. Feature It's a new feature. TransByAI Translated by AI/GPT.
Milestone

Comments

@RocFang
Copy link
Contributor

RocFang commented Feb 7, 2018

This issue refers to version 2.0.

Firstly, the edge source has the following two members:

class SrsSource : public ISrsReloadHandler
{
......
SrsRequest* _req;
SrsHls* hls;
......
}

The hls also has a member _req:

class SrsHls
{
...
SrsRequest* _req;
...
}

Next, there are two ways to fetch the edge source: pull and push.

When pulling the source, the edge source's hls is functionally identical to the origin source's hls, and it can slice normally. The hls _req is initialized in the source->on_publish call to hls->on_publish, and the assignment logic is to copy the request, as shown in the code snippet below:

int SrsHls::on_publish(SrsRequest* req, bool fetch_sequence_header)
{
......
    srs_freep(_req);
    _req = req->copy();
......
}

At this point, both the source and its hls member have a valid _req member (the source's _req is initialized in its initialize method).

However, the situation is different when pushing to the edge.

When pushing to an edge, SrsRtmpConn::publishing calls acquire_publish, and if the current device is an edge, it will not call source->on_publish. As a result, the edge source's hls member's on_publish is not called, and the _req member of the edge source's hls member is empty.

An empty hls _req will cause a coredump. When source->dispose() calls hls->dispose, the SrsHls::dispose method will reference the empty _req, resulting in a coredump:

void SrsHls::dispose()
{
......
int hls_dispose = _srs_config->get_hls_dispose(_req->vhost);
......
}

Most of the above logic is also mentioned in #1055, but that PR has issues, so it was closed.

@winlinvip
Copy link
Member

winlinvip commented Feb 24, 2018

I think the fundamental reason for this issue is that the edge should not have HLS, or the HLS should be removed from the edge's source, or the edge should use a new object instead of the source, and the source should only be used for the origin server.

@winlinvip winlinvip added Enhancement Improvement or enhancement. Feature It's a new feature. labels Feb 24, 2018
@winlinvip winlinvip added this to the srs 3.0 release milestone Feb 24, 2018
@winlinvip
Copy link
Member

winlinvip commented Feb 24, 2018

I still suggest submitting a PR to simply fix this issue in SRS2 and do a complete fix in SRS3.

@RocFang
Copy link
Contributor Author

RocFang commented Feb 25, 2018

@winlinvip Alright, I submitted a new PR: #1077

@winlinvip winlinvip changed the title 边缘source hls初始化推拉流初始化行为不一致 边缘不应该支持切片协议,例如HLS和DASH Feb 5, 2020
@winlinvip
Copy link
Member

Postpone to SRS4

@winlinvip winlinvip self-assigned this Aug 23, 2021
@winlinvip winlinvip modified the milestones: 4.0, 5.0 Nov 5, 2021
@winlinvip winlinvip modified the milestones: 5.0, 6.0 Jan 2, 2023
@winlinvip winlinvip changed the title 边缘不应该支持切片协议,例如HLS和DASH Edge: Should disable HLS/DASH on edge server. 边缘不应该支持切片协议,例如HLS和DASH Jan 2, 2023
@winlinvip winlinvip changed the title Edge: Should disable HLS/DASH on edge server. 边缘不应该支持切片协议,例如HLS和DASH Edge: Should disable HLS/DASH on edge server. Jul 18, 2023
@ossrs ossrs locked and limited conversation to collaborators Jul 18, 2023
@winlinvip winlinvip converted this issue into discussion #3657 Jul 18, 2023
@winlinvip winlinvip added the TransByAI Translated by AI/GPT. label Jul 28, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
Enhancement Improvement or enhancement. Feature It's a new feature. TransByAI Translated by AI/GPT.
Projects
None yet
Development

No branches or pull requests

3 participants