Snapshot 2010-09-15

This commit is contained in:
Frank Schmirler
2010-12-02 09:57:17 +01:00
parent e0a00f90ae
commit 2ec54f7505
24 changed files with 495 additions and 144 deletions

View File

@@ -151,7 +151,10 @@ cTSExt::cTSExt(cRingBufferLinear *ResultBuffer, const cServerConnection *Connect
// look for section parameters: /path;param1=value1;param2=value2/
std::string::size_type begin, end;
std::string path = Connection->Headers().at("PATH_INFO");
const static std::string PATH_INFO("PATH_INFO");
tStrStrMap::const_iterator it_pathinfo = Connection->Headers().find(PATH_INFO);
const std::string& path = it_pathinfo == Connection->Headers().end() ? "/" : it_pathinfo->second;
begin = path.find(';', 0);
begin = path.find_first_not_of(';', begin);
end = path.find_first_of(";/", begin);
@@ -188,6 +191,11 @@ cTSExt::cTSExt(cRingBufferLinear *ResultBuffer, const cServerConnection *Connect
if (setpgid(0, 0) == -1)
esyslog("streamdev-server: externremux setpgid failed: %m");
if (access(opt_remux, X_OK) == -1) {
esyslog("streamdev-server %s: %m", opt_remux);
_exit(-1);
}
if (execle("/bin/sh", "sh", "-c", opt_remux, NULL, env) == -1) {
esyslog("streamdev-server: externremux script '%s' execution failed: %m", opt_remux);
_exit(-1);