diff --git a/trunk/src/app/srs_app_rtc_source.cpp b/trunk/src/app/srs_app_rtc_source.cpp index 8e79f443a..ea1082c31 100644 --- a/trunk/src/app/srs_app_rtc_source.cpp +++ b/trunk/src/app/srs_app_rtc_source.cpp @@ -256,6 +256,10 @@ srs_error_t SrsRtcSourceManager::fetch_or_create(SrsRequest* r, SrsRtcSource** p SrsRtcSource* source = NULL; if ((source = fetch(r)) != NULL) { + // we always update the request of resource, + // for origin auth is on, the token in request maybe invalid, + // and we only need to update the token of request, it's simple. + source->update_auth(r); *pps = source; return err; } @@ -291,11 +295,6 @@ SrsRtcSource* SrsRtcSourceManager::fetch(SrsRequest* r) source = pool[stream_url]; - // we always update the request of resource, - // for origin auth is on, the token in request maybe invalid, - // and we only need to update the token of request, it's simple. - source->update_auth(r); - return source; } diff --git a/trunk/src/app/srs_app_rtc_source.hpp b/trunk/src/app/srs_app_rtc_source.hpp index c98db9561..1b9555a04 100644 --- a/trunk/src/app/srs_app_rtc_source.hpp +++ b/trunk/src/app/srs_app_rtc_source.hpp @@ -114,7 +114,6 @@ public: virtual srs_error_t fetch_or_create(SrsRequest* r, SrsRtcSource** pps); private: // Get the exists source, NULL when not exists. - // update the request and return the exists source. virtual SrsRtcSource* fetch(SrsRequest* r); }; diff --git a/trunk/src/app/srs_app_source.cpp b/trunk/src/app/srs_app_source.cpp index d297f0f4a..5705a13ac 100755 --- a/trunk/src/app/srs_app_source.cpp +++ b/trunk/src/app/srs_app_source.cpp @@ -1713,6 +1713,10 @@ srs_error_t SrsLiveSourceManager::fetch_or_create(SrsRequest* r, ISrsLiveSourceH SrsLiveSource* source = NULL; if ((source = fetch(r)) != NULL) { + // we always update the request of resource, + // for origin auth is on, the token in request maybe invalid, + // and we only need to update the token of request, it's simple. + source->update_auth(r); *pps = source; return err; } @@ -1751,11 +1755,6 @@ SrsLiveSource* SrsLiveSourceManager::fetch(SrsRequest* r) source = pool[stream_url]; - // we always update the request of resource, - // for origin auth is on, the token in request maybe invalid, - // and we only need to update the token of request, it's simple. - source->update_auth(r); - return source; } diff --git a/trunk/src/app/srs_app_source.hpp b/trunk/src/app/srs_app_source.hpp index d1bf0b3dc..78d04958d 100644 --- a/trunk/src/app/srs_app_source.hpp +++ b/trunk/src/app/srs_app_source.hpp @@ -450,7 +450,6 @@ public: virtual srs_error_t fetch_or_create(SrsRequest* r, ISrsLiveSourceHandler* h, SrsLiveSource** pps); public: // Get the exists source, NULL when not exists. - // update the request and return the exists source. virtual SrsLiveSource* fetch(SrsRequest* r); public: // dispose and cycle all sources.