diff --git a/AUTHORS.txt b/AUTHORS.txt index 07f3b07d0..20ebd7610 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -20,3 +20,4 @@ CONTRIBUTORS ordered by first contribution. * karthikeyan "Bug fixed" * StevenLiu "Build SRS on Darwin OSX" * zhengfl "Bug fixed" +* tufang14 "Bug fixed" diff --git a/README.md b/README.md index 1fcdd58cf..0b9e39cde 100755 --- a/README.md +++ b/README.md @@ -485,6 +485,7 @@ Supported operating systems and hardware: * 2013-10-17, Created.
## History +* v2.0, 2014-12-02, merge [#239](https://github.com/winlinvip/simple-rtmp-server/pull/239), traverse the token before response connect. 2.0.45. * v2.0, 2014-12-02, srs-librtmp support hijack io apis for st-load. 2.0.42. * v2.0, 2014-12-01, for [#237](https://github.com/winlinvip/simple-rtmp-server/issues/237), refine syscall for recv, supports 1.5k clients. 2.0.41. * v2.0, 2014-11-30, add qtcreate project file trunk/src/qt/srs/srs-qt.pro. 2.0.39. diff --git a/trunk/src/app/srs_app_rtmp_conn.cpp b/trunk/src/app/srs_app_rtmp_conn.cpp index 83b2105dc..1297c9459 100644 --- a/trunk/src/app/srs_app_rtmp_conn.cpp +++ b/trunk/src/app/srs_app_rtmp_conn.cpp @@ -242,6 +242,18 @@ int SrsRtmpConn::service_cycle() return bandwidth->bandwidth_check(rtmp, skt, req, local_ip); } + // do token traverse before serve it. + // @see https://github.com/winlinvip/simple-rtmp-server/pull/239 + bool vhost_is_edge = _srs_config->get_vhost_is_edge(req->vhost); + bool edge_traverse = _srs_config->get_vhost_edge_token_traverse(req->vhost); + if (vhost_is_edge && edge_traverse) { + if ((ret = check_edge_token_traverse_auth()) != ERROR_SUCCESS) { + srs_warn("token auth failed, ret=%d", ret); + return ret; + } + } + + // response the client connect ok. if ((ret = rtmp->response_connect_app(req, local_ip.c_str())) != ERROR_SUCCESS) { srs_error("response connect app failed. ret=%d", ret); return ret; @@ -324,15 +336,7 @@ int SrsRtmpConn::stream_service_cycle() } srs_info("set chunk_size=%d success", chunk_size); - // do token traverse before serve it. bool vhost_is_edge = _srs_config->get_vhost_is_edge(req->vhost); - bool edge_traverse = _srs_config->get_vhost_edge_token_traverse(req->vhost); - if (vhost_is_edge && edge_traverse) { - if ((ret = check_edge_token_traverse_auth()) != ERROR_SUCCESS) { - srs_warn("token auth failed, ret=%d", ret); - return ret; - } - } // find a source to serve. SrsSource* source = NULL; diff --git a/trunk/src/core/srs_core.hpp b/trunk/src/core/srs_core.hpp index 1408dd9b3..44a134866 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 2 #define VERSION_MINOR 0 -#define VERSION_REVISION 44 +#define VERSION_REVISION 45 // server info. #define RTMP_SIG_SRS_KEY "SRS" #define RTMP_SIG_SRS_ROLE "origin/edge server"