mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Fix #1059, merge from 2.0, supports url with vhost in stream. 3.0.27
This commit is contained in:
parent
93d3e1464a
commit
681138d2af
14 changed files with 164 additions and 68 deletions
|
@ -81,11 +81,8 @@ void srs_vhost_resolve(string& vhost, string& app, string& param)
|
|||
/* others */
|
||||
}
|
||||
|
||||
void srs_discovery_tc_url(
|
||||
string tcUrl,
|
||||
string& schema, string& host, string& vhost,
|
||||
string& app, int& port, string& param
|
||||
) {
|
||||
void srs_discovery_tc_url(string tcUrl, string& schema, string& host, string& vhost, string& app, string& stream, int& port, string& param)
|
||||
{
|
||||
size_t pos = std::string::npos;
|
||||
std::string url = tcUrl;
|
||||
|
||||
|
@ -115,6 +112,7 @@ void srs_discovery_tc_url(
|
|||
|
||||
vhost = host;
|
||||
srs_vhost_resolve(vhost, app, param);
|
||||
srs_vhost_resolve(vhost, stream, param);
|
||||
}
|
||||
|
||||
void srs_parse_query_string(string q, map<string,string>& query)
|
||||
|
|
|
@ -54,8 +54,12 @@ class ISrsProtocolReaderWriter;
|
|||
* @param port, for example, 19350
|
||||
* default to 1935 if not specified.
|
||||
* param param, for example, vhost=vhost.ossrs.net
|
||||
* @remark The param stream is input and output param, that is:
|
||||
* input: tcUrl+stream
|
||||
* output: schema, host, vhost, app, stream, port, param
|
||||
*/
|
||||
extern void srs_discovery_tc_url(std::string tcUrl, std::string& schema, std::string& host, std::string& vhost, std::string& app, int& port, std::string& param);
|
||||
extern void srs_discovery_tc_url(std::string tcUrl, std::string& schema, std::string& host, std::string& vhost, std::string& app,
|
||||
std::string& stream, int& port, std::string& param);
|
||||
|
||||
// parse query string to map(k,v).
|
||||
// must format as key=value&...&keyN=valueN
|
||||
|
|
|
@ -2317,7 +2317,7 @@ srs_error_t SrsRtmpServer::connect_app(SrsRequest* req)
|
|||
req->args = pkt->args->copy()->to_object();
|
||||
}
|
||||
|
||||
srs_discovery_tc_url(req->tcUrl, req->schema, req->host, req->vhost, req->app, req->port, req->param);
|
||||
srs_discovery_tc_url(req->tcUrl, req->schema, req->host, req->vhost, req->app, req->stream, req->port, req->param);
|
||||
req->strip();
|
||||
|
||||
return err;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue