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

use the right int type for port.

This commit is contained in:
winlin 2015-09-24 18:33:07 +08:00
parent 1c7d5f1852
commit d8f18aee37
20 changed files with 105 additions and 149 deletions

View file

@ -205,29 +205,6 @@ string srs_path_build_timestamp(string template_path)
return path;
}
void srs_parse_endpoint(string ip_port, string& ip, string& port)
{
ip = "0.0.0.0";
port = ip_port;
size_t pos = string::npos;
if ((pos = port.find(":")) != string::npos) {
ip = port.substr(0, pos);
port = port.substr(pos + 1);
}
}
void srs_parse_endpoint(string ip_port, string& ip, int& port)
{
std::string the_port;
srs_parse_endpoint(ip_port, ip, the_port);
port = ::atoi(the_port.c_str());
}
string srs_bool2switch(bool v) {
return v? "on" : "off";
}
int srs_kill_forced(int& pid)
{
int ret = ERROR_SUCCESS;