diff --git a/trunk/src/app/srs_app_source.cpp b/trunk/src/app/srs_app_source.cpp index a1b2403cf..ed86e9147 100644 --- a/trunk/src/app/srs_app_source.cpp +++ b/trunk/src/app/srs_app_source.cpp @@ -439,7 +439,14 @@ int SrsSource::find(SrsRequest* req, SrsSource** ppsource) srs_info("create new source for url=%s, vhost=%s", stream_url.c_str(), vhost.c_str()); } - *ppsource = 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. + if (true) { + SrsSource* source = pool[stream_url]; + source->_req->update_auth(req); + *ppsource = source; + } return ret; } diff --git a/trunk/src/core/srs_core.hpp b/trunk/src/core/srs_core.hpp index 62fcb68df..85970f376 100644 --- a/trunk/src/core/srs_core.hpp +++ b/trunk/src/core/srs_core.hpp @@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // current release version #define VERSION_MAJOR "0" #define VERSION_MINOR "9" -#define VERSION_REVISION "130" +#define VERSION_REVISION "131" #define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION // server info. #define RTMP_SIG_SRS_KEY "SRS" diff --git a/trunk/src/rtmp/srs_protocol_rtmp.cpp b/trunk/src/rtmp/srs_protocol_rtmp.cpp index 98d669d3a..b3c3c1c78 100644 --- a/trunk/src/rtmp/srs_protocol_rtmp.cpp +++ b/trunk/src/rtmp/srs_protocol_rtmp.cpp @@ -108,6 +108,22 @@ SrsRequest* SrsRequest::copy() return cp; } +void SrsRequest::update_auth(SrsRequest* req) +{ + pageUrl = req->pageUrl; + swfUrl = req->swfUrl; + tcUrl = req->tcUrl; + + if (args) { + srs_freep(args); + } + if (req->args) { + args = req->args->copy()->to_object(); + } + + srs_info("update req of soruce for auth ok"); +} + int SrsRequest::discovery_app() { int ret = ERROR_SUCCESS; diff --git a/trunk/src/rtmp/srs_protocol_rtmp.hpp b/trunk/src/rtmp/srs_protocol_rtmp.hpp index 0979b8be0..e271a905e 100644 --- a/trunk/src/rtmp/srs_protocol_rtmp.hpp +++ b/trunk/src/rtmp/srs_protocol_rtmp.hpp @@ -89,6 +89,13 @@ public: * when reload it, the request maybe invalid, so need to copy it. */ virtual SrsRequest* copy(); + + /** + * update the auth info of request, + * to keep the current request ptr is ok, + * for many components use the ptr of request. + */ + virtual void update_auth(SrsRequest* req); /** * disconvery vhost/app from tcUrl.