mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
move config to app, for its application level features
This commit is contained in:
parent
517d346a52
commit
b407021d45
14 changed files with 149 additions and 80 deletions
|
@ -85,27 +85,3 @@ std::string srs_dns_resolve(std::string host)
|
|||
return ipv4;
|
||||
}
|
||||
|
||||
void srs_vhost_resolve(std::string& vhost, std::string& app)
|
||||
{
|
||||
app = srs_replace(app, "...", "?");
|
||||
|
||||
size_t pos = 0;
|
||||
if ((pos = app.find("?")) == std::string::npos) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::string query = app.substr(pos + 1);
|
||||
app = app.substr(0, pos);
|
||||
|
||||
if ((pos = query.find("vhost?")) != std::string::npos
|
||||
|| (pos = query.find("vhost=")) != std::string::npos
|
||||
|| (pos = query.find("Vhost?")) != std::string::npos
|
||||
|| (pos = query.find("Vhost=")) != std::string::npos
|
||||
) {
|
||||
query = query.substr(pos + 6);
|
||||
if (!query.empty()) {
|
||||
vhost = query;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -96,11 +96,6 @@ extern void srs_update_system_time_ms();
|
|||
extern std::string srs_replace(std::string str, std::string old_str, std::string new_str);
|
||||
// dns resolve utility, return the resolved ip address.
|
||||
extern std::string srs_dns_resolve(std::string host);
|
||||
// resolve the vhost in query string
|
||||
// @param app, may contains the vhost in query string format:
|
||||
// app?vhost=request_vhost
|
||||
// app...vhost...request_vhost
|
||||
extern void srs_vhost_resolve(std::string& vhost, std::string& app);
|
||||
|
||||
/**
|
||||
* disable copy constructor of class
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue