diff options
| author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-10-07 10:30:47 -0700 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-10-07 10:30:47 -0700 |
| commit | ab0228f626573381db93173cd5849cb934481ca5 (patch) | |
| tree | 1550ca232a7ec877dabdd5b525bfac4ea05d619f /node/InetAddress.hpp | |
| parent | 6c7ce79c8960cd2360657f9247788ff5640ae974 (diff) | |
| download | infinitytier-ab0228f626573381db93173cd5849cb934481ca5.tar.gz infinitytier-ab0228f626573381db93173cd5849cb934481ca5.zip | |
More cleanup and simple refactoring, consolidate InetAddres serialize/deserialize into the class.
Diffstat (limited to 'node/InetAddress.hpp')
| -rw-r--r-- | node/InetAddress.hpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/node/InetAddress.hpp b/node/InetAddress.hpp index c376a032..6970e92d 100644 --- a/node/InetAddress.hpp +++ b/node/InetAddress.hpp @@ -366,7 +366,8 @@ struct InetAddress : public sockaddr_storage template<unsigned int C> inline void serialize(Buffer<C> &b) const { - // Format is the same as in VERB_HELLO in Packet.hpp + // This is used in the protocol and must be the same as describe in places + // like VERB_HELLO in Packet.hpp. switch(ss_family) { case AF_INET: b.append((uint8_t)0x04); @@ -387,8 +388,8 @@ struct InetAddress : public sockaddr_storage template<unsigned int C> inline unsigned int deserialize(const Buffer<C> &b,unsigned int startAt = 0) { - unsigned int p = startAt; memset(this,0,sizeof(InetAddress)); + unsigned int p = startAt; switch(b[p++]) { case 0: return 1; |
