Use per-message send buffer, rather than per connection
This commit is contained in:
committed by
Pieter Wuille
parent
967f24590b
commit
41b052ad87
@@ -789,6 +789,7 @@ struct ser_streamplaceholder
|
||||
|
||||
|
||||
|
||||
typedef std::vector<char, zero_after_free_allocator<char> > CSerializeData;
|
||||
|
||||
/** Double ended buffer combining vector and stream-like interfaces.
|
||||
*
|
||||
@@ -798,7 +799,7 @@ struct ser_streamplaceholder
|
||||
class CDataStream
|
||||
{
|
||||
protected:
|
||||
typedef std::vector<char, zero_after_free_allocator<char> > vector_type;
|
||||
typedef CSerializeData vector_type;
|
||||
vector_type vch;
|
||||
unsigned int nReadPos;
|
||||
short state;
|
||||
@@ -1095,6 +1096,11 @@ public:
|
||||
::Unserialize(*this, obj, nType, nVersion);
|
||||
return (*this);
|
||||
}
|
||||
|
||||
void GetAndClear(CSerializeData &data) {
|
||||
vch.swap(data);
|
||||
CSerializeData().swap(vch);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user