优化端口池范围限定逻辑 (#1508)

This commit is contained in:
Dw9 2022-03-26 10:15:18 +08:00 committed by GitHub
parent a16b6cbc59
commit 822a401f30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -375,7 +375,7 @@ public:
}; };
GET_CONFIG_FUNC(uint16_t, s_min_port, RtpProxy::kPortRange, [](const string &str) { return func(str, 0); }); GET_CONFIG_FUNC(uint16_t, s_min_port, RtpProxy::kPortRange, [](const string &str) { return func(str, 0); });
GET_CONFIG_FUNC(uint16_t, s_max_port, RtpProxy::kPortRange, [](const string &str) { return func(str, 1); }); GET_CONFIG_FUNC(uint16_t, s_max_port, RtpProxy::kPortRange, [](const string &str) { return func(str, 1); });
assert(s_max_port > s_min_port + 36); assert(s_max_port >= s_min_port + 36 -1);
setRange((s_min_port + 1) / 2, s_max_port / 2); setRange((s_min_port + 1) / 2, s_max_port / 2);
} }