Re: [Quickfix-developers] crashing on invalid messages (was: invalid message)
Brought to you by:
orenmnero
From: Miller, O. <OM...@ri...> - 2004-02-18 11:52:29
|
That's why we have the automated tests. I could never validate code = with the same watchful eye that they do :) I also think a test for the new functionality would be warranted. -------------------------- Sent from my BlackBerry Wireless Handheld -----Original Message----- From: H. Steuer <st...@st...> To: qui...@li... = <qui...@li...> Sent: Wed Feb 18 05:39:25 2004 Subject: [Quickfix-developers] crashing on invalid messages (was: = invalid message) 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 ).=20 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; =20 - m_pSession->next( msg ); + try { + m_pSession->next( msg ); + } + catch ( InvalidMessage& ) {} return true; =20 QF_STACK_POP ------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id=3D1356&alloc_id=3D3438&op=3Dclick _______________________________________________ Quickfix-developers mailing list Qui...@li... https://lists.sourceforge.net/lists/listinfo/quickfix-developers |