Merge branch 'development' into LTS_development

# Conflicts:
#	src/output/output_http_internal.cpp
This commit is contained in:
Thulinma 2018-11-13 16:35:12 +01:00
commit 109995809d
13 changed files with 85 additions and 73 deletions

View file

@ -4,14 +4,30 @@
void AnalyserDTSC::init(Util::Config &conf){
Analyser::init(conf);
JSON::Value opt;
opt["long"] = "headless";
opt["short"] = "H";
opt["help"] = "Parse entire file or streams as a single headless DTSC packet";
conf.addOption("headless", opt);
opt.null();
}
AnalyserDTSC::AnalyserDTSC(Util::Config &conf) : Analyser(conf){
conn = Socket::Connection(0, fileno(stdin));
totalBytes = 0;
headLess = conf.getBool("headless");
}
bool AnalyserDTSC::parsePacket(){
if (headLess){
while (conn){
if (!conn.spool()){Util::sleep(50);}
}
std::string dataBuf = conn.Received().remove(conn.Received().bytes(0xFFFFFFFFul));
DTSC::Scan S((char*)dataBuf.data(), dataBuf.size());
std::cout << S.toPrettyString() << std::endl;
return false;
}
P.reInit(conn);
if (conn && !P){
FAIL_MSG("Invalid DTSC packet @ byte %llu", totalBytes)

View file

@ -8,6 +8,7 @@ public:
static void init(Util::Config &conf);
private:
bool headLess;
DTSC::Packet P;
Socket::Connection conn;
uint64_t totalBytes;