File tree Expand file tree Collapse file tree 4 files changed +19
-1
lines changed Expand file tree Collapse file tree 4 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -69,7 +69,14 @@ TCPPacket::~TCPPacket(void)
69
69
// -------------------------------------------------------------------------------------
70
70
size_t TCPPacket::maxBufferSize ()
71
71
{
72
- return PACKET_MAX_SIZE_TCP * 4 ;
72
+ return PACKET_MAX_SIZE_TCP;
73
+ }
74
+
75
+ // -------------------------------------------------------------------------------------
76
+ void TCPPacket::onReclaimObject ()
77
+ {
78
+ Packet::onReclaimObject ();
79
+ data_resize (maxBufferSize ());
73
80
}
74
81
75
82
// -------------------------------------------------------------------------------------
Original file line number Diff line number Diff line change @@ -50,6 +50,8 @@ class TCPPacket : public Packet
50
50
virtual ~TCPPacket (void );
51
51
52
52
int recvFromEndPoint (EndPoint & ep, Address* pAddr = NULL );
53
+
54
+ virtual void onReclaimObject ();
53
55
};
54
56
55
57
typedef SmartPointer<TCPPacket> TCPPacketPtr;
Original file line number Diff line number Diff line change @@ -72,6 +72,13 @@ size_t UDPPacket::maxBufferSize()
72
72
return PACKET_MAX_SIZE_UDP;
73
73
}
74
74
75
+ // -------------------------------------------------------------------------------------
76
+ void UDPPacket::onReclaimObject ()
77
+ {
78
+ Packet::onReclaimObject ();
79
+ data_resize (maxBufferSize ());
80
+ }
81
+
75
82
// -------------------------------------------------------------------------------------
76
83
int UDPPacket::recvFromEndPoint (EndPoint & ep, Address* pAddr)
77
84
{
Original file line number Diff line number Diff line change @@ -49,6 +49,8 @@ class UDPPacket : public Packet
49
49
virtual ~UDPPacket (void );
50
50
51
51
int recvFromEndPoint (EndPoint & ep, Address* pAddr = NULL );
52
+
53
+ virtual void onReclaimObject ();
52
54
};
53
55
54
56
typedef SmartPointer<UDPPacket> UDPPacketPtr;
You can’t perform that action at this time.
0 commit comments