mirror of
https://github.com/ossrs/srs.git
synced 2025-02-15 04:42:04 +00:00
Merge branch '4.0release' into develop
This commit is contained in:
commit
4edf33326d
5 changed files with 45 additions and 7 deletions
|
@ -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
|
||||
|
|
|
@ -72,12 +72,17 @@ void srs_vhost_resolve(string& vhost, string& app, string& param)
|
|||
if ((pos = app.find("?")) != std::string::npos) {
|
||||
std::string query = app.substr(pos + 1);
|
||||
app = app.substr(0, pos);
|
||||
|
||||
|
||||
if ((pos = query.find("vhost?")) != std::string::npos) {
|
||||
query = query.substr(pos + 6);
|
||||
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;
|
||||
|
|
|
@ -533,11 +533,29 @@ VOID TEST(HTTPServerTest, MessageConnection)
|
|||
EXPECT_STREQ("http://127.0.0.1/live/livestream.flv", m.uri().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", 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", 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?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;
|
||||
|
|
Loading…
Reference in a new issue