1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

API: Parse fragment of URI. v5.0.106 (#3295)

* parse fragment of uri
* adapt FMLE URL: 'rtmp://ip/app/app2#k=v/stream', then add more test case

Co-authored-by: winlin <winlin@vip.126.com>
This commit is contained in:
Haibo Chen 2022-12-08 15:48:10 +08:00 committed by GitHub
parent 0e550d496b
commit c5a0c5947f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 42 additions and 4 deletions

View file

@ -3560,6 +3560,33 @@ VOID TEST(ProtocolRTMPTest, RTMPRequest)
req.update_auth(&req1);
EXPECT_TRUE(NULL != req.args);
EXPECT_TRUE(req1.args != req.args);
param = "";
req.stream = "livestream";
srs_discovery_tc_url("rtmp://std.ossrs.net/live#b=2",
req.schema, req.host, req.vhost, req.app, req.stream, req.port, param);
EXPECT_STREQ("#b=2", param.c_str());
param = "";
req.stream = "livestream";
srs_discovery_tc_url("rtmp://std.ossrs.net/live?a=1#b=2",
req.schema, req.host, req.vhost, req.app, req.stream, req.port, param);
EXPECT_STREQ("?a=1#b=2", param.c_str());
param = "";
srs_discovery_tc_url("rtmp://std.ossrs.net/live?a=1&c=3#b=2",
req.schema, req.host, req.vhost, req.app, req.stream, req.port, param);
EXPECT_STREQ("?a=1&c=3#b=2", param.c_str());
param = "";
srs_discovery_tc_url("rtmp://std.ossrs.net/live?a=1&c=3#b=2#d=4",
req.schema, req.host, req.vhost, req.app, req.stream, req.port, param);
EXPECT_STREQ("?a=1&c=3#b=2#d=4", param.c_str());
param = "";
srs_discovery_tc_url("rtmp://std.ossrs.net/live?a=1#e=5&c=3#b=2#d=4",
req.schema, req.host, req.vhost, req.app, req.stream, req.port, param);
EXPECT_STREQ("?a=1#e=5&c=3#b=2#d=4", param.c_str());
}
VOID TEST(ProtocolRTMPTest, RTMPHandshakeBytes)