Loading src/http.cpp +6 −5 Original line number Diff line number Diff line Loading @@ -41,6 +41,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include <netplus/connection.h> #include <netplus/exception.h> #include <assert.h> libhttppp::HttpHeader::HttpHeader(){ _firstHeaderData=nullptr; Loading Loading @@ -99,6 +100,7 @@ const char* libhttppp::HttpHeader::getData(HttpHeader::HeaderData *pos){ if(!pos){ HTTPException httpexception; httpexception[HTTPException::Note] << "getData no valid pointer set !"; assert(0); throw httpexception; } return pos->_Value.c_str(); Loading Loading @@ -436,7 +438,6 @@ libhttppp::HttpRequest::HttpRequest() : HttpHeader(){ _MaxUploadSize=DEFAULT_UPLOADSIZE; _firstHeaderData=nullptr; _lastHeaderData=nullptr; _ContentLength=nullptr; }; libhttppp::HttpRequest::HttpRequest(netplus::eventapi *evapi) : netplus::con(evapi) { Loading @@ -444,7 +445,6 @@ libhttppp::HttpRequest::HttpRequest(netplus::eventapi *evapi) : netplus::con(eva _MaxUploadSize=DEFAULT_UPLOADSIZE; _firstHeaderData=nullptr; _lastHeaderData=nullptr; _ContentLength=nullptr; } void libhttppp::HttpRequest::clear(){ Loading Loading @@ -581,8 +581,6 @@ size_t libhttppp::HttpRequest::parse(){ std::move(RecvData.begin()+endpos,RecvData.end(),RecvData.begin()); RecvData.resize(RecvData.size()-endpos); _ContentLength=getData("content-length"); }catch(netplus::NetException &e){ if (e.getErrorType() != netplus::NetException::Note) { RecvData.clear(); Loading Loading @@ -635,7 +633,10 @@ const char * libhttppp::HttpRequest::getRequestVersion(){ } size_t libhttppp::HttpRequest::getContentLength(){ return getDataSizet(_ContentLength); HttpHeader::HeaderData *clen=getData("content-length"); if(!clen) return 0; return getDataSizet(clen); } size_t libhttppp::HttpRequest::getMaxUploadSize(){ Loading src/http.h +0 −1 Original line number Diff line number Diff line Loading @@ -165,7 +165,6 @@ namespace libhttppp { std::string _RequestURL; std::string _RequestVersion; size_t _MaxUploadSize; HeaderData *_ContentLength; friend class HttpForm; }; Loading src/httpd.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -78,6 +78,8 @@ void libhttppp::HttpEvent::RequestEvent(netplus::con* curcon){ break; case POSTREQUEST: if( cureq->RecvData.size() > cureq->getMaxUploadSize()){ cureq->clear(); cureq->RecvData.clear(); HTTPException excep; excep[HTTPException::Note] << "Upload too big increase Max Upload Size"; throw excep; Loading Loading
src/http.cpp +6 −5 Original line number Diff line number Diff line Loading @@ -41,6 +41,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include <netplus/connection.h> #include <netplus/exception.h> #include <assert.h> libhttppp::HttpHeader::HttpHeader(){ _firstHeaderData=nullptr; Loading Loading @@ -99,6 +100,7 @@ const char* libhttppp::HttpHeader::getData(HttpHeader::HeaderData *pos){ if(!pos){ HTTPException httpexception; httpexception[HTTPException::Note] << "getData no valid pointer set !"; assert(0); throw httpexception; } return pos->_Value.c_str(); Loading Loading @@ -436,7 +438,6 @@ libhttppp::HttpRequest::HttpRequest() : HttpHeader(){ _MaxUploadSize=DEFAULT_UPLOADSIZE; _firstHeaderData=nullptr; _lastHeaderData=nullptr; _ContentLength=nullptr; }; libhttppp::HttpRequest::HttpRequest(netplus::eventapi *evapi) : netplus::con(evapi) { Loading @@ -444,7 +445,6 @@ libhttppp::HttpRequest::HttpRequest(netplus::eventapi *evapi) : netplus::con(eva _MaxUploadSize=DEFAULT_UPLOADSIZE; _firstHeaderData=nullptr; _lastHeaderData=nullptr; _ContentLength=nullptr; } void libhttppp::HttpRequest::clear(){ Loading Loading @@ -581,8 +581,6 @@ size_t libhttppp::HttpRequest::parse(){ std::move(RecvData.begin()+endpos,RecvData.end(),RecvData.begin()); RecvData.resize(RecvData.size()-endpos); _ContentLength=getData("content-length"); }catch(netplus::NetException &e){ if (e.getErrorType() != netplus::NetException::Note) { RecvData.clear(); Loading Loading @@ -635,7 +633,10 @@ const char * libhttppp::HttpRequest::getRequestVersion(){ } size_t libhttppp::HttpRequest::getContentLength(){ return getDataSizet(_ContentLength); HttpHeader::HeaderData *clen=getData("content-length"); if(!clen) return 0; return getDataSizet(clen); } size_t libhttppp::HttpRequest::getMaxUploadSize(){ Loading
src/http.h +0 −1 Original line number Diff line number Diff line Loading @@ -165,7 +165,6 @@ namespace libhttppp { std::string _RequestURL; std::string _RequestVersion; size_t _MaxUploadSize; HeaderData *_ContentLength; friend class HttpForm; }; Loading
src/httpd.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -78,6 +78,8 @@ void libhttppp::HttpEvent::RequestEvent(netplus::con* curcon){ break; case POSTREQUEST: if( cureq->RecvData.size() > cureq->getMaxUploadSize()){ cureq->clear(); cureq->RecvData.clear(); HTTPException excep; excep[HTTPException::Note] << "Upload too big increase Max Upload Size"; throw excep; Loading