Loading src/http.cpp +1 −15 Changes for src/http.cpp: 1 added line, 15 removed lines. Original line number Diff line number Diff line Loading @@ -1181,7 +1181,6 @@ size_t libhttppp::HttpRequest::parse(){ for(size_t cpos=pos; cpos<header.size(); ++cpos){ if(header[cpos]=='\n' && (cpos-pos)<255){ std::copy(header.begin()+pos,header.begin()+cpos,std::inserter<std::string>(_RequestVersion,_RequestVersion.begin())); _RequestVersion.push_back('\0'); ++pos; found=true; break; Loading Loading @@ -1210,7 +1209,6 @@ size_t libhttppp::HttpRequest::parse(){ for (size_t it = 0; it < keylen; ++it) { key[it] = (char)tolower(key[it]); } key.push_back('\0'); if(pos >= 0 && pos <= header.size()){ size_t vstart=delimeter; while(header[++vstart]==' '){ Loading @@ -1221,7 +1219,6 @@ size_t libhttppp::HttpRequest::parse(){ for (size_t it = 0; it < value.length(); ++it) { value[it] = (char)tolower(value[it]); } value.push_back('\0'); HeaderData *ncontent=setHeaderData(key.c_str()); Loading Loading @@ -1414,7 +1411,6 @@ void libhttppp::HttpForm::parse(libhttppp::HttpRequest &request){ _Boundary.clear(); _Boundary.resize(cbod->getvalue().length()-fcbod); _Boundary.insert(_Boundary.begin(),std::next(cbod->getvalue().begin(),fcbod),cbod->getvalue().end()); _Boundary.push_back('\0'); break; } } Loading Loading @@ -1575,7 +1571,7 @@ void libhttppp::HttpForm::_parseMulitpart(const netplus::condata<char> &data){ //check if boundary if((char)tolower(req[cr])==realboundary[realboundarypos++]){ //check if boundary completed if(realboundary[realboundarypos]=='\0'){ if(realboundarypos==req.size()){ //ceck if boundary before found set data end if(oldpos!=std::string::npos) _parseMultiSection(req,oldpos,cr-realboundarypos); Loading Loading @@ -1633,9 +1629,6 @@ void libhttppp::HttpForm::_parseMultiSection(netplus::condata<char> &data,size_t std::copy(data.begin()+ctl,data.begin()+ctlt, std::inserter<std::vector<char>>(content._Key,content._Key.begin())); content._Key.push_back('\0'); for(size_t tl=0; tl<content._Key.size(); ++tl){ content._Key[tl]=tolower(content._Key[tl]); } Loading @@ -1645,8 +1638,6 @@ void libhttppp::HttpForm::_parseMultiSection(netplus::condata<char> &data,size_t std::copy(data.begin()+ctlt,data.begin()+findel, std::inserter<std::vector<char>>(content._Value,content._Value.begin())); content._Value.push_back('\0'); MultipartFormData._lastData->addContent(content); ctl=std::string::npos; Loading Loading @@ -1725,14 +1716,11 @@ void libhttppp::HttpForm::_parseMultiSection(netplus::condata<char> &data,size_t std::copy(cdispo->_Value.begin()+scss,cdispo->_Value.begin()+scse, std::inserter<std::vector<char>>(dispo._Key,dispo._Key.begin())); dispo._Key.push_back('\0'); if( scvss<scvse && scvss < cdispo->_Value.size() && scvse <= cdispo->_Value.size() ){ std::copy(cdispo->_Value.begin()+scvss,cdispo->_Value.begin()+scvse, std::inserter<std::vector<char>>(dispo._Value,dispo._Value.begin())); dispo._Value.push_back('\0'); scvss=std::string::npos; scvse=std::string::npos; scvts=std::string::npos; Loading Loading @@ -1908,11 +1896,9 @@ void libhttppp::HttpForm::_parseUrlDecode(const netplus::condata<char> &data,siz size_t vlstpos=keyendpos+1; std::string ukey,uvalue; std::copy(data.begin()+fdatstpos,data.begin()+keyendpos,std::back_inserter(ukey)); ukey.push_back('\0'); urlDecode(ukey,key); if(vlstpos<=data.size()){ std::copy(data.begin()+vlstpos,data.begin()+fdatpos,std::back_inserter(uvalue)); uvalue.push_back('\0'); urlDecode(uvalue,value); } UrlcodedForm::Data urldat(key.c_str(),value.c_str()); Loading Loading
src/http.cpp +1 −15 Changes for src/http.cpp: 1 added line, 15 removed lines. Original line number Diff line number Diff line Loading @@ -1181,7 +1181,6 @@ size_t libhttppp::HttpRequest::parse(){ for(size_t cpos=pos; cpos<header.size(); ++cpos){ if(header[cpos]=='\n' && (cpos-pos)<255){ std::copy(header.begin()+pos,header.begin()+cpos,std::inserter<std::string>(_RequestVersion,_RequestVersion.begin())); _RequestVersion.push_back('\0'); ++pos; found=true; break; Loading Loading @@ -1210,7 +1209,6 @@ size_t libhttppp::HttpRequest::parse(){ for (size_t it = 0; it < keylen; ++it) { key[it] = (char)tolower(key[it]); } key.push_back('\0'); if(pos >= 0 && pos <= header.size()){ size_t vstart=delimeter; while(header[++vstart]==' '){ Loading @@ -1221,7 +1219,6 @@ size_t libhttppp::HttpRequest::parse(){ for (size_t it = 0; it < value.length(); ++it) { value[it] = (char)tolower(value[it]); } value.push_back('\0'); HeaderData *ncontent=setHeaderData(key.c_str()); Loading Loading @@ -1414,7 +1411,6 @@ void libhttppp::HttpForm::parse(libhttppp::HttpRequest &request){ _Boundary.clear(); _Boundary.resize(cbod->getvalue().length()-fcbod); _Boundary.insert(_Boundary.begin(),std::next(cbod->getvalue().begin(),fcbod),cbod->getvalue().end()); _Boundary.push_back('\0'); break; } } Loading Loading @@ -1575,7 +1571,7 @@ void libhttppp::HttpForm::_parseMulitpart(const netplus::condata<char> &data){ //check if boundary if((char)tolower(req[cr])==realboundary[realboundarypos++]){ //check if boundary completed if(realboundary[realboundarypos]=='\0'){ if(realboundarypos==req.size()){ //ceck if boundary before found set data end if(oldpos!=std::string::npos) _parseMultiSection(req,oldpos,cr-realboundarypos); Loading Loading @@ -1633,9 +1629,6 @@ void libhttppp::HttpForm::_parseMultiSection(netplus::condata<char> &data,size_t std::copy(data.begin()+ctl,data.begin()+ctlt, std::inserter<std::vector<char>>(content._Key,content._Key.begin())); content._Key.push_back('\0'); for(size_t tl=0; tl<content._Key.size(); ++tl){ content._Key[tl]=tolower(content._Key[tl]); } Loading @@ -1645,8 +1638,6 @@ void libhttppp::HttpForm::_parseMultiSection(netplus::condata<char> &data,size_t std::copy(data.begin()+ctlt,data.begin()+findel, std::inserter<std::vector<char>>(content._Value,content._Value.begin())); content._Value.push_back('\0'); MultipartFormData._lastData->addContent(content); ctl=std::string::npos; Loading Loading @@ -1725,14 +1716,11 @@ void libhttppp::HttpForm::_parseMultiSection(netplus::condata<char> &data,size_t std::copy(cdispo->_Value.begin()+scss,cdispo->_Value.begin()+scse, std::inserter<std::vector<char>>(dispo._Key,dispo._Key.begin())); dispo._Key.push_back('\0'); if( scvss<scvse && scvss < cdispo->_Value.size() && scvse <= cdispo->_Value.size() ){ std::copy(cdispo->_Value.begin()+scvss,cdispo->_Value.begin()+scvse, std::inserter<std::vector<char>>(dispo._Value,dispo._Value.begin())); dispo._Value.push_back('\0'); scvss=std::string::npos; scvse=std::string::npos; scvts=std::string::npos; Loading Loading @@ -1908,11 +1896,9 @@ void libhttppp::HttpForm::_parseUrlDecode(const netplus::condata<char> &data,siz size_t vlstpos=keyendpos+1; std::string ukey,uvalue; std::copy(data.begin()+fdatstpos,data.begin()+keyendpos,std::back_inserter(ukey)); ukey.push_back('\0'); urlDecode(ukey,key); if(vlstpos<=data.size()){ std::copy(data.begin()+vlstpos,data.begin()+fdatpos,std::back_inserter(uvalue)); uvalue.push_back('\0'); urlDecode(uvalue,value); } UrlcodedForm::Data urldat(key.c_str(),value.c_str()); Loading