Changeset 1040 for trunk/libtorrent/src/dht/dht_node.cc
- Timestamp:
- 02/28/08 14:54:36 (4 years ago)
- Files:
-
- 1 modified
-
trunk/libtorrent/src/dht/dht_node.cc (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtorrent/src/dht/dht_node.cc
r1013 r1040 41 41 #include "torrent/object.h" 42 42 43 // For SACompact... 44 #include "download/download_info.h" 45 43 46 #include "dht_node.h" 44 47 … … 74 77 DhtNode::store_compact(char* buffer) const { 75 78 HashString::cast_from(buffer)->assign(data()); 76 *(uint32_t*) (buffer+20) = address()->sa_inet()->address_n(); 77 *(uint16_t*) (buffer+24) = address()->sa_inet()->port_n(); 78 return buffer+26; 79 80 SocketAddressCompact sa(address()->sa_inet()); 81 std::memcpy(buffer + 20, sa.c_str(), 6); 82 83 return buffer + 26; 79 84 } 80 85
