From 24a3bcd8db7fdddc54c18cf3d18a22500c83a1aa Mon Sep 17 00:00:00 2001 From: Thulinma Date: Sun, 9 Sep 2012 00:53:38 +0200 Subject: [PATCH] Added todo in HTTP::Parser, changed version to 2.0.0 --- lib/Makefile.am | 2 +- lib/http_parser.cpp | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/Makefile.am b/lib/Makefile.am index a5dcbcf4..fdc39b7b 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -3,7 +3,7 @@ AM_CPPFLAGS = $(global_CFLAGS) lib_LTLIBRARIES=libmist-1.0.la libmist_1_0_la_SOURCES=amf.h amf.cpp auth.h auth.cpp base64.h base64.cpp config.h config.cpp crypto.h crypto.cpp dtsc.h dtsc.cpp flv_tag.h flv_tag.cpp http_parser.h http_parser.cpp json.h json.cpp procs.h procs.cpp rtmpchunks.h rtmpchunks.cpp socket.h socket.cpp mp4.h mp4.cpp ftp.h ftp.cpp filesystem.h filesystem.cpp stream.h stream.cpp libmist_1_0_la_LIBADD=-lssl -lcrypto -libmist_1_0_la_LDFLAGS = -version-info 1:0:0 +libmist_1_0_la_LDFLAGS = -version-info 2:0:0 pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = mist-1.0.pc diff --git a/lib/http_parser.cpp b/lib/http_parser.cpp index 526ff014..f8489fdb 100644 --- a/lib/http_parser.cpp +++ b/lib/http_parser.cpp @@ -141,7 +141,8 @@ bool HTTP::Parser::Read(std::string & strbuf){ bool HTTP::Parser::parse(std::string & HTTPbuffer){ size_t f; std::string tmpA, tmpB, tmpC; - while (HTTPbuffer != ""){ + /// \todo Make this not resize HTTPbuffer in parts, but read all at once and then remove the entire request, like doxygen claims it does. + while (!HTTPbuffer.empty()){ if (!seenHeaders){ f = HTTPbuffer.find('\n'); if (f == std::string::npos) return false; @@ -190,7 +191,7 @@ bool HTTP::Parser::parse(std::string & HTTPbuffer){ } } } - return false; //we should never get here... + return false; //empty input }//HTTPReader::parse #include