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

@ -111,11 +111,11 @@ int SrsFFMPEG::initialize(SrsRequest* req, SrsConfDirective* engine)
// output stream, to other/self server
// ie. rtmp://127.0.0.1:1935/live/livestream_sd
output = srs_replace(output, "[vhost]", req->vhost);
output = srs_replace(output, "[port]", req->port);
output = srs_replace(output, "[app]", req->app);
output = srs_replace(output, "[stream]", req->stream);
output = srs_replace(output, "[engine]", engine->arg0());
output = srs_string_replace(output, "[vhost]", req->vhost);
output = srs_string_replace(output, "[port]", req->port);
output = srs_string_replace(output, "[app]", req->app);
output = srs_string_replace(output, "[stream]", req->stream);
output = srs_string_replace(output, "[engine]", engine->arg0());
// write ffmpeg info to log file.
log_file = _srs_config->get_ffmpeg_log_dir();

View file

@ -338,7 +338,20 @@ void SrsHttpMessage::reset()
int SrsHttpMessage::parse_uri()
{
return _uri->initialize(_url);
// filter url according to HTTP specification.
// remove the duplicated slash.
std::string filtered_url = srs_string_replace(_url, "//", "/");
// remove the last / to match resource.
filtered_url = srs_string_trim_end(filtered_url, "/");
// if empty, use root.
if (filtered_url.empty()) {
filtered_url = "/";
}
return _uri->initialize(filtered_url);
}
bool SrsHttpMessage::is_complete()

View file

@ -239,7 +239,6 @@ int SrsRtmpConn::stream_service_cycle()
srs_error("identify client failed. ret=%d", ret);
return ret;
}
req->strip();
srs_trace("identify client success. type=%s, stream_name=%s",
srs_client_type_string(type).c_str(), req->stream.c_str());