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

refine http, support no host.

This commit is contained in:
winlin 2016-01-12 11:53:52 +08:00
parent 2941328ee8
commit f971538cf3
3 changed files with 31 additions and 27 deletions

View file

@ -117,6 +117,27 @@ void srs_discovery_tc_url(
srs_vhost_resolve(vhost, app, param);
}
void srs_parse_query_string(string q, map<string,string>& query)
{
// query string flags.
static vector<string> flags;
if (flags.empty()) {
flags.push_back("=");
flags.push_back(",");
flags.push_back("&&");
flags.push_back("&");
flags.push_back(";");
}
vector<string> kvs = srs_string_split(q, flags);
for (int i = 0; i < (int)kvs.size(); i+=2) {
string k = kvs.at(i);
string v = (i < (int)kvs.size() - 1)? kvs.at(i+1):"";
query[k] = v;
}
}
void srs_random_generate(char* bytes, int size)
{
static bool _random_initialized = false;