mirror of
https://github.com/ossrs/srs.git
synced 2025-02-14 12:21:55 +00:00
Fix #1059, merge from 2.0, supports url with vhost in stream. 3.0.27
This commit is contained in:
parent
93d3e1464a
commit
681138d2af
14 changed files with 164 additions and 68 deletions
|
@ -181,6 +181,7 @@ Please select according to languages:
|
|||
- [x] Support tracable and session-based log([CN][v1_CN_SrsLog], [EN][v1_EN_SrsLog]).
|
||||
- [x] High concurrency and performance([CN][v1_CN_Performance], [EN][v1_EN_Performance]), 6000+ connections(200kbps), CPU 82%, 203MB.
|
||||
- [x] Enhanced complex error code with description and stack, read [#913][bug #913].
|
||||
- [x] Enhanced RTMP url which supports vhost in stream, read [#1059][bug #1059].
|
||||
- [ ] Utest cover almost all kernel code.
|
||||
- [ ] Enhanced forwarding with vhost and variables.
|
||||
- [ ] Support listen at IPv4 and IPv6, read [#460][bug #460].
|
||||
|
@ -196,6 +197,7 @@ Please select according to languages:
|
|||
|
||||
### V3 changes
|
||||
|
||||
* v3.0, 2018-02-13, Fix [#1059][bug #1059], merge from 2.0, supports url with vhost in stream. 3.0.27
|
||||
* v3.0, 2018-01-01, Fix [#913][bug #913], support complex error. 3.0.26
|
||||
* v3.0, 2017-06-04, Fix [#299][bug #299], support experimental MPEG-DASH. 3.0.25
|
||||
* v3.0, 2017-05-30, Fix [#821][bug #821], support MP4 file parser. 3.0.24
|
||||
|
@ -229,6 +231,7 @@ Please select according to languages:
|
|||
|
||||
### V2 changes
|
||||
|
||||
* v2.0, 2018-02-13, Fix [#1059][bug #1059], support vhost in stream parameters. 2.0.246
|
||||
* v2.0, 2018-01-07, Merge [#1045][bug #1045], fix [#1044][bug #1044], TCP connection alive detection. 2.0.245
|
||||
* v2.0, 2018-01-04, Merge [#1039][bug #1039], fix bug of init.d script.
|
||||
* v2.0, 2018-01-01, Merge [#1033][bug #1033], allow user to add some specific flags. 2.0.244
|
||||
|
@ -1424,6 +1427,7 @@ Winlin
|
|||
[bug #1039]: https://github.com/ossrs/srs/issues/1039
|
||||
[bug #1044]: https://github.com/ossrs/srs/issues/1044
|
||||
[bug #1045]: https://github.com/ossrs/srs/issues/1045
|
||||
[bug #1059]: https://github.com/ossrs/srs/issues/1059
|
||||
[bug #xxxxxxxxxx]: https://github.com/ossrs/srs/issues/xxxxxxxxxx
|
||||
|
||||
[bug #735]: https://github.com/ossrs/srs/issues/735
|
||||
|
|
|
@ -97,10 +97,10 @@ srs_error_t SrsEdgeRtmpUpstream::connect(SrsRequest* r, SrsLbRoundRobin* lb)
|
|||
// override the origin info by redirect.
|
||||
if (!redirect.empty()) {
|
||||
int _port;
|
||||
string _schema, _vhost, _app, _param, _host;
|
||||
srs_discovery_tc_url(redirect, _schema, _host, _vhost, _app, _port, _param);
|
||||
string _schema, _vhost, _app, _stream, _param, _host;
|
||||
srs_discovery_tc_url(redirect, _schema, _host, _vhost, _app, _stream, _port, _param);
|
||||
|
||||
srs_warn("RTMP redirect %s:%d to %s:%d", server.c_str(), port, _host.c_str(), _port);
|
||||
srs_warn("RTMP redirect %s:%d to %s:%d stream=%s", server.c_str(), port, _host.c_str(), _port, _stream.c_str());
|
||||
server = _host;
|
||||
port = _port;
|
||||
}
|
||||
|
|
|
@ -59,8 +59,7 @@ using namespace std;
|
|||
#include <srs_app_utility.hpp>
|
||||
#include <srs_app_st.hpp>
|
||||
|
||||
SrsHttpConn::SrsHttpConn(IConnectionManager* cm, srs_netfd_t fd, ISrsHttpServeMux* m, string cip)
|
||||
: SrsConnection(cm, fd, cip)
|
||||
SrsHttpConn::SrsHttpConn(IConnectionManager* cm, srs_netfd_t fd, ISrsHttpServeMux* m, string cip) : SrsConnection(cm, fd, cip)
|
||||
{
|
||||
parser = new SrsHttpParser();
|
||||
cors = new SrsHttpCorsMux();
|
||||
|
|
|
@ -368,7 +368,7 @@ srs_error_t SrsIngester::initialize_ffmpeg(SrsFFMPEG* ffmpeg, SrsConfDirective*
|
|||
int port = SRS_CONSTS_RTMP_DEFAULT_PORT;
|
||||
std::string tcUrl, schema, host, vhost2, param;
|
||||
srs_parse_rtmp_url(output, tcUrl, stream);
|
||||
srs_discovery_tc_url(tcUrl, schema, host, vhost2, app, port, param);
|
||||
srs_discovery_tc_url(tcUrl, schema, host, vhost2, app, stream, port, param);
|
||||
}
|
||||
|
||||
std::string log_file = SRS_CONSTS_NULL_FILE; // disabled
|
||||
|
|
|
@ -185,22 +185,6 @@ srs_error_t SrsRtmpConn::do_cycle()
|
|||
// set client ip to request.
|
||||
req->ip = ip;
|
||||
|
||||
// discovery vhost, resolve the vhost from config
|
||||
SrsConfDirective* parsed_vhost = _srs_config->get_vhost(req->vhost);
|
||||
if (parsed_vhost) {
|
||||
req->vhost = parsed_vhost->arg0();
|
||||
}
|
||||
|
||||
if (req->schema.empty() || req->vhost.empty() || req->port == 0 || req->app.empty()) {
|
||||
return srs_error_new(ERROR_RTMP_REQ_TCURL, "discovery tcUrl failed, tcUrl=%s, schema=%s, vhost=%s, port=%d, app=%s",
|
||||
req->tcUrl.c_str(), req->schema.c_str(), req->vhost.c_str(), req->port, req->app.c_str());
|
||||
}
|
||||
|
||||
// check vhost, allow default vhost.
|
||||
if ((err = check_vhost(true)) != srs_success) {
|
||||
return srs_error_wrap(err, "check vhost");
|
||||
}
|
||||
|
||||
srs_trace("connect app, tcUrl=%s, pageUrl=%s, swfUrl=%s, schema=%s, vhost=%s, port=%d, app=%s, args=%s",
|
||||
req->tcUrl.c_str(), req->pageUrl.c_str(), req->swfUrl.c_str(),
|
||||
req->schema.c_str(), req->vhost.c_str(), req->port,
|
||||
|
@ -400,18 +384,6 @@ srs_error_t SrsRtmpConn::service_cycle()
|
|||
return err;
|
||||
}
|
||||
|
||||
// do token traverse before serve it.
|
||||
// @see https://github.com/ossrs/srs/pull/239
|
||||
if (true) {
|
||||
info->edge = _srs_config->get_vhost_is_edge(req->vhost);
|
||||
bool edge_traverse = _srs_config->get_vhost_edge_token_traverse(req->vhost);
|
||||
if (info->edge && edge_traverse) {
|
||||
if ((err = check_edge_token_traverse_auth()) != srs_success) {
|
||||
return srs_error_wrap(err, "rtmp: check token traverse");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// set chunk size to larger.
|
||||
// set the chunk size before any larger response greater than 128,
|
||||
// to make OBS happy, @see https://github.com/ossrs/srs/issues/454
|
||||
|
@ -490,10 +462,45 @@ srs_error_t SrsRtmpConn::stream_service_cycle()
|
|||
if ((err = rtmp->identify_client(info->res->stream_id, info->type, req->stream, req->duration)) != srs_success) {
|
||||
return srs_error_wrap(err, "rtmp: identify client");
|
||||
}
|
||||
|
||||
srs_discovery_tc_url(req->tcUrl, req->schema, req->host, req->vhost, req->app, req->stream, req->port, req->param);
|
||||
req->strip();
|
||||
srs_trace("client identified, type=%s, stream_name=%s, duration=%.2f",
|
||||
srs_client_type_string(info->type).c_str(), req->stream.c_str(), req->duration);
|
||||
|
||||
// discovery vhost, resolve the vhost from config
|
||||
SrsConfDirective* parsed_vhost = _srs_config->get_vhost(req->vhost);
|
||||
if (parsed_vhost) {
|
||||
req->vhost = parsed_vhost->arg0();
|
||||
}
|
||||
|
||||
if (req->schema.empty() || req->vhost.empty() || req->port == 0 || req->app.empty()) {
|
||||
return srs_error_new(ERROR_RTMP_REQ_TCURL, "discovery tcUrl failed, tcUrl=%s, schema=%s, vhost=%s, port=%d, app=%s",
|
||||
req->tcUrl.c_str(), req->schema.c_str(), req->vhost.c_str(), req->port, req->app.c_str());
|
||||
}
|
||||
|
||||
// check vhost, allow default vhost.
|
||||
if ((err = check_vhost(true)) != srs_success) {
|
||||
return srs_error_wrap(err, "check vhost");
|
||||
}
|
||||
|
||||
srs_trace("connected stream, tcUrl=%s, pageUrl=%s, swfUrl=%s, schema=%s, vhost=%s, port=%d, app=%s, stream=%s, args=%s",
|
||||
req->tcUrl.c_str(), req->pageUrl.c_str(), req->swfUrl.c_str(),
|
||||
req->schema.c_str(), req->vhost.c_str(), req->port,
|
||||
req->app.c_str(), req->stream.c_str(), (req->args? "(obj)":"null"));
|
||||
|
||||
// do token traverse before serve it.
|
||||
// @see https://github.com/ossrs/srs/pull/239
|
||||
if (true) {
|
||||
info->edge = _srs_config->get_vhost_is_edge(req->vhost);
|
||||
bool edge_traverse = _srs_config->get_vhost_edge_token_traverse(req->vhost);
|
||||
if (info->edge && edge_traverse) {
|
||||
if ((err = check_edge_token_traverse_auth()) != srs_success) {
|
||||
return srs_error_wrap(err, "rtmp: check token traverse");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// security check
|
||||
if ((err = security->check(info->type, ip, req)) != srs_success) {
|
||||
return srs_error_wrap(err, "rtmp: security check");
|
||||
|
|
|
@ -642,7 +642,7 @@ srs_error_t SrsRtspConn::connect()
|
|||
if (!req) {
|
||||
std::string schema, host, vhost, app, param;
|
||||
int port;
|
||||
srs_discovery_tc_url(rtsp_tcUrl, schema, host, vhost, app, port, param);
|
||||
srs_discovery_tc_url(rtsp_tcUrl, schema, host, vhost, app, rtsp_stream, port, param);
|
||||
|
||||
// generate output by template.
|
||||
std::string output = output_template;
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
// current release version
|
||||
#define VERSION_MAJOR 3
|
||||
#define VERSION_MINOR 0
|
||||
#define VERSION_REVISION 26
|
||||
#define VERSION_REVISION 27
|
||||
|
||||
// generated by configure, only macros.
|
||||
#include <srs_auto_headers.hpp>
|
||||
|
|
|
@ -484,8 +484,8 @@ int srs_librtmp_context_parse_uri(Context* context)
|
|||
|
||||
// when connect, we only need to parse the tcUrl
|
||||
srs_discovery_tc_url(context->tcUrl,
|
||||
schema, context->host, context->vhost, context->app, context->port,
|
||||
context->param);
|
||||
schema, context->host, context->vhost, context->app, context->stream, context->port,
|
||||
context->param);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -81,11 +81,8 @@ void srs_vhost_resolve(string& vhost, string& app, string& param)
|
|||
/* others */
|
||||
}
|
||||
|
||||
void srs_discovery_tc_url(
|
||||
string tcUrl,
|
||||
string& schema, string& host, string& vhost,
|
||||
string& app, int& port, string& param
|
||||
) {
|
||||
void srs_discovery_tc_url(string tcUrl, string& schema, string& host, string& vhost, string& app, string& stream, int& port, string& param)
|
||||
{
|
||||
size_t pos = std::string::npos;
|
||||
std::string url = tcUrl;
|
||||
|
||||
|
@ -115,6 +112,7 @@ void srs_discovery_tc_url(
|
|||
|
||||
vhost = host;
|
||||
srs_vhost_resolve(vhost, app, param);
|
||||
srs_vhost_resolve(vhost, stream, param);
|
||||
}
|
||||
|
||||
void srs_parse_query_string(string q, map<string,string>& query)
|
||||
|
|
|
@ -54,8 +54,12 @@ class ISrsProtocolReaderWriter;
|
|||
* @param port, for example, 19350
|
||||
* default to 1935 if not specified.
|
||||
* param param, for example, vhost=vhost.ossrs.net
|
||||
* @remark The param stream is input and output param, that is:
|
||||
* input: tcUrl+stream
|
||||
* output: schema, host, vhost, app, stream, port, param
|
||||
*/
|
||||
extern void srs_discovery_tc_url(std::string tcUrl, std::string& schema, std::string& host, std::string& vhost, std::string& app, int& port, std::string& param);
|
||||
extern void srs_discovery_tc_url(std::string tcUrl, std::string& schema, std::string& host, std::string& vhost, std::string& app,
|
||||
std::string& stream, int& port, std::string& param);
|
||||
|
||||
// parse query string to map(k,v).
|
||||
// must format as key=value&...&keyN=valueN
|
||||
|
|
|
@ -2317,7 +2317,7 @@ srs_error_t SrsRtmpServer::connect_app(SrsRequest* req)
|
|||
req->args = pkt->args->copy()->to_object();
|
||||
}
|
||||
|
||||
srs_discovery_tc_url(req->tcUrl, req->schema, req->host, req->vhost, req->app, req->port, req->param);
|
||||
srs_discovery_tc_url(req->tcUrl, req->schema, req->host, req->vhost, req->app, req->stream, req->port, req->param);
|
||||
req->strip();
|
||||
|
||||
return err;
|
||||
|
|
|
@ -589,7 +589,7 @@ SrsRequest* SrsHttpMessage::to_request(string vhost)
|
|||
req->pageUrl = get_request_header("Referer");
|
||||
req->objectEncoding = 0;
|
||||
|
||||
srs_discovery_tc_url(req->tcUrl, req->schema, req->host, req->vhost, req->app, req->port, req->param);
|
||||
srs_discovery_tc_url(req->tcUrl, req->schema, req->host, req->vhost, req->app, req->stream, req->port, req->param);
|
||||
req->strip();
|
||||
|
||||
// reset the host to http request host.
|
||||
|
|
|
@ -43,7 +43,7 @@ SrsBasicRtmpClient::SrsBasicRtmpClient(string u, int64_t ctm, int64_t stm)
|
|||
|
||||
req = new SrsRequest();
|
||||
srs_parse_rtmp_url(url, req->tcUrl, req->stream);
|
||||
srs_discovery_tc_url(req->tcUrl, req->schema, req->host, req->vhost, req->app, req->port, req->param);
|
||||
srs_discovery_tc_url(req->tcUrl, req->schema, req->host, req->vhost, req->app, req->stream, req->port, req->param);
|
||||
|
||||
transport = NULL;
|
||||
client = NULL;
|
||||
|
|
|
@ -430,40 +430,124 @@ VOID TEST(ProtocolHandshakeTest, BytesEqual)
|
|||
*/
|
||||
VOID TEST(ProtocolUtilityTest, DiscoveryTcUrl)
|
||||
{
|
||||
std::string tcUrl;
|
||||
std::string schema; std::string host; std::string vhost;
|
||||
std::string app; int port; std::string param;
|
||||
std::string tcUrl, schema, ip, vhost, app, stream, param;
|
||||
int port;
|
||||
|
||||
tcUrl = "rtmp://127.0.0.1:1935/live";
|
||||
srs_discovery_tc_url(tcUrl, schema, host, vhost, app, port, param);
|
||||
// general url
|
||||
tcUrl = "rtmp://winlin.cn/live"; stream= "show";
|
||||
srs_discovery_tc_url(tcUrl, schema, ip, vhost, app, stream, port, param);
|
||||
EXPECT_STREQ("rtmp", schema.c_str());
|
||||
EXPECT_STREQ("127.0.0.1", host.c_str());
|
||||
EXPECT_STREQ("127.0.0.1", vhost.c_str());
|
||||
EXPECT_STREQ("winlin.cn", ip.c_str());
|
||||
EXPECT_STREQ("winlin.cn", vhost.c_str());
|
||||
EXPECT_STREQ("live", app.c_str());
|
||||
EXPECT_STREQ("show", stream.c_str());
|
||||
EXPECT_EQ(1935, port);
|
||||
|
||||
tcUrl = "rtmp://127.0.0.1:19351/live";
|
||||
srs_discovery_tc_url(tcUrl, schema, host, vhost, app, port, param);
|
||||
tcUrl = "rtmp://winlin.cn:19351/live"; stream= "show";
|
||||
srs_discovery_tc_url(tcUrl, schema, ip, vhost, app, stream, port, param);
|
||||
EXPECT_STREQ("rtmp", schema.c_str());
|
||||
EXPECT_STREQ("127.0.0.1", host.c_str());
|
||||
EXPECT_STREQ("winlin.cn", ip.c_str());
|
||||
EXPECT_STREQ("winlin.cn", vhost.c_str());
|
||||
EXPECT_STREQ("live", app.c_str());
|
||||
EXPECT_STREQ("show", stream.c_str());
|
||||
EXPECT_EQ(19351, port);
|
||||
|
||||
tcUrl = "rtmp://winlin.cn/live"; stream= "show?key=abc";
|
||||
srs_discovery_tc_url(tcUrl, schema, ip, vhost, app, stream, port, param);
|
||||
EXPECT_STREQ("rtmp", schema.c_str());
|
||||
EXPECT_STREQ("winlin.cn", ip.c_str());
|
||||
EXPECT_STREQ("winlin.cn", vhost.c_str());
|
||||
EXPECT_STREQ("live", app.c_str());
|
||||
EXPECT_STREQ("show", stream.c_str());
|
||||
EXPECT_EQ(1935, port);
|
||||
EXPECT_STREQ("?key=abc", param.c_str());
|
||||
|
||||
tcUrl = "rtmp://winlin.cn/live"; stream= "show?key=abc&&vhost=demo.com";
|
||||
srs_discovery_tc_url(tcUrl, schema, ip, vhost, app, stream, port, param);
|
||||
EXPECT_STREQ("rtmp", schema.c_str());
|
||||
EXPECT_STREQ("winlin.cn", ip.c_str());
|
||||
EXPECT_STREQ("demo.com", vhost.c_str());
|
||||
EXPECT_STREQ("live", app.c_str());
|
||||
EXPECT_STREQ("show", stream.c_str());
|
||||
EXPECT_EQ(1935, port);
|
||||
EXPECT_STREQ("?key=abc&&vhost=demo.com", param.c_str());
|
||||
|
||||
// vhost in app
|
||||
tcUrl = "rtmp://winlin.cn/live?key=abc"; stream= "show";
|
||||
srs_discovery_tc_url(tcUrl, schema, ip, vhost, app, stream, port, param);
|
||||
EXPECT_STREQ("rtmp", schema.c_str());
|
||||
EXPECT_STREQ("winlin.cn", ip.c_str());
|
||||
EXPECT_STREQ("winlin.cn", vhost.c_str());
|
||||
EXPECT_STREQ("live", app.c_str());
|
||||
EXPECT_STREQ("show", stream.c_str());
|
||||
EXPECT_EQ(1935, port);
|
||||
EXPECT_STREQ("?key=abc", param.c_str());
|
||||
|
||||
tcUrl = "rtmp://winlin.cn/live?key=abc&&vhost=demo.com"; stream= "show";
|
||||
srs_discovery_tc_url(tcUrl, schema, ip, vhost, app, stream, port, param);
|
||||
EXPECT_STREQ("rtmp", schema.c_str());
|
||||
EXPECT_STREQ("winlin.cn", ip.c_str());
|
||||
EXPECT_STREQ("demo.com", vhost.c_str());
|
||||
EXPECT_STREQ("live", app.c_str());
|
||||
EXPECT_STREQ("show", stream.c_str());
|
||||
EXPECT_EQ(1935, port);
|
||||
EXPECT_STREQ("?key=abc&&vhost=demo.com", param.c_str());
|
||||
|
||||
// without stream
|
||||
tcUrl = "rtmp://winlin.cn/live"; stream="";
|
||||
srs_discovery_tc_url(tcUrl, schema, ip, vhost, app, stream, port, param);
|
||||
EXPECT_STREQ("rtmp", schema.c_str());
|
||||
EXPECT_STREQ("winlin.cn", ip.c_str());
|
||||
EXPECT_STREQ("winlin.cn", vhost.c_str());
|
||||
EXPECT_STREQ("live", app.c_str());
|
||||
EXPECT_STREQ("", stream.c_str());
|
||||
EXPECT_EQ(1935, port);
|
||||
|
||||
tcUrl = "rtmp://127.0.0.1:1935/live"; stream="";
|
||||
srs_discovery_tc_url(tcUrl, schema, ip, vhost, app, stream, port, param);
|
||||
EXPECT_STREQ("rtmp", schema.c_str());
|
||||
EXPECT_STREQ("127.0.0.1", ip.c_str());
|
||||
EXPECT_STREQ("127.0.0.1", vhost.c_str());
|
||||
EXPECT_STREQ("live", app.c_str());
|
||||
EXPECT_STREQ("", stream.c_str());
|
||||
EXPECT_EQ(1935, port);
|
||||
|
||||
tcUrl = "rtmp://127.0.0.1:19351/live"; stream="";
|
||||
srs_discovery_tc_url(tcUrl, schema, ip, vhost, app, stream, port, param);
|
||||
EXPECT_STREQ("rtmp", schema.c_str());
|
||||
EXPECT_STREQ("127.0.0.1", ip.c_str());
|
||||
EXPECT_STREQ("127.0.0.1", vhost.c_str());
|
||||
EXPECT_STREQ("live", app.c_str());
|
||||
EXPECT_STREQ("", stream.c_str());
|
||||
EXPECT_EQ(19351, port);
|
||||
|
||||
tcUrl = "rtmp://127.0.0.1:19351/live?vhost=demo";
|
||||
srs_discovery_tc_url(tcUrl, schema, host, vhost, app, port, param);
|
||||
tcUrl = "rtmp://127.0.0.1:19351/live?vhost=demo"; stream="";
|
||||
srs_discovery_tc_url(tcUrl, schema, ip, vhost, app, stream, port, param);
|
||||
EXPECT_STREQ("rtmp", schema.c_str());
|
||||
EXPECT_STREQ("127.0.0.1", host.c_str());
|
||||
EXPECT_STREQ("127.0.0.1", ip.c_str());
|
||||
EXPECT_STREQ("demo", vhost.c_str());
|
||||
EXPECT_STREQ("live", app.c_str());
|
||||
EXPECT_STREQ("", stream.c_str());
|
||||
EXPECT_EQ(19351, port);
|
||||
|
||||
tcUrl = "rtmp://127.0.0.1:19351/live/show?vhost=demo";
|
||||
srs_discovery_tc_url(tcUrl, schema, host, vhost, app, port, param);
|
||||
// no vhost
|
||||
tcUrl = "rtmp://127.0.0.1:19351/live"; stream= "show";
|
||||
srs_discovery_tc_url(tcUrl, schema, ip, vhost, app, stream, port, param);
|
||||
EXPECT_STREQ("rtmp", schema.c_str());
|
||||
EXPECT_STREQ("127.0.0.1", host.c_str());
|
||||
EXPECT_STREQ("127.0.0.1", ip.c_str());
|
||||
EXPECT_STREQ("127.0.0.1", vhost.c_str());
|
||||
EXPECT_STREQ("live", app.c_str());
|
||||
EXPECT_STREQ("show", stream.c_str());
|
||||
EXPECT_EQ(19351, port);
|
||||
|
||||
// ip and vhost
|
||||
tcUrl = "rtmp://127.0.0.1:19351/live"; stream= "show?vhost=demo";
|
||||
srs_discovery_tc_url(tcUrl, schema, ip, vhost, app, stream, port, param);
|
||||
EXPECT_STREQ("rtmp", schema.c_str());
|
||||
EXPECT_STREQ("127.0.0.1", ip.c_str());
|
||||
EXPECT_STREQ("demo", vhost.c_str());
|
||||
EXPECT_STREQ("live/show", app.c_str());
|
||||
EXPECT_STREQ("live", app.c_str());
|
||||
EXPECT_STREQ("show", stream.c_str());
|
||||
EXPECT_EQ(19351, port);
|
||||
}
|
||||
|
||||
|
@ -5374,7 +5458,7 @@ VOID TEST(ProtocolRTMPTest, RTMPRequest)
|
|||
|
||||
req.stream = "livestream";
|
||||
srs_discovery_tc_url("rtmp://std.ossrs.net/live",
|
||||
req.schema, req.host, req.vhost, req.app, req.port, param);
|
||||
req.schema, req.host, req.vhost, req.app, req.stream, req.port, param);
|
||||
req.strip();
|
||||
EXPECT_STREQ("rtmp", req.schema.c_str());
|
||||
EXPECT_STREQ("std.ossrs.net", req.host.c_str());
|
||||
|
@ -5384,7 +5468,7 @@ VOID TEST(ProtocolRTMPTest, RTMPRequest)
|
|||
|
||||
req.stream = "livestream";
|
||||
srs_discovery_tc_url("rtmp://s td.os srs.n et/li v e",
|
||||
req.schema, req.host, req.vhost, req.app, req.port, param);
|
||||
req.schema, req.host, req.vhost, req.app, req.stream, req.port, param);
|
||||
req.strip();
|
||||
EXPECT_STREQ("rtmp", req.schema.c_str());
|
||||
EXPECT_STREQ("std.ossrs.net", req.host.c_str());
|
||||
|
@ -5394,7 +5478,7 @@ VOID TEST(ProtocolRTMPTest, RTMPRequest)
|
|||
|
||||
req.stream = "livestream";
|
||||
srs_discovery_tc_url("rtmp://s\ntd.o\rssrs.ne\nt/li\nve",
|
||||
req.schema, req.host, req.vhost, req.app, req.port, param);
|
||||
req.schema, req.host, req.vhost, req.app, req.stream, req.port, param);
|
||||
req.strip();
|
||||
EXPECT_STREQ("rtmp", req.schema.c_str());
|
||||
EXPECT_STREQ("std.ossrs.net", req.host.c_str());
|
||||
|
@ -5404,7 +5488,7 @@ VOID TEST(ProtocolRTMPTest, RTMPRequest)
|
|||
|
||||
req.stream = "livestream";
|
||||
srs_discovery_tc_url("rtmp://std.ossrs.net/live ",
|
||||
req.schema, req.host, req.vhost, req.app, req.port, param);
|
||||
req.schema, req.host, req.vhost, req.app, req.stream, req.port, param);
|
||||
req.strip();
|
||||
EXPECT_STREQ("rtmp", req.schema.c_str());
|
||||
EXPECT_STREQ("std.ossrs.net", req.host.c_str());
|
||||
|
|
Loading…
Reference in a new issue