diff --git a/src/connectors/conn_http_progressive_flv.cpp b/src/connectors/conn_http_progressive_flv.cpp index 2c0426b3..27200a2c 100644 --- a/src/connectors/conn_http_progressive_flv.cpp +++ b/src/connectors/conn_http_progressive_flv.cpp @@ -163,6 +163,12 @@ namespace Connector_HTTP { if (Strm.lastType() == DTSC::PAUSEMARK){ conn.close(); } + if (Strm.lastType() == DTSC::INVALID){ + #if DEBUG >= 3 + fprintf(stderr, "Invalid packet received - closing connection.\n"); + #endif + conn.close(); + } if (Strm.lastType() == DTSC::AUDIO || Strm.lastType() == DTSC::VIDEO){ std::string codec = Strm.getTrackById(Strm.getPacket()["trackid"].asInt())["codec"].asString(); if (codec == "AAC" || codec == "MP3" || codec == "H264"){ diff --git a/src/connectors/conn_http_progressive_mp3.cpp b/src/connectors/conn_http_progressive_mp3.cpp index 97ea16f8..7159dc75 100644 --- a/src/connectors/conn_http_progressive_mp3.cpp +++ b/src/connectors/conn_http_progressive_mp3.cpp @@ -132,10 +132,16 @@ namespace Connector_HTTP { conn.SendNow(HTTP_S.BuildResponse("200", "OK")); //no SetBody = unknown length - this is intentional, we will stream the entire file progressive_has_sent_header = true; } - if(Strm.lastType() == DTSC::PAUSEMARK){ + if (Strm.lastType() == DTSC::PAUSEMARK){ conn.close(); } - if(Strm.lastType() == DTSC::AUDIO){ + if (Strm.lastType() == DTSC::INVALID){ + #if DEBUG >= 3 + fprintf(stderr, "Invalid packet received - closing connection.\n"); + #endif + conn.close(); + } + if (Strm.lastType() == DTSC::AUDIO){ conn.SendNow(Strm.lastData()); //write the MP3 contents } } diff --git a/src/connectors/conn_http_progressive_mp4.cpp b/src/connectors/conn_http_progressive_mp4.cpp index 00157705..2e451489 100644 --- a/src/connectors/conn_http_progressive_mp4.cpp +++ b/src/connectors/conn_http_progressive_mp4.cpp @@ -182,6 +182,12 @@ namespace Connector_HTTP { //parse DTSC to MP4 here conn.SendNow(Strm.lastData());//send out and clear Convverter buffer } + if (Strm.lastType() == DTSC::INVALID){ + #if DEBUG >= 3 + fprintf(stderr, "Invalid packet received - closing connection.\n"); + #endif + conn.close(); + } } }else{ Util::sleep(1); diff --git a/src/connectors/conn_http_progressive_ogg.cpp b/src/connectors/conn_http_progressive_ogg.cpp index 0d86b56e..f84e60c8 100644 --- a/src/connectors/conn_http_progressive_ogg.cpp +++ b/src/connectors/conn_http_progressive_ogg.cpp @@ -190,7 +190,12 @@ namespace Connector_HTTP { if (Strm.lastType() == DTSC::PAUSEMARK){ conn.close(); //last page output - + } + if (Strm.lastType() == DTSC::INVALID){ + #if DEBUG >= 3 + fprintf(stderr, "Invalid packet received - closing connection.\n"); + #endif + conn.close(); } } }else{