Merge branch 'development' into LTS_development

# Conflicts:
#	src/input/input.cpp
This commit is contained in:
Thulinma 2017-10-24 14:09:13 +02:00
commit cac503f774
7 changed files with 218 additions and 133 deletions

View file

@ -97,7 +97,9 @@ namespace Controller {
p[it.key()] = p[it.key()].asString();
if (p[it.key()].asStringRef().size() > 0){
argarr[argnum++] = (char*)((*it)["option"].asStringRef().c_str());
argarr[argnum++] = (char*)(p[it.key()].asStringRef().c_str());
if (it->isMember("type")){
argarr[argnum++] = (char*)(p[it.key()].asStringRef().c_str());
}
}
}else{
if (it.key() == "debug"){

View file

@ -536,16 +536,7 @@ namespace Mist {
it->second.lastms = 0;
}
getNext();
while (thisPacket && config->is_active && nProxy.userClient.isAlive()){
nProxy.bufferLivePacket(thisPacket, myMeta);
getNext();
nProxy.userClient.keepAlive();
}
std::string reason = "Unknown";
if (!thisPacket){reason = "Invalid packet";}
if (!config->is_active){reason = "received deactivate signal";}
if (!nProxy.userClient.isAlive()){reason = "buffer shutdown";}
std::string reason = streamMainLoop();
closeStreamSource();
@ -558,6 +549,19 @@ namespace Mist {
return;
}
std::string Input::streamMainLoop(){
getNext();
while (thisPacket && config->is_active && nProxy.userClient.isAlive()){
nProxy.bufferLivePacket(thisPacket, myMeta);
getNext();
nProxy.userClient.keepAlive();
}
if (!thisPacket){return "Invalid packet";}
if (!config->is_active){return "received deactivate signal";}
if (!nProxy.userClient.isAlive()){return "buffer shutdown";}
return "Unknown";
}
void Input::finish() {
for (std::map<unsigned int, std::map<unsigned int, unsigned int> >::iterator it = pageCounter.begin(); it != pageCounter.end(); it++) {
for (std::map<unsigned int, unsigned int>::iterator it2 = it->second.begin(); it2 != it->second.end(); it2++) {

View file

@ -51,6 +51,7 @@ namespace Mist {
virtual void convert();
virtual void serve();
virtual void stream();
virtual std::string streamMainLoop();
bool isAlwaysOn();
virtual void parseHeader();