mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
RTMP: If port is explicity set to 0, use default 1935 (#1754). v4.0.181
This commit is contained in:
parent
bb7cd6af3a
commit
061d544195
4 changed files with 12 additions and 3 deletions
|
@ -8,6 +8,7 @@ The changelog for SRS.
|
||||||
|
|
||||||
## SRS 4.0 Changelog
|
## SRS 4.0 Changelog
|
||||||
|
|
||||||
|
* v4.0, 2021-10-19, Merge [#1754](https://github.com/ossrs/srs/pull/1754): RTMP: If port is explicity set to 0, use default 1935. v4.0.181
|
||||||
* v4.0, 2021-10-18, Merge [#2670](https://github.com/ossrs/srs/pull/2670): SRT: Solve mpegts demux assert bug. v4.0.180
|
* v4.0, 2021-10-18, Merge [#2670](https://github.com/ossrs/srs/pull/2670): SRT: Solve mpegts demux assert bug. v4.0.180
|
||||||
* v4.0, 2021-10-16, Merge [#2665](https://github.com/ossrs/srs/pull/2665): API: Fix the same 'client_id' error when asynchronous call. v4.0.179
|
* v4.0, 2021-10-16, Merge [#2665](https://github.com/ossrs/srs/pull/2665): API: Fix the same 'client_id' error when asynchronous call. v4.0.179
|
||||||
* v4.0, 2021-10-13, Merge [#2671](https://github.com/ossrs/srs/pull/2671): SRT: Pes error when mpegts demux in srt. v4.0.178
|
* v4.0, 2021-10-13, Merge [#2671](https://github.com/ossrs/srs/pull/2671): SRT: Pes error when mpegts demux in srt. v4.0.178
|
||||||
|
|
|
@ -9,6 +9,6 @@
|
||||||
|
|
||||||
#define VERSION_MAJOR 4
|
#define VERSION_MAJOR 4
|
||||||
#define VERSION_MINOR 0
|
#define VERSION_MINOR 0
|
||||||
#define VERSION_REVISION 180
|
#define VERSION_REVISION 181
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -189,7 +189,7 @@ void srs_parse_hostport(string hostport, string& host, int& port)
|
||||||
if (hostport.find(":") == pos) {
|
if (hostport.find(":") == pos) {
|
||||||
host = hostport.substr(0, pos);
|
host = hostport.substr(0, pos);
|
||||||
string p = hostport.substr(pos + 1);
|
string p = hostport.substr(pos + 1);
|
||||||
if (!p.empty()) {
|
if (!p.empty() && p != "0") {
|
||||||
port = ::atoi(p.c_str());
|
port = ::atoi(p.c_str());
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
@ -204,7 +204,7 @@ void srs_parse_hostport(string hostport, string& host, int& port)
|
||||||
// For ipv6, [host]:port.
|
// For ipv6, [host]:port.
|
||||||
host = hostport.substr(1, pos - 1);
|
host = hostport.substr(1, pos - 1);
|
||||||
string p = hostport.substr(pos + 2);
|
string p = hostport.substr(pos + 2);
|
||||||
if (!p.empty()) {
|
if (!p.empty() && p != "0") {
|
||||||
port = ::atoi(p.c_str());
|
port = ::atoi(p.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4570,6 +4570,14 @@ VOID TEST(KernelUtilityTest, CoverTimeUtilityAll)
|
||||||
srs_parse_hostport("domain.com", host, port);
|
srs_parse_hostport("domain.com", host, port);
|
||||||
EXPECT_STREQ("domain.com", host.c_str());
|
EXPECT_STREQ("domain.com", host.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (true) {
|
||||||
|
string host;
|
||||||
|
int port = 1935;
|
||||||
|
srs_parse_hostport("domain.com:0", host, port);
|
||||||
|
EXPECT_EQ(1935, port);
|
||||||
|
EXPECT_STREQ("domain.com", host.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
if (true) {
|
if (true) {
|
||||||
string ep = srs_any_address_for_listener();
|
string ep = srs_any_address_for_listener();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue