summaryrefslogtreecommitdiff
path: root/trackerlogic.c
diff options
context:
space:
mode:
Diffstat (limited to 'trackerlogic.c')
-rw-r--r--trackerlogic.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/trackerlogic.c b/trackerlogic.c
index d07851e..3ca266a 100644
--- a/trackerlogic.c
+++ b/trackerlogic.c
@@ -129,7 +129,7 @@ size_t add_peer_to_torrent_and_return_peers( ot_hash hash, ot_peer *peer, PROTO_
129 OT_PEERFLAG( peer ) |= PEER_FLAG_COMPLETED; 129 OT_PEERFLAG( peer ) |= PEER_FLAG_COMPLETED;
130 } 130 }
131 131
132 *peer_dest = *peer; 132 memcpy( peer_dest, peer, sizeof(ot_peer) );
133#ifdef WANT_SYNC 133#ifdef WANT_SYNC
134 if( proto == FLAG_MCA ) { 134 if( proto == FLAG_MCA ) {
135 mutex_bucket_unlock_by_hash( hash, delta_torrentcount ); 135 mutex_bucket_unlock_by_hash( hash, delta_torrentcount );
@@ -156,8 +156,7 @@ static size_t return_peers_all( ot_peerlist *peer_list, char *reply ) {
156 ot_peer * peers = (ot_peer*)bucket_list[bucket].data; 156 ot_peer * peers = (ot_peer*)bucket_list[bucket].data;
157 size_t peer_count = bucket_list[bucket].size; 157 size_t peer_count = bucket_list[bucket].size;
158 while( peer_count-- ) { 158 while( peer_count-- ) {
159 memcpy(r,peers,OT_PEER_COMPARE_SIZE); 159 memcpy(r,peers++,OT_PEER_COMPARE_SIZE);
160 peers+=sizeof(ot_peer);
161 r+=OT_PEER_COMPARE_SIZE; 160 r+=OT_PEER_COMPARE_SIZE;
162 } 161 }
163 } 162 }