diff --git a/src/output/output.cpp b/src/output/output.cpp index 1313bf25..3466654a 100644 --- a/src/output/output.cpp +++ b/src/output/output.cpp @@ -861,7 +861,6 @@ namespace Mist { /*LTS-END*/ DEBUG_MSG(DLVL_MEDIUM, "MistOut client handler started"); while (config->is_active && myConn.connected() && (wantRequest || parseData)){ - stats(); if (wantRequest){ requestHandler(); } diff --git a/src/output/output.h b/src/output/output.h index 5539bb4d..a1aae08d 100644 --- a/src/output/output.h +++ b/src/output/output.h @@ -108,6 +108,7 @@ namespace Mist { virtual std::string getConnectedHost(); virtual std::string getConnectedBinHost(); virtual std::string getStatsName(); + virtual bool hasSessionIDs(){return false;} IPC::sharedClient statsPage;///< Shared memory used for statistics reporting. bool isBlocking;///< If true, indicates that myConn is blocking. diff --git a/src/output/output_hls.cpp b/src/output/output_hls.cpp index 463f49f0..1e383f45 100644 --- a/src/output/output_hls.cpp +++ b/src/output/output_hls.cpp @@ -370,6 +370,7 @@ namespace Mist { VLCworkaround = true; } } + initialize(); if (H.url.substr(5 + streamName.size(), 5) == "/push"){ std::string relPushUrl = H.url.substr(10 + streamName.size()); diff --git a/src/output/output_hls.h b/src/output/output_hls.h index d8eca1e2..2fb14e36 100644 --- a/src/output/output_hls.h +++ b/src/output/output_hls.h @@ -10,7 +10,8 @@ namespace Mist { void sendTS(const char * tsData, unsigned int len=188); void onHTTP(); bool isReadyForPlay(); - protected: + protected: + bool hasSessionIDs(){return true;} std::string liveIndex(); std::string liveIndex(int tid, std::string & sessId); diff --git a/src/output/output_http.cpp b/src/output/output_http.cpp index dcec6dd8..8f984468 100644 --- a/src/output/output_http.cpp +++ b/src/output/output_http.cpp @@ -211,10 +211,14 @@ namespace Mist { void HTTPOutput::onRequest(){ while (H.Read(myConn)){ - //If no sessionID --> take first 2, else take session id. - if (H.GetVar("sessId").size()){ - std::string ua = H.GetVar("sessId"); - crc = checksum::crc32(0, ua.data(), ua.size()); + if (hasSessionIDs()){ + if (H.GetVar("sessId").size()){ + std::string ua = H.GetVar("sessId"); + crc = checksum::crc32(0, ua.data(), ua.size()); + }else{ + std::string ua = JSON::Value((long long)getpid()).asString(); + crc = checksum::crc32(0, ua.data(), ua.size()); + } }else{ std::string ua = H.GetHeader("User-Agent") + H.GetHeader("X-Playback-Session-Id"); crc = checksum::crc32(0, ua.data(), ua.size());