[Quickfix-developers] crashing on invalid messages (was: invalid message)
Brought to you by:
orenmnero
From: H. S. <st...@st...> - 2004-02-18 11:44:12
|
hello, regarding my post to the list from 04/01/26 i've just added a catch block which saves the application from crashing on invalid messages to SocketConnection::read( SocketConnector& s ). using this patch, the application passed tests on invalid headers, invalid checksums, missing checksums and invalid bodylength which all caused the application to crash before. hope oren will correct me, if that patch is not fine that way. regards, heri --- quickfix/src/C++/SocketConnection.cpp 2003-08-04 08:14:03.000000000 +0200 +++ SocketConnection.cpp 2004-02-18 11:46:38.000000000 +0100 @@ -97,7 +97,10 @@ std::string msg; if ( !readMessage( msg ) ) return false; - m_pSession->next( msg ); + try { + m_pSession->next( msg ); + } + catch ( InvalidMessage& ) {} return true; QF_STACK_POP |