Skip to content
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

#1300 Problem of fd leakage when pulling non-existent http-flv stream #1304

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion trunk/src/app/srs_app_recv_thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,7 @@ void SrsPublishRecvThread::set_socket_buffer(int sleep_ms)

SrsHttpRecvThread::SrsHttpRecvThread(SrsResponseOnlyHttpConn* c)
{
trd_err = srs_success;
conn = c;
trd = new SrsSTCoroutine("http-receive", this, _srs_context->get_id());
}
Expand All @@ -584,7 +585,7 @@ srs_error_t SrsHttpRecvThread::start()

srs_error_t SrsHttpRecvThread::pull()
{
return trd->pull();
return srs_error_copy(trd_err);
}

srs_error_t SrsHttpRecvThread::cycle()
Expand All @@ -596,6 +597,7 @@ srs_error_t SrsHttpRecvThread::cycle()
SrsAutoFree(ISrsHttpMessage, req);

if ((err = conn->pop_message(&req)) != srs_success) {
trd_err = err;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The err here is shared by trd_err and wrapped err, we should free the trd_err then copy err to it.

return srs_error_wrap(err, "pop message");
}
}
Expand Down
1 change: 1 addition & 0 deletions trunk/src/app/srs_app_recv_thread.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ class SrsPublishRecvThread : virtual public ISrsMessagePumper, virtual public IS
class SrsHttpRecvThread : public ISrsCoroutineHandler
{
private:
srs_error_t trd_err;
SrsResponseOnlyHttpConn* conn;
SrsCoroutine* trd;
public:
Expand Down