summaryrefslogtreecommitdiff
path: root/plainPacket.cpp
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anytun.org>2008-02-25 19:00:43 +0000
committerChristian Pointner <equinox@anytun.org>2008-02-25 19:00:43 +0000
commit619dec51f630116843a7d83c0c085abc7e3da688 (patch)
tree89536dff865336963d12ae7a3a5292509616c126 /plainPacket.cpp
parentbugfix with packet length (diff)
fixed resize issue with buffer->xPacket
Diffstat (limited to 'plainPacket.cpp')
-rw-r--r--plainPacket.cpp7
1 files changed, 6 insertions, 1 deletions
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<payload_type_t*>(buf_);
payload_ = buf_ + sizeof(payload_type_t);
}