More development on the messaging.

This commit is contained in:
Brad Arant 2020-05-07 10:20:22 -07:00
parent f4496fc682
commit 591705f897
5 changed files with 12 additions and 15 deletions

View File

@ -13,7 +13,7 @@ namespace coreutils {
}
void IMFMessage::parse(PString &in) {
coreutils::Log(coreutils::LOG_DEBUG_4) << "[" << in.str() << "]";
coreutils::Log(coreutils::LOG_DEBUG_4) << "parse [" << in.str() << "]";
if(in.size() == 0)
return;

View File

@ -24,7 +24,7 @@ namespace coreutils {
std::string getHeader(std::string key, bool valueOnly = true);
std::string getHeaderKeyPairValue(std::string headerKey, std::string key);
IMFBody *getBody();
IMFBody *getBody();
protected:
std::vector<IMFHeader> headers;

View File

@ -13,12 +13,8 @@ namespace coreutils {
uri = in.getTokenExclude(" ");
if(!in.ifNext(" "))
throw coreutils::Exception("Expecting space after URI.");
protocol = in.getTokenExclude("\r");
protocol = in.str();
coreutils::Log(coreutils::LOG_DEBUG_4) << "[" << in.str() << "]";
if(!in.ifNext("\r"))
throw coreutils::Exception("Expecting CRLF after protocol.");
}
std::string IMFRequest::getMethod() {

View File

@ -31,7 +31,7 @@ namespace coreutils {
while(pos < pstring.length()) {
end = pstring.find(delimiter, pos);
if(end == std::string::npos)
if(end == -1)
end = pstring.length();
list.push_back(PString(pstring.substr(pos, end - pos)));
pos = end + delimiter.size();
@ -78,7 +78,8 @@ namespace coreutils {
int PString::skipWhitespace() {
size_t found = pstring.find_first_not_of(" \t", cursor);
return found != cursor::npos ? cursor + found: 0;
coreutils::Log(coreutils::LOG_DEBUG_2) << "Skipping whitespace for " << found << " spaces.";
return found;
}
int PString::size() {

View File

@ -82,7 +82,7 @@ namespace coreutils {
///
///
void skipWhitespace();
int skipWhitespace();
///
///