1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

fix the log cid display error, merge the publish recv thread log to publish connection.

This commit is contained in:
winlin 2015-08-21 15:22:40 +08:00
parent 3c402cb908
commit c75f05c88b
9 changed files with 84 additions and 6 deletions

View file

@ -62,6 +62,11 @@ SrsRecvThread::~SrsRecvThread()
srs_freep(trd);
}
int SrsRecvThread::cid()
{
return trd->cid();
}
int SrsRecvThread::start()
{
return trd->start();
@ -253,6 +258,7 @@ SrsPublishRecvThread::SrsPublishRecvThread(
recv_error_code = ERROR_SUCCESS;
_nb_msgs = 0;
error = st_cond_new();
ncid = cid = 0;
req = _req;
mr_fd = mr_sock_fd;
@ -297,9 +303,21 @@ int SrsPublishRecvThread::error_code()
return recv_error_code;
}
void SrsPublishRecvThread::set_cid(int v)
{
ncid = v;
}
int SrsPublishRecvThread::get_cid()
{
return ncid;
}
int SrsPublishRecvThread::start()
{
return trd.start();
int ret = trd.start();
ncid = cid = trd.cid();
return ret;
}
void SrsPublishRecvThread::stop()
@ -351,6 +369,12 @@ bool SrsPublishRecvThread::can_handle()
int SrsPublishRecvThread::handle(SrsCommonMessage* msg)
{
int ret = ERROR_SUCCESS;
// when cid changed, change it.
if (ncid != cid) {
_srs_context->set_id(ncid);
cid = ncid;
}
_nb_msgs++;