winlin

merge from 1.0release, traverse the token before response connect. 2.0.45.

... ... @@ -20,3 +20,4 @@ CONTRIBUTORS ordered by first contribution.
* karthikeyan<keyanmca@gmail.com> "Bug fixed"
* StevenLiu<lq@chinaffmpeg.org> "Build SRS on Darwin OSX"
* zhengfl<zhengfl_1989@126.com> "Bug fixed"
* tufang14<breadbean1449@gmail.com> "Bug fixed"
... ...
... ... @@ -485,6 +485,7 @@ Supported operating systems and hardware:
* 2013-10-17, Created.<br/>
## 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.
... ...
... ... @@ -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;
... ...
... ... @@ -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"
... ...