mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
STAT: Refine tcUrl for SRT/RTC. v5.0.54
This commit is contained in:
parent
d877c0b76f
commit
9c6774b644
21 changed files with 121 additions and 36 deletions
|
@ -111,7 +111,7 @@ srs_error_t SrsBasicRtmpClient::do_connect_app(string local_ip, bool debug)
|
|||
// generate the tcUrl
|
||||
std::string param = "";
|
||||
std::string target_vhost = req->vhost;
|
||||
std::string tc_url = srs_generate_tc_url(req->host, req->vhost, req->app, req->port);
|
||||
std::string tc_url = srs_generate_tc_url("rtmp", req->host, req->vhost, req->app, req->port);
|
||||
|
||||
// replace the tcUrl in request,
|
||||
// which will replace the tc_url in client.connect_app().
|
||||
|
|
|
@ -1544,6 +1544,7 @@ void SrsRequest::strip()
|
|||
SrsRequest* SrsRequest::as_http()
|
||||
{
|
||||
schema = "http";
|
||||
tcUrl = srs_generate_tc_url(schema, host, vhost, app, port);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
|
@ -175,9 +175,9 @@ long srs_random()
|
|||
return random();
|
||||
}
|
||||
|
||||
string srs_generate_tc_url(string host, string vhost, string app, int port)
|
||||
string srs_generate_tc_url(string schema, string host, string vhost, string app, int port)
|
||||
{
|
||||
string tcUrl = "rtmp://";
|
||||
string tcUrl = schema + "://";
|
||||
|
||||
if (vhost == SRS_CONSTS_RTMP_DEFAULT_VHOST) {
|
||||
tcUrl += host.empty() ? SRS_CONSTS_RTMP_DEFAULT_VHOST : host;
|
||||
|
@ -324,10 +324,9 @@ string srs_generate_stream_url(string vhost, string app, string stream)
|
|||
if (SRS_CONSTS_RTMP_DEFAULT_VHOST != vhost){
|
||||
url += vhost;
|
||||
}
|
||||
url += "/";
|
||||
url += app;
|
||||
url += "/";
|
||||
url += stream;
|
||||
url += "/" + app;
|
||||
// Note that we ignore any extension.
|
||||
url += "/" + srs_path_filename(stream);
|
||||
|
||||
return url;
|
||||
}
|
||||
|
|
|
@ -76,7 +76,7 @@ extern long srs_random();
|
|||
* generate the tcUrl without param.
|
||||
* @remark Use host as tcUrl.vhost if vhost is default vhost.
|
||||
*/
|
||||
extern std::string srs_generate_tc_url(std::string host, std::string vhost, std::string app, int port);
|
||||
extern std::string srs_generate_tc_url(std::string schema, std::string host, std::string vhost, std::string app, int port);
|
||||
|
||||
/**
|
||||
* Generate the stream with param.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue