Merge branch '4.0release' into develop

pull/3150/head
winlin 2 years ago
commit 4edf33326d

@ -44,6 +44,7 @@ The changelog for SRS.
## SRS 4.0 Changelog
* v4.0, 2022-08-17, RTMP URL supports domain in stream parameters. v4.0.255
* v4.0, 2022-08-10, Fix server id generator bug. v4.0.254
* v4.0, 2022-06-29, Update SRS image for r.ossrs.net. v4.0.253
* v4.0, 2022-06-11, For [#3058](https://github.com/ossrs/srs/pull/3058): Docker: Support x86_64, armv7 and aarch64 docker image (#3058). v4.0.252

@ -9,6 +9,6 @@
#define VERSION_MAJOR 4
#define VERSION_MINOR 0
#define VERSION_REVISION 254
#define VERSION_REVISION 255
#endif

@ -78,6 +78,11 @@ void srs_vhost_resolve(string& vhost, string& app, string& param)
if (!query.empty()) {
vhost = query;
}
} else if ((pos = query.find("domain?")) != std::string::npos) {
query = query.substr(pos + 7);
if (!query.empty()) {
vhost = query;
}
}
}

@ -3435,6 +3435,20 @@ VOID TEST(ProtocolRTMPTest, DiscoveryTcUrl)
EXPECT_STREQ("?key=abc&&vhost=demo.com", param.c_str());
}
if (true) {
int port; std::string tcUrl, schema, ip, vhost, app, stream, param;
tcUrl = "rtmp://winlin.cn/live"; stream= "show?key=abc&&domain=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&&domain=demo.com", param.c_str());
}
// vhost in app
if (true) {
int port; std::string tcUrl, schema, ip, vhost, app, stream, param;

@ -539,6 +539,24 @@ VOID TEST(HTTPServerTest, MessageConnection)
EXPECT_STREQ("ossrs.net", m.host().c_str()); EXPECT_FALSE(m.is_jsonp());
}
if (true) {
SrsHttpMessage m;
HELPER_EXPECT_SUCCESS(m.set_url("http://127.0.0.1/live/livestream.flv?vhost=ossrs.net", false));
EXPECT_STREQ("ossrs.net", m.host().c_str()); EXPECT_FALSE(m.is_jsonp());
}
if (true) {
SrsHttpMessage m;
HELPER_EXPECT_SUCCESS(m.set_url("http://127.0.0.1/live/livestream.flv?domain=ossrs.net&token=xxx", false));
EXPECT_STREQ("ossrs.net", m.host().c_str()); EXPECT_FALSE(m.is_jsonp());
}
if (true) {
SrsHttpMessage m;
HELPER_EXPECT_SUCCESS(m.set_url("http://127.0.0.1/live/livestream.flv?token=xxx&domain=ossrs.net", false));
EXPECT_STREQ("ossrs.net", m.host().c_str()); EXPECT_FALSE(m.is_jsonp());
}
if (true) {
SrsHttpMessage m;
HELPER_EXPECT_SUCCESS(m.set_url("http://127.0.0.1/live/livestream.flv", false));

Loading…
Cancel
Save