projects
/
swifty.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Override the assignment operator for the Address class.
[swifty.git]
/
src
/
libswift
/
swift.h
diff --git
a/src/libswift/swift.h
b/src/libswift/swift.h
index
2a9f68a
..
d44b882
100644
(file)
--- a/
src/libswift/swift.h
+++ b/
src/libswift/swift.h
@@
-134,6
+134,15
@@
namespace swift {
}
uint32_t ipv4 () const { return ntohl(addr->dests[0].addr); }
uint16_t port () const { return ntohs(addr->dests[0].port); }
}
uint32_t ipv4 () const { return ntohl(addr->dests[0].addr); }
uint16_t port () const { return ntohs(addr->dests[0].port); }
+ Address& operator = (const Address& b) {
+ if (this != &b) {
+ free(addr);
+ clear();
+ addr->dests[0].addr = b.addr->dests[0].addr;
+ addr->dests[0].port = b.addr->dests[0].port;
+ }
+ return *this;
+ }
bool operator == (const Address& b) const {
return addr->count == b.addr->count &&
addr->dests[0].port==b.addr->dests[0].port &&
bool operator == (const Address& b) const {
return addr->count == b.addr->count &&
addr->dests[0].port==b.addr->dests[0].port &&