Fixed a FLV header bug causing both video and audio to always be mentioned even when not present, added header-only parsing support to HTTP library.

This commit is contained in:
Thulinma 2013-06-03 15:50:21 +02:00
parent 62c4689ae2
commit 9228198097
3 changed files with 7 additions and 2 deletions

View file

@ -6,6 +6,7 @@
/// This constructor creates an empty HTTP::Parser, ready for use for either reading or writing.
/// All this constructor does is call HTTP::Parser::Clean().
HTTP::Parser::Parser(){
headerOnly = false;
Clean();
}
@ -217,6 +218,9 @@ bool HTTP::Parser::parse(std::string & HTTPbuffer){
}
if (seenHeaders){
if (length > 0){
if (headerOnly){
return true;
}
unsigned int toappend = length - body.length();
if (toappend > 0){
body.append(HTTPbuffer, 0, toappend);