Skip to content

Commit

Permalink
ossrs#1300 拉取不存在的http-flv流时fd泄漏的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
rageJune committed Jan 18, 2019
1 parent 98706f7 commit b577ed9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
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;
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

0 comments on commit b577ed9

Please sign in to comment.