More development on the messaging.
This commit is contained in:
parent
f4496fc682
commit
591705f897
@ -13,7 +13,7 @@ namespace coreutils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void IMFMessage::parse(PString &in) {
|
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)
|
if(in.size() == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -13,12 +13,8 @@ namespace coreutils {
|
|||||||
uri = in.getTokenExclude(" ");
|
uri = in.getTokenExclude(" ");
|
||||||
if(!in.ifNext(" "))
|
if(!in.ifNext(" "))
|
||||||
throw coreutils::Exception("Expecting space after URI.");
|
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() {
|
std::string IMFRequest::getMethod() {
|
||||||
|
@ -31,7 +31,7 @@ namespace coreutils {
|
|||||||
|
|
||||||
while(pos < pstring.length()) {
|
while(pos < pstring.length()) {
|
||||||
end = pstring.find(delimiter, pos);
|
end = pstring.find(delimiter, pos);
|
||||||
if(end == std::string::npos)
|
if(end == -1)
|
||||||
end = pstring.length();
|
end = pstring.length();
|
||||||
list.push_back(PString(pstring.substr(pos, end - pos)));
|
list.push_back(PString(pstring.substr(pos, end - pos)));
|
||||||
pos = end + delimiter.size();
|
pos = end + delimiter.size();
|
||||||
@ -78,7 +78,8 @@ namespace coreutils {
|
|||||||
|
|
||||||
int PString::skipWhitespace() {
|
int PString::skipWhitespace() {
|
||||||
size_t found = pstring.find_first_not_of(" \t", cursor);
|
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() {
|
int PString::size() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user