From c6c90e26431b238907ac9f63ca74072de0057e45 Mon Sep 17 00:00:00 2001 From: winlin Date: Wed, 8 Jul 2015 17:42:35 +0800 Subject: [PATCH] refine code, add comments for stat on_disconnect. --- trunk/src/app/srs_app_rtmp_conn.cpp | 1 + trunk/src/app/srs_app_statistic.hpp | 15 +++++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/trunk/src/app/srs_app_rtmp_conn.cpp b/trunk/src/app/srs_app_rtmp_conn.cpp index e8710a691..3ff909724 100755 --- a/trunk/src/app/srs_app_rtmp_conn.cpp +++ b/trunk/src/app/srs_app_rtmp_conn.cpp @@ -206,6 +206,7 @@ int SrsRtmpConn::do_cycle() } ret = service_cycle(); + http_hooks_on_close(); SrsStatistic* stat = SrsStatistic::instance(); stat->on_disconnect(_srs_context->get_id()); diff --git a/trunk/src/app/srs_app_statistic.hpp b/trunk/src/app/srs_app_statistic.hpp index 8c6c108a4..949bd0633 100644 --- a/trunk/src/app/srs_app_statistic.hpp +++ b/trunk/src/app/srs_app_statistic.hpp @@ -154,14 +154,17 @@ public: virtual void on_stream_close(SrsRequest* req); public: /** - * when got a client to publish/play stream, - * @param id, the client srs id. - * @param req, the client request object. - */ + * when got a client to publish/play stream, + * @param id, the client srs id. + * @param req, the client request object. + */ virtual int on_client(int id, SrsRequest* req); /** - * client disconnect - */ + * client disconnect + * @remark the on_disconnect always call, while the on_client is call when + * only got the request object, so the client specified by id maybe not + * exists in stat. + */ virtual void on_disconnect(int id); /** * sample the kbps, add delta bytes of conn.