Allow overriding application name with -DAPPNAME="Name here"
This commit is contained in:
parent
a8e04e1787
commit
771fad390a
21 changed files with 57 additions and 49 deletions
|
@ -107,6 +107,10 @@ endif()
|
||||||
if (DEFINED UDP_API_PORT )
|
if (DEFINED UDP_API_PORT )
|
||||||
add_definitions(-DUDP_API_PORT=${UDP_API_PORT})
|
add_definitions(-DUDP_API_PORT=${UDP_API_PORT})
|
||||||
endif()
|
endif()
|
||||||
|
if (NOT DEFINED APPNAME )
|
||||||
|
set(APPNAME "MistServer")
|
||||||
|
endif()
|
||||||
|
add_definitions(-DAPPNAME="${APPNAME}")
|
||||||
|
|
||||||
########################################
|
########################################
|
||||||
# Build Variables - Thread Names #
|
# Build Variables - Thread Names #
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#define PRETTY_ARG_MSTIME(t) PRETTY_ARG_TIME(t / 1000), (int)(t % 1000)
|
#define PRETTY_ARG_MSTIME(t) PRETTY_ARG_TIME(t / 1000), (int)(t % 1000)
|
||||||
#if DEBUG > -1
|
#if DEBUG > -1
|
||||||
|
|
||||||
|
#define APPIDENT APPNAME "/" PACKAGE_VERSION
|
||||||
#define __STDC_FORMAT_MACROS 1
|
#define __STDC_FORMAT_MACROS 1
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
|
|
|
@ -117,7 +117,11 @@ namespace HTTP{
|
||||||
}
|
}
|
||||||
|
|
||||||
if (method.size()){H.method = method;}
|
if (method.size()){H.method = method;}
|
||||||
H.SetHeader("User-Agent", "MistServer " PACKAGE_VERSION);
|
if (link.host.find("mistserver") != std::string::npos){
|
||||||
|
H.SetHeader("User-Agent", "MistServer" PACKAGE_VERSION);
|
||||||
|
}else{
|
||||||
|
H.SetHeader("User-Agent", APPIDENT);
|
||||||
|
}
|
||||||
H.SetHeader("X-Version", PACKAGE_VERSION);
|
H.SetHeader("X-Version", PACKAGE_VERSION);
|
||||||
H.SetHeader("Accept", "*/*");
|
H.SetHeader("Accept", "*/*");
|
||||||
if (authStr.size() && (link.user.size() || link.pass.size())){
|
if (authStr.size() && (link.user.size() || link.pass.size())){
|
||||||
|
|
|
@ -840,7 +840,7 @@ namespace SDP{
|
||||||
|
|
||||||
M.setCodec(tid, codecRTP2Mist(answerVideoFormat.encodingName));
|
M.setCodec(tid, codecRTP2Mist(answerVideoFormat.encodingName));
|
||||||
if (M.getCodec(tid).empty()){
|
if (M.getCodec(tid).empty()){
|
||||||
FAIL_MSG("Failed to convert the format codec into one that MistServer understands. %s.",
|
FAIL_MSG("Failed to convert the format codec into one that " APPNAME " understands. %s.",
|
||||||
answerVideoFormat.encodingName.c_str());
|
answerVideoFormat.encodingName.c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -859,7 +859,7 @@ namespace SDP{
|
||||||
|
|
||||||
M.setCodec(tid, codecRTP2Mist(answerAudioFormat.encodingName));
|
M.setCodec(tid, codecRTP2Mist(answerAudioFormat.encodingName));
|
||||||
if (M.getCodec(tid).empty()){
|
if (M.getCodec(tid).empty()){
|
||||||
FAIL_MSG("Failed to convert the format codec into one that MistServer understands. %s.",
|
FAIL_MSG("Failed to convert the format codec into one that " APPNAME " understands. %s.",
|
||||||
answerAudioFormat.encodingName.c_str());
|
answerAudioFormat.encodingName.c_str());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1515,9 +1515,10 @@ namespace TS{
|
||||||
entry.setFreeCAM(true); // Not conditional access
|
entry.setFreeCAM(true); // Not conditional access
|
||||||
std::string sdti;
|
std::string sdti;
|
||||||
sdti += (char)0x48;
|
sdti += (char)0x48;
|
||||||
sdti += (char)(15 + streamName.size()); // length
|
sdti += (char)(4 + strlen(APPNAME) + streamName.size()); // length
|
||||||
sdti += (char)1; // digital television service
|
sdti += (char)1; // digital television service
|
||||||
sdti.append("\012MistServer");
|
sdti += (char)strlen(APPNAME);
|
||||||
|
sdti.append(APPNAME);
|
||||||
sdti += (char)streamName.size();
|
sdti += (char)streamName.size();
|
||||||
sdti.append(streamName);
|
sdti.append(streamName);
|
||||||
entry.setESInfo(sdti);
|
entry.setESInfo(sdti);
|
||||||
|
|
|
@ -212,7 +212,7 @@ int main_loop(int argc, char **argv){
|
||||||
strftime(buffer, 25, "%c", timeinfo);
|
strftime(buffer, 25, "%c", timeinfo);
|
||||||
std::cerr << std::endl
|
std::cerr << std::endl
|
||||||
<< std::endl
|
<< std::endl
|
||||||
<< "!----MistServer Started at " << buffer << " ----!" << std::endl;
|
<< "!----" APPNAME " Started at " << buffer << " ----!" << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// reload config from config file
|
// reload config from config file
|
||||||
|
|
|
@ -344,7 +344,7 @@ int Controller::handleAPIConnection(Socket::Connection &conn){
|
||||||
if (!authorized){
|
if (!authorized){
|
||||||
H.Clean();
|
H.Clean();
|
||||||
H.body = "Please login first or provide a valid token authentication.";
|
H.body = "Please login first or provide a valid token authentication.";
|
||||||
H.SetHeader("Server", "MistServer/" PACKAGE_VERSION);
|
H.SetHeader("Server", APPIDENT);
|
||||||
H.SetHeader("WWW-Authenticate", "json " + req["authorize"].toString());
|
H.SetHeader("WWW-Authenticate", "json " + req["authorize"].toString());
|
||||||
H.SendResponse("403", "Not authorized", conn);
|
H.SendResponse("403", "Not authorized", conn);
|
||||||
H.Clean();
|
H.Clean();
|
||||||
|
@ -358,7 +358,7 @@ int Controller::handleAPIConnection(Socket::Connection &conn){
|
||||||
if (!authorized){
|
if (!authorized){
|
||||||
H.Clean();
|
H.Clean();
|
||||||
H.body = "Please login first or provide a valid token authentication.";
|
H.body = "Please login first or provide a valid token authentication.";
|
||||||
H.SetHeader("Server", "MistServer/" PACKAGE_VERSION);
|
H.SetHeader("Server", APPIDENT);
|
||||||
H.SendResponse("403", "Not authorized", conn);
|
H.SendResponse("403", "Not authorized", conn);
|
||||||
H.Clean();
|
H.Clean();
|
||||||
continue;
|
continue;
|
||||||
|
@ -388,7 +388,7 @@ int Controller::handleAPIConnection(Socket::Connection &conn){
|
||||||
H.Clean();
|
H.Clean();
|
||||||
H.SetHeader("Content-Type", "text/html");
|
H.SetHeader("Content-Type", "text/html");
|
||||||
H.SetHeader("X-Info", "To force an API response, request the file /api");
|
H.SetHeader("X-Info", "To force an API response, request the file /api");
|
||||||
H.SetHeader("Server", "MistServer/" PACKAGE_VERSION);
|
H.SetHeader("Server", APPIDENT);
|
||||||
H.SetHeader("Content-Length", server_html_len);
|
H.SetHeader("Content-Length", server_html_len);
|
||||||
H.SetHeader("X-UA-Compatible", "IE=edge;chrome=1");
|
H.SetHeader("X-UA-Compatible", "IE=edge;chrome=1");
|
||||||
H.SendResponse("200", "OK", conn);
|
H.SendResponse("200", "OK", conn);
|
||||||
|
|
|
@ -16,13 +16,13 @@ namespace Controller{
|
||||||
/// Generate list of available triggers, storing in global 'capabilities' JSON::Value.
|
/// Generate list of available triggers, storing in global 'capabilities' JSON::Value.
|
||||||
void checkAvailTriggers(){
|
void checkAvailTriggers(){
|
||||||
JSON::Value &trgs = capabilities["triggers"];
|
JSON::Value &trgs = capabilities["triggers"];
|
||||||
trgs["SYSTEM_START"]["when"] = "After MistServer boot";
|
trgs["SYSTEM_START"]["when"] = "After " APPNAME " boot";
|
||||||
trgs["SYSTEM_START"]["stream_specific"] = false;
|
trgs["SYSTEM_START"]["stream_specific"] = false;
|
||||||
trgs["SYSTEM_START"]["payload"] = "";
|
trgs["SYSTEM_START"]["payload"] = "";
|
||||||
trgs["SYSTEM_START"]["response"] = "always";
|
trgs["SYSTEM_START"]["response"] = "always";
|
||||||
trgs["SYSTEM_START"]["response_action"] = "If false, shuts down the server.";
|
trgs["SYSTEM_START"]["response_action"] = "If false, shuts down the server.";
|
||||||
|
|
||||||
trgs["SYSTEM_STOP"]["when"] = "Before MistServer shuts down";
|
trgs["SYSTEM_STOP"]["when"] = "Before " APPNAME " shuts down";
|
||||||
trgs["SYSTEM_STOP"]["stream_specific"] = false;
|
trgs["SYSTEM_STOP"]["stream_specific"] = false;
|
||||||
trgs["SYSTEM_STOP"]["payload"] = "shutdown reason (string)";
|
trgs["SYSTEM_STOP"]["payload"] = "shutdown reason (string)";
|
||||||
trgs["SYSTEM_STOP"]["response"] = "always";
|
trgs["SYSTEM_STOP"]["response"] = "always";
|
||||||
|
|
|
@ -1474,7 +1474,7 @@ void Controller::handlePrometheus(HTTP::Parser &H, Socket::Connection &conn, int
|
||||||
if (H.GetVar("jsonp") != ""){jsonp = H.GetVar("jsonp");}
|
if (H.GetVar("jsonp") != ""){jsonp = H.GetVar("jsonp");}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
H.SetHeader("Server", "MistServer/" PACKAGE_VERSION);
|
H.SetHeader("Server", APPIDENT);
|
||||||
H.StartResponse("200", "OK", H, conn, true);
|
H.StartResponse("200", "OK", H, conn, true);
|
||||||
|
|
||||||
// Collect core server stats
|
// Collect core server stats
|
||||||
|
|
|
@ -1110,8 +1110,7 @@ namespace Mist{
|
||||||
"</ServerKey><RequestXml>"
|
"</ServerKey><RequestXml>"
|
||||||
"<![CDATA["
|
"<![CDATA["
|
||||||
"<KeyOSEncryptionInfoRequest><APIVersion>5.0.0.2</APIVersion><DRMType>smooth</"
|
"<KeyOSEncryptionInfoRequest><APIVersion>5.0.0.2</APIVersion><DRMType>smooth</"
|
||||||
"DRMType><EncoderVersion>"
|
"DRMType><EncoderVersion>" APPIDENT "</EncoderVersion><UserKey>";
|
||||||
"MistServer " RELEASE "_" PACKAGE_VERSION "</EncoderVersion><UserKey>";
|
|
||||||
soap << config->getString("buydrm");
|
soap << config->getString("buydrm");
|
||||||
soap << "</UserKey><KeyID>";
|
soap << "</UserKey><KeyID>";
|
||||||
soap << formatGUID(contentID);
|
soap << formatGUID(contentID);
|
||||||
|
|
|
@ -16,8 +16,8 @@ namespace Mist{
|
||||||
inputDTSC::inputDTSC(Util::Config *cfg) : Input(cfg){
|
inputDTSC::inputDTSC(Util::Config *cfg) : Input(cfg){
|
||||||
capa["name"] = "DTSC";
|
capa["name"] = "DTSC";
|
||||||
capa["desc"] = "Load DTSC files as Video on Demand sources, or dtsc:// URLs from other "
|
capa["desc"] = "Load DTSC files as Video on Demand sources, or dtsc:// URLs from other "
|
||||||
"MistServer instances for live sources. This is the optimal method to pull live "
|
"instances for live sources. This is the optimal method to pull live "
|
||||||
"sources from other MistServer (or compatible) instances.";
|
"sources from MistServer compatible instances.";
|
||||||
capa["priority"] = 9;
|
capa["priority"] = 9;
|
||||||
capa["source_match"].append("/*.dtsc");
|
capa["source_match"].append("/*.dtsc");
|
||||||
capa["source_match"].append("dtsc://*");
|
capa["source_match"].append("dtsc://*");
|
||||||
|
@ -193,7 +193,7 @@ namespace Mist{
|
||||||
if (!srcConn.connected()){return false;}
|
if (!srcConn.connected()){return false;}
|
||||||
JSON::Value prep;
|
JSON::Value prep;
|
||||||
prep["cmd"] = "play";
|
prep["cmd"] = "play";
|
||||||
prep["version"] = "MistServer " PACKAGE_VERSION;
|
prep["version"] = APPIDENT;
|
||||||
prep["stream"] = streamName;
|
prep["stream"] = streamName;
|
||||||
srcConn.SendNow("DTCM");
|
srcConn.SendNow("DTCM");
|
||||||
char sSize[4] ={0, 0, 0, 0};
|
char sSize[4] ={0, 0, 0, 0};
|
||||||
|
|
|
@ -100,7 +100,7 @@ namespace Mist{
|
||||||
if ((username.size() || password.size()) && authRequest.size()){
|
if ((username.size() || password.size()) && authRequest.size()){
|
||||||
sndH.auth(username, password, authRequest);
|
sndH.auth(username, password, authRequest);
|
||||||
}
|
}
|
||||||
sndH.SetHeader("User-Agent", "MistServer " PACKAGE_VERSION);
|
sndH.SetHeader("User-Agent", APPIDENT);
|
||||||
sndH.SetHeader("CSeq", JSON::Value(cSeq).asString());
|
sndH.SetHeader("CSeq", JSON::Value(cSeq).asString());
|
||||||
if (session.size()){sndH.SetHeader("Session", session);}
|
if (session.size()){sndH.SetHeader("Session", session);}
|
||||||
if (extraHeaders && extraHeaders->size()){
|
if (extraHeaders && extraHeaders->size()){
|
||||||
|
|
|
@ -13,7 +13,7 @@ namespace Mist{
|
||||||
setBlocking(true);
|
setBlocking(true);
|
||||||
JSON::Value prep;
|
JSON::Value prep;
|
||||||
prep["cmd"] = "hi";
|
prep["cmd"] = "hi";
|
||||||
prep["version"] = "MistServer " PACKAGE_VERSION;
|
prep["version"] = APPIDENT;
|
||||||
prep["pack_method"] = 2;
|
prep["pack_method"] = 2;
|
||||||
salt = Secure::md5("mehstuff" + JSON::Value((uint64_t)time(0)).asString());
|
salt = Secure::md5("mehstuff" + JSON::Value((uint64_t)time(0)).asString());
|
||||||
prep["salt"] = salt;
|
prep["salt"] = salt;
|
||||||
|
@ -55,8 +55,7 @@ namespace Mist{
|
||||||
Output::init(cfg);
|
Output::init(cfg);
|
||||||
capa["name"] = "DTSC";
|
capa["name"] = "DTSC";
|
||||||
capa["friendly"] = "DTSC";
|
capa["friendly"] = "DTSC";
|
||||||
capa["desc"] = "Real time streaming over DTSC (MistServer proprietary protocol, for efficient "
|
capa["desc"] = "Real time streaming over DTSC (proprietary protocol for efficient inter-server streaming)";
|
||||||
"inter-server streaming)";
|
|
||||||
capa["deps"] = "";
|
capa["deps"] = "";
|
||||||
capa["codecs"][0u][0u].append("+*");
|
capa["codecs"][0u][0u].append("+*");
|
||||||
cfg->addConnectorOptions(4200, capa);
|
cfg->addConnectorOptions(4200, capa);
|
||||||
|
|
|
@ -335,7 +335,7 @@ namespace Mist{
|
||||||
EBML::sendElemSeek(myConn, EBML::EID_CUES, seekheadSize + infoSize + tracksSize);
|
EBML::sendElemSeek(myConn, EBML::EID_CUES, seekheadSize + infoSize + tracksSize);
|
||||||
}
|
}
|
||||||
// Info
|
// Info
|
||||||
EBML::sendElemInfo(myConn, "MistServer " PACKAGE_VERSION, duration);
|
EBML::sendElemInfo(myConn, APPIDENT, duration);
|
||||||
// Tracks
|
// Tracks
|
||||||
size_t trackSizes = 0;
|
size_t trackSizes = 0;
|
||||||
for (std::map<size_t, Comms::Users>::iterator it = userSelect.begin(); it != userSelect.end(); it++){
|
for (std::map<size_t, Comms::Users>::iterator it = userSelect.begin(); it != userSelect.end(); it++){
|
||||||
|
@ -497,7 +497,7 @@ namespace Mist{
|
||||||
// Segment contains SeekHead, Info, Tracks, Cues (in that order)
|
// Segment contains SeekHead, Info, Tracks, Cues (in that order)
|
||||||
// Howeveer, SeekHead is dependent on Info/Tracks sizes, so we calculate those first.
|
// Howeveer, SeekHead is dependent on Info/Tracks sizes, so we calculate those first.
|
||||||
// Calculating Info size
|
// Calculating Info size
|
||||||
infoSize = EBML::sizeElemInfo("MistServer " PACKAGE_VERSION, duration);
|
infoSize = EBML::sizeElemInfo(APPIDENT, duration);
|
||||||
// Calculating Tracks size
|
// Calculating Tracks size
|
||||||
tracksSize = 0;
|
tracksSize = 0;
|
||||||
for (std::map<size_t, Comms::Users>::iterator it = userSelect.begin(); it != userSelect.end(); it++){
|
for (std::map<size_t, Comms::Users>::iterator it = userSelect.begin(); it != userSelect.end(); it++){
|
||||||
|
|
|
@ -226,7 +226,7 @@ namespace Mist{
|
||||||
if (H.url == "/crossdomain.xml"){
|
if (H.url == "/crossdomain.xml"){
|
||||||
H.Clean();
|
H.Clean();
|
||||||
H.SetHeader("Content-Type", "text/xml");
|
H.SetHeader("Content-Type", "text/xml");
|
||||||
H.SetHeader("Server", "MistServer/" PACKAGE_VERSION);
|
H.SetHeader("Server", APPIDENT);
|
||||||
H.setCORSHeaders();
|
H.setCORSHeaders();
|
||||||
if (method == "OPTIONS" || method == "HEAD"){
|
if (method == "OPTIONS" || method == "HEAD"){
|
||||||
H.SendResponse("200", "OK", myConn);
|
H.SendResponse("200", "OK", myConn);
|
||||||
|
@ -415,7 +415,7 @@ namespace Mist{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
H.Clean(); // make sure no parts of old requests are left in any buffers
|
H.Clean(); // make sure no parts of old requests are left in any buffers
|
||||||
H.SetHeader("Server", "MistServer/" PACKAGE_VERSION);
|
H.SetHeader("Server", APPIDENT);
|
||||||
H.setCORSHeaders();
|
H.setCORSHeaders();
|
||||||
H.SetHeader("Content-Type", "application/vnd.apple.mpegurl");
|
H.SetHeader("Content-Type", "application/vnd.apple.mpegurl");
|
||||||
H.SetHeader("Cache-Control", "no-cache");
|
H.SetHeader("Cache-Control", "no-cache");
|
||||||
|
|
|
@ -58,7 +58,7 @@ namespace Mist{
|
||||||
INFO_MSG("Failing '%s': %s", H.url.c_str(), msg.c_str());
|
INFO_MSG("Failing '%s': %s", H.url.c_str(), msg.c_str());
|
||||||
if (!webSock && !isRecording()){
|
if (!webSock && !isRecording()){
|
||||||
H.Clean(); // make sure no parts of old requests are left in any buffers
|
H.Clean(); // make sure no parts of old requests are left in any buffers
|
||||||
H.SetHeader("Server", "MistServer/" PACKAGE_VERSION);
|
H.SetHeader("Server", APPIDENT);
|
||||||
H.setCORSHeaders();
|
H.setCORSHeaders();
|
||||||
H.SetBody("Could not retrieve stream: " + msg);
|
H.SetBody("Could not retrieve stream: " + msg);
|
||||||
H.SendResponse("404", "Error opening stream", myConn);
|
H.SendResponse("404", "Error opening stream", myConn);
|
||||||
|
@ -208,7 +208,7 @@ namespace Mist{
|
||||||
H.GetVar("stream").c_str());
|
H.GetVar("stream").c_str());
|
||||||
if (!handler.size()){
|
if (!handler.size()){
|
||||||
H.Clean();
|
H.Clean();
|
||||||
H.SetHeader("Server", "MistServer/" PACKAGE_VERSION);
|
H.SetHeader("Server", APPIDENT);
|
||||||
H.setCORSHeaders();
|
H.setCORSHeaders();
|
||||||
H.SetBody("<!DOCTYPE html><html><head><title>Unsupported Media "
|
H.SetBody("<!DOCTYPE html><html><head><title>Unsupported Media "
|
||||||
"Type</title></head><body><h1>Unsupported Media Type</h1>The server isn't quite "
|
"Type</title></head><body><h1>Unsupported Media Type</h1>The server isn't quite "
|
||||||
|
|
|
@ -375,7 +375,7 @@ namespace Mist{
|
||||||
H.Clean();
|
H.Clean();
|
||||||
H.SetHeader("Content-Type", "text/html");
|
H.SetHeader("Content-Type", "text/html");
|
||||||
H.SetHeader("X-UA-Compatible", "IE=edge");
|
H.SetHeader("X-UA-Compatible", "IE=edge");
|
||||||
H.SetHeader("Server", "MistServer/" PACKAGE_VERSION);
|
H.SetHeader("Server", APPIDENT);
|
||||||
H.setCORSHeaders();
|
H.setCORSHeaders();
|
||||||
if (method == "OPTIONS" || method == "HEAD"){
|
if (method == "OPTIONS" || method == "HEAD"){
|
||||||
H.SendResponse("200", "OK", myConn);
|
H.SendResponse("200", "OK", myConn);
|
||||||
|
@ -599,7 +599,7 @@ namespace Mist{
|
||||||
if (it->asStringRef().substr(0, cbToken.size() + 1) == cbToken + ":"){
|
if (it->asStringRef().substr(0, cbToken.size() + 1) == cbToken + ":"){
|
||||||
H.Clean();
|
H.Clean();
|
||||||
H.SetHeader("Content-Type", "text/plain");
|
H.SetHeader("Content-Type", "text/plain");
|
||||||
H.SetHeader("Server", "MistServer/" PACKAGE_VERSION);
|
H.SetHeader("Server", APPIDENT);
|
||||||
H.setCORSHeaders();
|
H.setCORSHeaders();
|
||||||
H.SetBody(it->asStringRef().substr(cbToken.size() + 1));
|
H.SetBody(it->asStringRef().substr(cbToken.size() + 1));
|
||||||
H.SendResponse("200", "OK", myConn);
|
H.SendResponse("200", "OK", myConn);
|
||||||
|
@ -609,7 +609,7 @@ namespace Mist{
|
||||||
}
|
}
|
||||||
H.Clean();
|
H.Clean();
|
||||||
H.SetHeader("Content-Type", "text/plain");
|
H.SetHeader("Content-Type", "text/plain");
|
||||||
H.SetHeader("Server", "MistServer/" PACKAGE_VERSION);
|
H.SetHeader("Server", APPIDENT);
|
||||||
H.setCORSHeaders();
|
H.setCORSHeaders();
|
||||||
H.SetBody("No matching validation found for token '" + cbToken + "'");
|
H.SetBody("No matching validation found for token '" + cbToken + "'");
|
||||||
H.SendResponse("404", "Not found", myConn);
|
H.SendResponse("404", "Not found", myConn);
|
||||||
|
@ -620,7 +620,7 @@ namespace Mist{
|
||||||
if (H.url == "/crossdomain.xml"){
|
if (H.url == "/crossdomain.xml"){
|
||||||
H.Clean();
|
H.Clean();
|
||||||
H.SetHeader("Content-Type", "text/xml");
|
H.SetHeader("Content-Type", "text/xml");
|
||||||
H.SetHeader("Server", "MistServer/" PACKAGE_VERSION);
|
H.SetHeader("Server", APPIDENT);
|
||||||
H.setCORSHeaders();
|
H.setCORSHeaders();
|
||||||
if (method == "OPTIONS" || method == "HEAD"){
|
if (method == "OPTIONS" || method == "HEAD"){
|
||||||
H.SendResponse("200", "OK", myConn);
|
H.SendResponse("200", "OK", myConn);
|
||||||
|
@ -639,7 +639,7 @@ namespace Mist{
|
||||||
if (H.url == "/clientaccesspolicy.xml"){
|
if (H.url == "/clientaccesspolicy.xml"){
|
||||||
H.Clean();
|
H.Clean();
|
||||||
H.SetHeader("Content-Type", "text/xml");
|
H.SetHeader("Content-Type", "text/xml");
|
||||||
H.SetHeader("Server", "MistServer/" PACKAGE_VERSION);
|
H.SetHeader("Server", APPIDENT);
|
||||||
H.setCORSHeaders();
|
H.setCORSHeaders();
|
||||||
if (method == "OPTIONS" || method == "HEAD"){
|
if (method == "OPTIONS" || method == "HEAD"){
|
||||||
H.SendResponse("200", "OK", myConn);
|
H.SendResponse("200", "OK", myConn);
|
||||||
|
@ -660,7 +660,7 @@ namespace Mist{
|
||||||
if (H.url == "/flashplayer.swf"){
|
if (H.url == "/flashplayer.swf"){
|
||||||
H.Clean();
|
H.Clean();
|
||||||
H.SetHeader("Content-Type", "application/x-shockwave-flash");
|
H.SetHeader("Content-Type", "application/x-shockwave-flash");
|
||||||
H.SetHeader("Server", "MistServer/" PACKAGE_VERSION);
|
H.SetHeader("Server", APPIDENT);
|
||||||
H.SetBody((const char *)FlashMediaPlayback_101_swf, FlashMediaPlayback_101_swf_len);
|
H.SetBody((const char *)FlashMediaPlayback_101_swf, FlashMediaPlayback_101_swf_len);
|
||||||
H.SendResponse("200", "OK", myConn);
|
H.SendResponse("200", "OK", myConn);
|
||||||
return;
|
return;
|
||||||
|
@ -668,7 +668,7 @@ namespace Mist{
|
||||||
if (H.url == "/oldflashplayer.swf"){
|
if (H.url == "/oldflashplayer.swf"){
|
||||||
H.Clean();
|
H.Clean();
|
||||||
H.SetHeader("Content-Type", "application/x-shockwave-flash");
|
H.SetHeader("Content-Type", "application/x-shockwave-flash");
|
||||||
H.SetHeader("Server", "MistServer/" PACKAGE_VERSION);
|
H.SetHeader("Server", APPIDENT);
|
||||||
H.SetBody((const char *)FlashMediaPlayback_swf, FlashMediaPlayback_swf_len);
|
H.SetBody((const char *)FlashMediaPlayback_swf, FlashMediaPlayback_swf_len);
|
||||||
H.SendResponse("200", "OK", myConn);
|
H.SendResponse("200", "OK", myConn);
|
||||||
return;
|
return;
|
||||||
|
@ -723,7 +723,7 @@ namespace Mist{
|
||||||
|
|
||||||
H.Clean();
|
H.Clean();
|
||||||
H.SetHeader("Content-Type", "application/smil");
|
H.SetHeader("Content-Type", "application/smil");
|
||||||
H.SetHeader("Server", "MistServer/" PACKAGE_VERSION);
|
H.SetHeader("Server", APPIDENT);
|
||||||
H.setCORSHeaders();
|
H.setCORSHeaders();
|
||||||
if (method == "OPTIONS" || method == "HEAD"){
|
if (method == "OPTIONS" || method == "HEAD"){
|
||||||
H.SendResponse("200", "OK", myConn);
|
H.SendResponse("200", "OK", myConn);
|
||||||
|
@ -747,7 +747,7 @@ namespace Mist{
|
||||||
std::string rURL = H.url;
|
std::string rURL = H.url;
|
||||||
if (method != "OPTIONS" && method != "HEAD"){initialize();}
|
if (method != "OPTIONS" && method != "HEAD"){initialize();}
|
||||||
H.Clean();
|
H.Clean();
|
||||||
H.SetHeader("Server", "MistServer/" PACKAGE_VERSION);
|
H.SetHeader("Server", APPIDENT);
|
||||||
H.setCORSHeaders();
|
H.setCORSHeaders();
|
||||||
if (rURL.substr(0, 6) != "/json_"){
|
if (rURL.substr(0, 6) != "/json_"){
|
||||||
H.SetHeader("Content-Type", "application/javascript");
|
H.SetHeader("Content-Type", "application/javascript");
|
||||||
|
@ -787,7 +787,7 @@ namespace Mist{
|
||||||
std::string response;
|
std::string response;
|
||||||
std::string rURL = H.url;
|
std::string rURL = H.url;
|
||||||
H.Clean();
|
H.Clean();
|
||||||
H.SetHeader("Server", "MistServer/" PACKAGE_VERSION);
|
H.SetHeader("Server", APPIDENT);
|
||||||
H.setCORSHeaders();
|
H.setCORSHeaders();
|
||||||
H.SetHeader("Content-Type", "application/javascript; charset=utf-8");
|
H.SetHeader("Content-Type", "application/javascript; charset=utf-8");
|
||||||
if (method == "OPTIONS" || method == "HEAD"){
|
if (method == "OPTIONS" || method == "HEAD"){
|
||||||
|
@ -860,7 +860,7 @@ namespace Mist{
|
||||||
std::string response;
|
std::string response;
|
||||||
std::string url = H.url;
|
std::string url = H.url;
|
||||||
H.Clean();
|
H.Clean();
|
||||||
H.SetHeader("Server", "MistServer/" PACKAGE_VERSION);
|
H.SetHeader("Server", APPIDENT);
|
||||||
H.setCORSHeaders();
|
H.setCORSHeaders();
|
||||||
H.SetHeader("Content-Type", "text/css");
|
H.SetHeader("Content-Type", "text/css");
|
||||||
if (method == "OPTIONS" || method == "HEAD"){
|
if (method == "OPTIONS" || method == "HEAD"){
|
||||||
|
@ -893,7 +893,7 @@ namespace Mist{
|
||||||
if (H.url == "/videojs.js"){
|
if (H.url == "/videojs.js"){
|
||||||
std::string response;
|
std::string response;
|
||||||
H.Clean();
|
H.Clean();
|
||||||
H.SetHeader("Server", "MistServer/" PACKAGE_VERSION);
|
H.SetHeader("Server", APPIDENT);
|
||||||
H.setCORSHeaders();
|
H.setCORSHeaders();
|
||||||
H.SetHeader("Content-Type", "application/javascript");
|
H.SetHeader("Content-Type", "application/javascript");
|
||||||
if (method == "OPTIONS" || method == "HEAD"){
|
if (method == "OPTIONS" || method == "HEAD"){
|
||||||
|
@ -913,7 +913,7 @@ namespace Mist{
|
||||||
if (H.url == "/dashjs.js"){
|
if (H.url == "/dashjs.js"){
|
||||||
std::string response;
|
std::string response;
|
||||||
H.Clean();
|
H.Clean();
|
||||||
H.SetHeader("Server", "MistServer/" PACKAGE_VERSION);
|
H.SetHeader("Server", APPIDENT);
|
||||||
H.setCORSHeaders();
|
H.setCORSHeaders();
|
||||||
H.SetHeader("Content-Type", "application/javascript");
|
H.SetHeader("Content-Type", "application/javascript");
|
||||||
if (method == "OPTIONS" || method == "HEAD"){
|
if (method == "OPTIONS" || method == "HEAD"){
|
||||||
|
@ -935,7 +935,7 @@ namespace Mist{
|
||||||
if (H.url == "/webrtc.js"){
|
if (H.url == "/webrtc.js"){
|
||||||
std::string response;
|
std::string response;
|
||||||
H.Clean();
|
H.Clean();
|
||||||
H.SetHeader("Server", "MistServer/" PACKAGE_VERSION);
|
H.SetHeader("Server", APPIDENT);
|
||||||
H.setCORSHeaders();
|
H.setCORSHeaders();
|
||||||
H.SetHeader("Content-Type", "application/javascript");
|
H.SetHeader("Content-Type", "application/javascript");
|
||||||
if (method == "OPTIONS" || method == "HEAD"){
|
if (method == "OPTIONS" || method == "HEAD"){
|
||||||
|
@ -979,7 +979,7 @@ namespace Mist{
|
||||||
/*LTS-START*/
|
/*LTS-START*/
|
||||||
if (H.GetVar("s").size() && H.GetVar("s") == SUPER_SECRET){
|
if (H.GetVar("s").size() && H.GetVar("s") == SUPER_SECRET){
|
||||||
H.Clean();
|
H.Clean();
|
||||||
H.SetHeader("Server", "mistserver/" PACKAGE_VERSION);
|
H.SetHeader("Server", APPIDENT);
|
||||||
H.setCORSHeaders();
|
H.setCORSHeaders();
|
||||||
if (method == "OPTIONS" || method == "HEAD"){
|
if (method == "OPTIONS" || method == "HEAD"){
|
||||||
H.SendResponse("200", "OK", myConn);
|
H.SendResponse("200", "OK", myConn);
|
||||||
|
@ -995,7 +995,7 @@ namespace Mist{
|
||||||
H.Clean();
|
H.Clean();
|
||||||
#include "../icon.h"
|
#include "../icon.h"
|
||||||
H.SetHeader("Content-Type", "image/x-icon");
|
H.SetHeader("Content-Type", "image/x-icon");
|
||||||
H.SetHeader("Server", "MistServer/" PACKAGE_VERSION);
|
H.SetHeader("Server", APPIDENT);
|
||||||
H.SetHeader("Content-Length", icon_len);
|
H.SetHeader("Content-Length", icon_len);
|
||||||
H.setCORSHeaders();
|
H.setCORSHeaders();
|
||||||
if (method == "OPTIONS" || method == "HEAD"){
|
if (method == "OPTIONS" || method == "HEAD"){
|
||||||
|
|
|
@ -48,7 +48,7 @@ namespace Mist{
|
||||||
WARN_MSG("URL %s is not inside webroot %s: %s", H.url.c_str(), resolved_path.c_str(), path.c_str());
|
WARN_MSG("URL %s is not inside webroot %s: %s", H.url.c_str(), resolved_path.c_str(), path.c_str());
|
||||||
}
|
}
|
||||||
H.Clean();
|
H.Clean();
|
||||||
H.SetHeader("Server", "mistserver/" PACKAGE_VERSION);
|
H.SetHeader("Server", APPIDENT);
|
||||||
H.setCORSHeaders();
|
H.setCORSHeaders();
|
||||||
if (method == "OPTIONS" || method == "HEAD"){
|
if (method == "OPTIONS" || method == "HEAD"){
|
||||||
H.SendResponse("200", "OK", myConn);
|
H.SendResponse("200", "OK", myConn);
|
||||||
|
@ -65,7 +65,7 @@ namespace Mist{
|
||||||
unsigned long long filesize = inFile.tellg();
|
unsigned long long filesize = inFile.tellg();
|
||||||
inFile.seekg(0, std::ios_base::beg);
|
inFile.seekg(0, std::ios_base::beg);
|
||||||
H.Clean();
|
H.Clean();
|
||||||
H.SetHeader("Server", "mistserver/" PACKAGE_VERSION);
|
H.SetHeader("Server", APPIDENT);
|
||||||
H.SetHeader("Content-Length", filesize);
|
H.SetHeader("Content-Length", filesize);
|
||||||
H.setCORSHeaders();
|
H.setCORSHeaders();
|
||||||
if (method == "OPTIONS" || method == "HEAD"){
|
if (method == "OPTIONS" || method == "HEAD"){
|
||||||
|
|
|
@ -223,7 +223,7 @@ namespace Mist{
|
||||||
|
|
||||||
// seed the rng
|
// seed the rng
|
||||||
if ((ret = mbedtls_ctr_drbg_seed(&ctr_drbg, mbedtls_entropy_func, &entropy,
|
if ((ret = mbedtls_ctr_drbg_seed(&ctr_drbg, mbedtls_entropy_func, &entropy,
|
||||||
(const unsigned char *)"MistServer", 10)) != 0){
|
(const unsigned char *)APPNAME, strlen(APPNAME))) != 0){
|
||||||
FAIL_MSG("Could not seed the random number generator!");
|
FAIL_MSG("Could not seed the random number generator!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -138,7 +138,7 @@ namespace Mist{
|
||||||
amfReply.getContentP(2)->addContent(AMF::Object("app", app + args));
|
amfReply.getContentP(2)->addContent(AMF::Object("app", app + args));
|
||||||
amfReply.getContentP(2)->addContent(AMF::Object("type", "nonprivate"));
|
amfReply.getContentP(2)->addContent(AMF::Object("type", "nonprivate"));
|
||||||
amfReply.getContentP(2)->addContent(
|
amfReply.getContentP(2)->addContent(
|
||||||
AMF::Object("flashVer", "FMLE/3.0 (compatible; MistServer/" PACKAGE_VERSION "/" RELEASE ")"));
|
AMF::Object("flashVer", "FMLE/3.0 (compatible; " APPNAME ")"));
|
||||||
amfReply.getContentP(2)->addContent(AMF::Object("tcUrl", pushHost + app + args));
|
amfReply.getContentP(2)->addContent(AMF::Object("tcUrl", pushHost + app + args));
|
||||||
sendCommand(amfReply, 20, 0);
|
sendCommand(amfReply, 20, 0);
|
||||||
|
|
||||||
|
|
|
@ -189,7 +189,7 @@ namespace Mist{
|
||||||
<< reqUrl
|
<< reqUrl
|
||||||
<< "\r\n"
|
<< "\r\n"
|
||||||
"t=0 0\r\n"
|
"t=0 0\r\n"
|
||||||
"a=tool:MistServer\r\n"
|
"a=tool:" APPIDENT "\r\n"
|
||||||
"a=type:broadcast\r\n"
|
"a=type:broadcast\r\n"
|
||||||
"a=control:*\r\n"
|
"a=control:*\r\n"
|
||||||
<< "a=range:npt=" << ((double)startTime()) / 1000.0 << "-"
|
<< "a=range:npt=" << ((double)startTime()) / 1000.0 << "-"
|
||||||
|
@ -327,7 +327,7 @@ namespace Mist{
|
||||||
<< reqUrl
|
<< reqUrl
|
||||||
<< "\r\n"
|
<< "\r\n"
|
||||||
"t=0 0\r\n"
|
"t=0 0\r\n"
|
||||||
"a=tool:MistServer\r\n"
|
"a=tool:" APPIDENT "\r\n"
|
||||||
"a=type:broadcast\r\n"
|
"a=type:broadcast\r\n"
|
||||||
"a=control:*\r\n"
|
"a=control:*\r\n"
|
||||||
<< "a=range:npt=" << ((double)startTime()) / 1000.0 << "-"
|
<< "a=range:npt=" << ((double)startTime()) / 1000.0 << "-"
|
||||||
|
|
Loading…
Add table
Reference in a new issue