Merge branch 'development' into LTS_development

This commit is contained in:
Thulinma 2019-11-27 10:26:41 +01:00
commit c64160f4d8
3 changed files with 11 additions and 9 deletions

View file

@ -889,7 +889,8 @@ bool HTTP::Parser::parse(std::string &HTTPbuffer){
HTTPbuffer.erase(0, toappend); HTTPbuffer.erase(0, toappend);
} }
if (length == body.length()){ if (length == body.length()){
parseVars(body, vars); // parse POST variables //parse POST variables
if (method == "POST"){parseVars(body, vars);}
return true; return true;
}else{ }else{
return false; return false;

View file

@ -452,6 +452,8 @@ bool Util::startInput(std::string streamname, std::string filename, bool forkFir
} }
JSON::Value Util::getInputBySource(const std::string &filename, bool isProvider){ JSON::Value Util::getInputBySource(const std::string &filename, bool isProvider){
std::string tmpFn = filename;
if (tmpFn.find('?') != std::string::npos){tmpFn.erase(tmpFn.find('?'), std::string::npos);}
JSON::Value ret; JSON::Value ret;
// Attempt to load up configuration and find this stream // Attempt to load up configuration and find this stream
@ -482,8 +484,8 @@ JSON::Value Util::getInputBySource(const std::string &filename, bool isProvider)
MEDIUM_MSG("Checking input %s: %s (%s)", inputs.getIndiceName(i).c_str(), MEDIUM_MSG("Checking input %s: %s (%s)", inputs.getIndiceName(i).c_str(),
tmp_input.getMember("name").asString().c_str(), source.c_str()); tmp_input.getMember("name").asString().c_str(), source.c_str());
if (filename.substr(0, front.size()) == front && if (tmpFn.substr(0, front.size()) == front &&
filename.substr(filename.size() - back.size()) == back){ tmpFn.substr(tmpFn.size() - back.size()) == back){
if (tmp_input.getMember("non-provider") && !isProvider){ if (tmp_input.getMember("non-provider") && !isProvider){
noProviderNoPick = true; noProviderNoPick = true;
continue; continue;
@ -500,8 +502,7 @@ JSON::Value Util::getInputBySource(const std::string &filename, bool isProvider)
MEDIUM_MSG("Checking input %s: %s (%s)", inputs.getIndiceName(i).c_str(), MEDIUM_MSG("Checking input %s: %s (%s)", inputs.getIndiceName(i).c_str(),
tmp_input.getMember("name").asString().c_str(), source.c_str()); tmp_input.getMember("name").asString().c_str(), source.c_str());
if (filename.substr(0, front.size()) == front && if (tmpFn.substr(0, front.size()) == front && tmpFn.substr(tmpFn.size() - back.size()) == back){
filename.substr(filename.size() - back.size()) == back){
if (tmp_input.getMember("non-provider") && !isProvider){ if (tmp_input.getMember("non-provider") && !isProvider){
noProviderNoPick = true; noProviderNoPick = true;
continue; continue;
@ -515,9 +516,9 @@ JSON::Value Util::getInputBySource(const std::string &filename, bool isProvider)
} }
if (!selected){ if (!selected){
if (noProviderNoPick){ if (noProviderNoPick){
INFO_MSG("Not a media provider for input: %s", filename.c_str()); INFO_MSG("Not a media provider for input: %s", tmpFn.c_str());
}else{ }else{
FAIL_MSG("No compatible input found for: %s", filename.c_str()); FAIL_MSG("No compatible input found for: %s", tmpFn.c_str());
} }
}else{ }else{
ret = input.asJSON(); ret = input.asJSON();

View file

@ -625,9 +625,9 @@ namespace Mist {
getNext(); getNext();
nProxy.userClient.keepAlive(); nProxy.userClient.keepAlive();
} }
if (!thisPacket){return "Invalid packet";}
if (!config->is_active){return "received deactivate signal";}
if (!nProxy.userClient.isAlive()){return "buffer shutdown";} if (!nProxy.userClient.isAlive()){return "buffer shutdown";}
if (!config->is_active){return "received deactivate signal";}
if (!thisPacket){return "Invalid packet";}
return "Unknown"; return "Unknown";
} }