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

fix #442, support kickoff client.

This commit is contained in:
winlin 2015-08-22 13:36:15 +08:00
parent b37797b13a
commit 94641c812b
11 changed files with 57 additions and 46 deletions

View file

@ -495,7 +495,7 @@ int SrsRtmpConn::stream_service_cycle()
// update the statistic when source disconveried.
SrsStatistic* stat = SrsStatistic::instance();
if ((ret = stat->on_client(_srs_context->get_id(), req)) != ERROR_SUCCESS) {
if ((ret = stat->on_client(_srs_context->get_id(), req, this)) != ERROR_SUCCESS) {
srs_error("stat client failed. ret=%d", ret);
return ret;
}
@ -671,6 +671,13 @@ int SrsRtmpConn::do_playing(SrsSource* source, SrsConsumer* consumer, SrsQueueRe
while (!disposed) {
// collect elapse for pithy print.
pprint->elapse();
// when source is set to expired, disconnect it.
if (expired) {
ret = ERROR_USER_DISCONNECT;
srs_error("connection expired. ret=%d", ret);
return ret;
}
// to use isolate thread to recv, can improve about 33% performance.
// @see: https://github.com/simple-rtmp-server/srs/issues/196
@ -875,9 +882,9 @@ int SrsRtmpConn::do_publishing(SrsSource* source, SrsPublishRecvThread* trd)
pprint->elapse();
// when source is set to expired, disconnect it.
if (source->expired()) {
if (expired) {
ret = ERROR_USER_DISCONNECT;
srs_error("source is expired. ret=%d", ret);
srs_error("connection expired. ret=%d", ret);
return ret;
}