@@ -236,32 +236,32 @@ srs_error_t SrsVodStream::serve_m3u8_ctx(ISrsHttpResponseWriter * w, ISrsHttpMes
236236 return srs_error_wrap (err, " final request" );
237237 }
238238
239+ alive (ctx, req->copy ());
240+
239241 // update the statistic when source disconveried.
240242 SrsStatistic* stat = SrsStatistic::instance ();
241243 if ((err = stat->on_client (ctx, req, NULL , SrsRtmpConnPlay)) != srs_success) {
242244 return srs_error_wrap (err, " stat on client" );
243245 }
244246
245- alive (ctx, req->copy ());
246-
247247 return err;
248248}
249249
250- bool SrsVodStream::ctx_is_exist (std::string secret )
250+ bool SrsVodStream::ctx_is_exist (std::string ctx )
251251{
252- return (map_ctx_info_.find (secret ) != map_ctx_info_.end ());
252+ return (map_ctx_info_.find (ctx ) != map_ctx_info_.end ());
253253}
254254
255- void SrsVodStream::alive (std::string secret , SrsRequest* req)
255+ void SrsVodStream::alive (std::string ctx , SrsRequest* req)
256256{
257257 std::map<std::string, SrsM3u8CtxInfo>::iterator it;
258- if ((it = map_ctx_info_.find (secret )) != map_ctx_info_.end ()) {
258+ if ((it = map_ctx_info_.find (ctx )) != map_ctx_info_.end ()) {
259259 it->second .request_time = srs_get_system_time ();
260260 } else {
261261 SrsM3u8CtxInfo info;
262262 info.req = req;
263263 info.request_time = srs_get_system_time ();
264- map_ctx_info_.insert (make_pair (secret , info));
264+ map_ctx_info_.insert (make_pair (ctx , info));
265265 }
266266}
267267
@@ -334,15 +334,15 @@ srs_error_t SrsVodStream::on_timer(srs_utime_t interval)
334334
335335 std::map<std::string, SrsM3u8CtxInfo>::iterator it;
336336 for (it = map_ctx_info_.begin (); it != map_ctx_info_.end (); ++it) {
337- string secret = it->first ;
337+ string ctx = it->first ;
338338 SrsRequest* req = it->second .req ;
339339 srs_utime_t hls_window = _srs_config->get_hls_window (req->vhost );
340340 if (it->second .request_time + (2 * hls_window) < srs_get_system_time ()) {
341341 http_hooks_on_stop (req);
342342 srs_freep (req);
343343
344344 SrsStatistic* stat = SrsStatistic::instance ();
345- stat->on_disconnect (secret );
345+ stat->on_disconnect (ctx );
346346 map_ctx_info_.erase (it);
347347
348348 break ;
0 commit comments