X-Git-Url: http://p2p-next.cs.pub.ro/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Flibswift%2Fswift.h;fp=src%2Flibswift%2Fswift.h;h=2a9f68aee5e8842f8d619dc24dc1aaf5c6a80152;hb=45635e914bca29ba32720ea13ed88e2e3d753c34;hp=dfe85f13708d552ca5839b9367ac43462ef786da;hpb=359307b36bfefb083b437720eb0c0d0f89ab58d2;p=swifty.git diff --git a/src/libswift/swift.h b/src/libswift/swift.h index dfe85f1..2a9f68a 100644 --- a/src/libswift/swift.h +++ b/src/libswift/swift.h @@ -103,6 +103,7 @@ namespace swift { //{ inet_aton(ipv4_str,&(addr.sin_addr)); } void clear () { addr = (struct sockaddr_mptp *)calloc(1, sizeof(struct sockaddr_mptp) + sizeof(struct mptp_dest)); + addr->count = 1; } Address() { clear(); @@ -124,6 +125,7 @@ namespace swift { set_port(port); } Address(const struct sockaddr_in& address) { + clear(); addr->dests[0].addr = address.sin_addr.s_addr; addr->dests[0].port = address.sin_port; }