mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-02-08 22:13:48 +01:00
cleanup properties before update
This commit is contained in:
parent
a2de5564ac
commit
58cf26c304
2 changed files with 3 additions and 1 deletions
|
@ -97,6 +97,7 @@ namespace data
|
||||||
m_ReachableTransports = 0;
|
m_ReachableTransports = 0;
|
||||||
m_Caps = 0;
|
m_Caps = 0;
|
||||||
// don't clean up m_Addresses, it will be replaced in ReadFromStream
|
// don't clean up m_Addresses, it will be replaced in ReadFromStream
|
||||||
|
ClearProperties ();
|
||||||
// copy buffer
|
// copy buffer
|
||||||
UpdateBuffer (buf, len);
|
UpdateBuffer (buf, len);
|
||||||
// skip identity
|
// skip identity
|
||||||
|
|
|
@ -182,6 +182,7 @@ namespace data
|
||||||
uint64_t GetTimestamp () const { return m_Timestamp; };
|
uint64_t GetTimestamp () const { return m_Timestamp; };
|
||||||
int GetVersion () const { return m_Version; };
|
int GetVersion () const { return m_Version; };
|
||||||
virtual void SetProperty (const std::string& key, const std::string& value) {};
|
virtual void SetProperty (const std::string& key, const std::string& value) {};
|
||||||
|
virtual void ClearProperties () {};
|
||||||
Addresses& GetAddresses () { return *m_Addresses; }; // should be called for local RI only, otherwise must return shared_ptr
|
Addresses& GetAddresses () { return *m_Addresses; }; // should be called for local RI only, otherwise must return shared_ptr
|
||||||
std::shared_ptr<const Address> GetNTCP2AddressWithStaticKey (const uint8_t * key) const;
|
std::shared_ptr<const Address> GetNTCP2AddressWithStaticKey (const uint8_t * key) const;
|
||||||
std::shared_ptr<const Address> GetPublishedNTCP2V4Address () const;
|
std::shared_ptr<const Address> GetPublishedNTCP2V4Address () const;
|
||||||
|
@ -302,7 +303,7 @@ namespace data
|
||||||
void SetProperty (const std::string& key, const std::string& value) override;
|
void SetProperty (const std::string& key, const std::string& value) override;
|
||||||
void DeleteProperty (const std::string& key);
|
void DeleteProperty (const std::string& key);
|
||||||
std::string GetProperty (const std::string& key) const;
|
std::string GetProperty (const std::string& key) const;
|
||||||
void ClearProperties () { m_Properties.clear (); };
|
void ClearProperties () override { m_Properties.clear (); };
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue