From 619dec51f630116843a7d83c0c085abc7e3da688 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Mon, 25 Feb 2008 19:00:43 +0000 Subject: fixed resize issue with buffer->xPacket --- plainPacket.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'plainPacket.cpp') diff --git a/plainPacket.cpp b/plainPacket.cpp index d6f2e5f..37c4338 100644 --- a/plainPacket.cpp +++ b/plainPacket.cpp @@ -65,8 +65,13 @@ u_int32_t PlainPacket::getPayloadLength() const void PlainPacket::setPayloadLength(u_int32_t payload_length) { Buffer::setLength(payload_length + sizeof(payload_type_t)); + // depending on allow_realloc buf_ may point to another address + // therefore in this case reinit() gets called by Buffer::setLength() +} - // depending on allow_realloc buf_ may point to another address +void PlainPacket::reinit() +{ + Buffer::reinit(); payload_type_ = reinterpret_cast(buf_); payload_ = buf_ + sizeof(payload_type_t); } -- cgit v1.2.3