[brlcad-commits] SF.net SVN: brlcad:[44526] geomcore/trunk/src/libNet/NetMsgFactory.cxx
Open Source Solid Modeling CAD
Brought to you by:
brlcad
From: <dav...@us...> - 2011-04-27 17:00:03
|
Revision: 44526 http://brlcad.svn.sourceforge.net/brlcad/?rev=44526&view=rev Author: davidloman Date: 2011-04-27 16:59:57 +0000 (Wed, 27 Apr 2011) Log Message: ----------- Two bug fixes. NetMsg parse was failing due to a >= being used instead of a <. Also make peeking at the MsgType remember start position instead of assuming a rewind to position:0 Modified Paths: -------------- geomcore/trunk/src/libNet/NetMsgFactory.cxx Modified: geomcore/trunk/src/libNet/NetMsgFactory.cxx =================================================================== --- geomcore/trunk/src/libNet/NetMsgFactory.cxx 2011-04-27 16:46:06 UTC (rev 44525) +++ geomcore/trunk/src/libNet/NetMsgFactory.cxx 2011-04-27 16:59:57 UTC (rev 44526) @@ -69,13 +69,14 @@ } /* Check if at least header data is here. */ - if(bb->limit() >= 39) { + if(bb->limit() < 43) { return NULL; } /* Peek at type */ + int start = bb->position(); uint16_t msgType = bb->get16bit(); - bb->setPosition(0); + bb->setPosition(start); /* TODO Replace this with a map for registration scheme */ switch (msgType) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |