Compare commits

..

2 Commits

Author SHA1 Message Date
9049baf730 report protocol name with original case 2011-07-28 12:39:11 +00:00
050a165a82 bugfix: had stale fieldAddress under some circumstances 2011-07-28 12:08:39 +00:00
2 changed files with 9 additions and 5 deletions

View File

@ -650,9 +650,12 @@ formatOutput()
unsigned short addrlen = extract<unsigned short>(commandIndex);
fieldAddress.set(commandIndex, addrlen);
commandIndex += addrlen;
goto normal_format;
}
case StreamProtocolParser::format:
{
fieldAddress.clear();
normal_format:
// code layout:
// formatstring <eos> StreamFormat [info]
formatstring = commandIndex;
@ -696,7 +699,6 @@ formatOutput()
name(), formatstr.expand()());
return false;
}
fieldAddress.clear();
continue;
}
case StreamProtocolParser::whitespace:
@ -1169,9 +1171,12 @@ matchInput()
unsigned short addrlen = extract<unsigned short>(commandIndex);
fieldAddress.set(commandIndex, addrlen);
commandIndex += addrlen;
goto normal_format;
}
case StreamProtocolParser::format:
{
fieldAddress.clear();
normal_format:
int consumed;
// code layout:
// formatstring <eos> StreamFormat [info]
@ -1310,7 +1315,6 @@ matchInput()
return false;
}
// matchValue() has already removed consumed bytes from inputBuffer
fieldAddress.clear();
break;
}
case StreamProtocolParser::skip:
@ -1332,12 +1336,12 @@ matchInput()
while (commandIndex[i] >= ' ') i++;
if (!(flags & AsyncMode) && onMismatch[0] != in_cmd)
{
error("%s: Input \"%s%s\" too short.",
error("%s: Input \"%s%s\" too short.\n",
name(),
inputLine.length() > 20 ? "..." : "",
inputLine.expand(-20)());
#ifndef NO_TEMPORARY
error(" No match for \"%s\"\n",
error("No match for \"%s\"\n",
StreamBuffer(commandIndex-1,i+1).expand()());
#endif
}

View File

@ -227,7 +227,7 @@ getProtocol(const StreamBuffer& protocolAndParams)
return new Protocol(*protocol, name, 0);
}
error("Protocol '%s' not found in protocol file '%s'\n",
name(), filename());
protocolAndParams(), filename());
return NULL;
}