Bugzilla – Bug 53
Bug in Packet::AddTrailer
Last modified: 2007-07-17 09:55:34 EDT
I think there's a bug here, from what I could learn from the Buffer unit tests. This patch should fix it: diff -r e12a99f2e698 src/common/packet.h --- a/src/common/packet.h Tue Jul 17 14:34:27 2007 +0100 +++ b/src/common/packet.h Tue Jul 17 14:43:13 2007 +0100 @@ -343,6 +343,7 @@ Packet::AddTrailer (T const &trailer) uint32_t size = trailer.GetSize (); m_buffer.AddAtEnd (size); Buffer::Iterator end = m_buffer.End (); + end.Prev (size); trailer.Serialize (end); m_metadata.AddTrailer (trailer, size); }
This is not a bug: if you read the documentation for Trailer::SerializeTo and Trailer::DeserializeFrom, this behavior is clearly explained.