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

Fix #1059, support vhost in stream parameters. 2.0.246

This commit is contained in:
winlin 2018-02-13 08:31:25 +08:00
parent 366309ce2d
commit 1721e4ea4b
13 changed files with 161 additions and 69 deletions

View file

@ -2515,7 +2515,7 @@ int SrsRtmpServer::connect_app(SrsRequest* req)
srs_info("get connect app message params success.");
srs_discovery_tc_url(req->tcUrl,
req->schema, req->host, req->vhost, req->app, req->port,
req->schema, req->host, req->vhost, req->app, req->stream, req->port,
req->param);
req->strip();

View file

@ -43,7 +43,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, string& stream, string& port, std::string& param
) {
size_t pos = std::string::npos;
std::string url = tcUrl;
@ -70,6 +70,7 @@ void srs_discovery_tc_url(
app = url;
vhost = host;
srs_vhost_resolve(vhost, app, param);
srs_vhost_resolve(vhost, stream, param);
}
void srs_vhost_resolve(string& vhost, string& app, string& param)

View file

@ -54,11 +54,14 @@ 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, std::string& port, std::string& param
std::string& app, std::string& stream, std::string& port, std::string& param
);
/**