Re: [Quickfix-users] Possible Checksum bug originating in FieldBase::setString()
Brought to you by:
orenmnero
From: Oren M. <ore...@ya...> - 2003-07-07 15:38:47
|
Yeah, also setField needs to recalculate the values which wasn't being done. I checked in a path + unit test for this. http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/quickfix/quickfix/src/C++/Field.h.diff?r1=1.6&r2=1.7 http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/quickfix/quickfix/src/C++/test/Makefile.am.diff?r1=1.3&r2=1.4 http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/quickfix/quickfix/src/C++/test/TestSuite.h.diff?r1=1.1&r2=1.2&sortby=date http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/quickfix/quickfix/src/C++/test/FieldBaseTestCase.h http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/quickfix/quickfix/src/C++/test/FieldBaseTestCase.cpp --- "Brendan B. Boerner" <br...@ka...> wrote: > Hello, > > In Field.h::void FieldBase::setString( const > std::string& string ), > shouldn't m_total be inited to 0 before accumulating > it? e.g. > > void > { > m_string = string; > m_data = IntConvertor::convert(m_field) + "=" + > string + "\001"; > m_length = m_data.length(); > const char* iter = m_data.c_str(); > const char* end = iter + m_data.length(); > > // tbd1234: brendan - bug? > m_total = 0; > while( iter != end ) > m_total += *iter++; > } > > > W/o this, something like: > > FIX::ExecType execType; > FIX::OrdStatus ordStatus; > execType.setValue(FIX::ExecType_NEW); > ordStatus.setValue(FIX::OrdStatus_NEW); > > ...send ExecReport... > > would cause a checksum mismatch between executor and > a client due to > these two fields. > > In addition to not getting the checksum errors, this > also appears to > have fixed another problem I saw where executor > would repeatedly ask > my client (and possible the client would ask the > executor - depending > on the state at that moment) for resends. While > debugging the > checksum problem I found cases where the client, in > attempting to > honor the resend would throw an InvalidMessage due > to a message gap > in the FileStore e.g. the FileStore would have > messages 5, 6, 7, 9, > 10 as a "" string was being pushed onto the queue of > messages to > resend. > > Since applying the m_total = 0 fix, I've been able > to down executor, > bring it up and have it resync w/the client with > none of the problems > I've previously seen. > > Regards, > Brendan > > > > ------------------------------------------------------- > This SF.Net email sponsored by: Free pre-built > ASP.NET sites including > Data Reports, E-commerce, Portals, and Forums are > available now. > Download today and enter to win an XBOX or Visual > Studio .NET. > http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01 > _______________________________________________ > Quickfix-users mailing list > Qui...@li... > https://lists.sourceforge.net/lists/listinfo/quickfix-users __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com |