Fixed support for non-HTTP-compliant devices pulling HTTP TS output
This commit is contained in:
parent
bfa9882e8c
commit
6816b6074c
3 changed files with 9 additions and 1 deletions
|
@ -334,6 +334,10 @@ void HTTP::Parser::SetHeader(std::string i, std::string v) {
|
||||||
headers[i] = v;
|
headers[i] = v;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void HTTP::Parser::clearHeader(const std::string & i){
|
||||||
|
headers.erase(i);
|
||||||
|
}
|
||||||
|
|
||||||
/// Sets header i to integer value v.
|
/// Sets header i to integer value v.
|
||||||
void HTTP::Parser::SetHeader(std::string i, long long v) {
|
void HTTP::Parser::SetHeader(std::string i, long long v) {
|
||||||
Trim(i);
|
Trim(i);
|
||||||
|
|
|
@ -17,6 +17,7 @@ namespace HTTP {
|
||||||
bool Read(Socket::Connection & conn);
|
bool Read(Socket::Connection & conn);
|
||||||
bool Read(std::string & strbuf);
|
bool Read(std::string & strbuf);
|
||||||
std::string GetHeader(std::string i);
|
std::string GetHeader(std::string i);
|
||||||
|
void clearHeader(const std::string & i);
|
||||||
std::string GetVar(std::string i);
|
std::string GetVar(std::string i);
|
||||||
std::string getUrl();
|
std::string getUrl();
|
||||||
std::string allVars();
|
std::string allVars();
|
||||||
|
|
|
@ -26,8 +26,10 @@ namespace Mist {
|
||||||
|
|
||||||
void OutHTTPTS::onHTTP(){
|
void OutHTTPTS::onHTTP(){
|
||||||
std::string method = H.method;
|
std::string method = H.method;
|
||||||
|
|
||||||
initialize();
|
initialize();
|
||||||
|
H.clearHeader("Range");
|
||||||
|
H.clearHeader("Icy-MetaData");
|
||||||
|
H.clearHeader("User-Agent");
|
||||||
H.SetHeader("Content-Type", "video/mp2t");
|
H.SetHeader("Content-Type", "video/mp2t");
|
||||||
H.setCORSHeaders();
|
H.setCORSHeaders();
|
||||||
if(method == "OPTIONS" || method == "HEAD"){
|
if(method == "OPTIONS" || method == "HEAD"){
|
||||||
|
@ -35,6 +37,7 @@ namespace Mist {
|
||||||
H.Clean();
|
H.Clean();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
H.protocol = "HTTP/1.0";//Force HTTP/1.0 because some devices just don't understand chunked replies
|
||||||
H.StartResponse(H, myConn);
|
H.StartResponse(H, myConn);
|
||||||
parseData = true;
|
parseData = true;
|
||||||
wantRequest = false;
|
wantRequest = false;
|
||||||
|
|
Loading…
Add table
Reference in a new issue