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

support more splash in http url. remove the strip of SrsRequest, use srs_string_remove instead, change to 0.9.44

This commit is contained in:
winlin 2014-04-03 15:53:56 +08:00
parent f2216691f9
commit b71eb0d49a
8 changed files with 77 additions and 42 deletions

View file

@ -127,7 +127,11 @@ int SrsRequest::discovery_app()
app = url;
vhost = host;
srs_vhost_resolve(vhost, app);
strip();
// remove the unsupported chars in names.
vhost = srs_string_remove(vhost, "/ \n\r\t");
app = srs_string_remove(app, " \n\r\t");
stream = srs_string_remove(stream, "/ \n\r\t");
return ret;
}
@ -145,30 +149,6 @@ string SrsRequest::get_stream_url()
return url;
}
void SrsRequest::strip()
{
trim(vhost, "/ \n\r\t");
trim(app, "/ \n\r\t");
trim(stream, "/ \n\r\t");
}
string& SrsRequest::trim(string& str, string chs)
{
for (int i = 0; i < (int)chs.length(); i++) {
char ch = chs.at(i);
for (std::string::iterator it = str.begin(); it != str.end();) {
if (ch == *it) {
it = str.erase(it);
} else {
++it;
}
}
}
return str;
}
SrsResponse::SrsResponse()
{
stream_id = SRS_DEFAULT_SID;