winlin

refine code, add comments for stat on_disconnect.

@@ -206,6 +206,7 @@ int SrsRtmpConn::do_cycle() @@ -206,6 +206,7 @@ int SrsRtmpConn::do_cycle()
206 } 206 }
207 207
208 ret = service_cycle(); 208 ret = service_cycle();
  209 +
209 http_hooks_on_close(); 210 http_hooks_on_close();
210 SrsStatistic* stat = SrsStatistic::instance(); 211 SrsStatistic* stat = SrsStatistic::instance();
211 stat->on_disconnect(_srs_context->get_id()); 212 stat->on_disconnect(_srs_context->get_id());
@@ -161,6 +161,9 @@ public: @@ -161,6 +161,9 @@ public:
161 virtual int on_client(int id, SrsRequest* req); 161 virtual int on_client(int id, SrsRequest* req);
162 /** 162 /**
163 * client disconnect 163 * client disconnect
  164 + * @remark the on_disconnect always call, while the on_client is call when
  165 + * only got the request object, so the client specified by id maybe not
  166 + * exists in stat.
164 */ 167 */
165 virtual void on_disconnect(int id); 168 virtual void on_disconnect(int id);
166 /** 169 /**