[Quickfix-developers] Expected/Received Length seems wrong in error message
Brought to you by:
orenmnero
|
From: Rich H. <rh...@ql...> - 2005-07-02 04:53:58
|
Does this code look right? I am receiving invalid messages from a FIX
engine (unrelated issue).
However, when looking at the code, it seems that this error message is
backwards. Should
aBodyLength (actual?) be the expected length and bodyLength() be the
received length?
It looks like the checksum is incorrect too...
Cheers,
Rich
void Message::validate()
{ QF_STACK_PUSH(Message::validate)
try
{
BodyLength aBodyLength;
m_header.getField( aBodyLength );
if ( aBodyLength != bodyLength() )
{
std::stringstream text;
text << "Expected BodyLength=" << bodyLength()
<< ", Recieved BodyLength=" << (int)aBodyLength;
throw InvalidMessage(text.str());
}
CheckSum aCheckSum;
m_trailer.getField( aCheckSum );
if ( aCheckSum != checkSum() )
{
std::stringstream text;
text << "Expected CheckSum=" << checkSum()
<< ", Recieved CheckSum=" << (int)aCheckSum;
throw InvalidMessage(text.str());
}
}
catch ( FieldNotFound& )
{
throw InvalidMessage("BodyLength or CheckSum missing");
}
QF_STACK_POP
}
|