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

@ -44,7 +44,7 @@ using namespace std;
void srs_discovery_tc_url(
string tcUrl,
string& schema, string& host, string& vhost,
string& app, string& port, std::string& param
string& app, int& port, std::string& param
) {
size_t pos = std::string::npos;
std::string url = tcUrl;
@ -63,8 +63,7 @@ void srs_discovery_tc_url(
port = SRS_CONSTS_RTMP_DEFAULT_PORT;
if ((pos = host.find(":")) != std::string::npos) {
port = host.substr(pos + 1);
host = host.substr(0, pos);
srs_parse_hostport(host, host, port);
srs_info("discovery host=%s, port=%s", host.c_str(), port.c_str());
}
@ -126,11 +125,6 @@ void srs_random_generate(char* bytes, int size)
}
string srs_generate_tc_url(string ip, string vhost, string app, int port, string param)
{
return srs_generate_tc_url(ip, vhost, app, srs_int2str(port), param);
}
string srs_generate_tc_url(string ip, string vhost, string app, string port, string param)
{
string tcUrl = "rtmp://";
@ -142,7 +136,7 @@ string srs_generate_tc_url(string ip, string vhost, string app, string port, str
if (port != SRS_CONSTS_RTMP_DEFAULT_PORT) {
tcUrl += ":";
tcUrl += port;
tcUrl += srs_int2str(port);
}
tcUrl += "/";

View file

@ -58,7 +58,7 @@ class ISrsProtocolReaderWriter;
extern void srs_discovery_tc_url(
std::string tcUrl,
std::string& schema, std::string& host, std::string& vhost,
std::string& app, std::string& port, std::string& param
std::string& app, int& port, std::string& param
);
/**
@ -85,10 +85,6 @@ extern void srs_random_generate(char* bytes, int size);
* @remark when vhost equals to __defaultVhost__, use ip as vhost.
* @remark ignore port if port equals to default port 1935.
*/
extern std::string srs_generate_tc_url(
std::string ip, std::string vhost, std::string app, std::string port,
std::string param
);
extern std::string srs_generate_tc_url(
std::string ip, std::string vhost, std::string app, int port,
std::string param

View file

@ -1664,6 +1664,7 @@ SrsRequest::SrsRequest()
{
objectEncoding = RTMP_SIG_AMF0_VER;
duration = -1;
port = SRS_CONSTS_RTMP_DEFAULT_PORT;
args = NULL;
}

View file

@ -554,7 +554,7 @@ public:
// the host in tcUrl.
std::string host;
// the port in tcUrl.
std::string port;
int port;
// the app in tcUrl, without param.
std::string app;
// the param in tcUrl(app).