summaryrefslogtreecommitdiff
path: root/ot_udp.c
diff options
context:
space:
mode:
Diffstat (limited to 'ot_udp.c')
-rw-r--r--ot_udp.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/ot_udp.c b/ot_udp.c
index 764281c..8f55963 100644
--- a/ot_udp.c
+++ b/ot_udp.c
@@ -27,7 +27,7 @@ static void udp_make_connectionid( uint32_t * connid, const char * remoteip ) {
27 (void)remoteip; 27 (void)remoteip;
28 28
29 /* Use a static secret for now */ 29 /* Use a static secret for now */
30 memcpy( connid, g_static_connid, 8 ); 30 memmove( connid, g_static_connid, 8 );
31} 31}
32 32
33static int udp_test_connectionid( const uint32_t * const connid, const char * remoteip ) { 33static int udp_test_connectionid( const uint32_t * const connid, const char * remoteip ) {
@@ -94,21 +94,21 @@ void handle_udp4( int64 serversocket ) {
94 94
95 OT_SETIP( &peer, remoteip ); 95 OT_SETIP( &peer, remoteip );
96 OT_SETPORT( &peer, &port ); 96 OT_SETPORT( &peer, &port );
97 OT_FLAG( &peer ) = 0; 97 OT_PEERFLAG( &peer ) = 0;
98 98
99 switch( event ) { 99 switch( event ) {
100 case 1: OT_FLAG( &peer ) |= PEER_FLAG_COMPLETED; break; 100 case 1: OT_PEERFLAG( &peer ) |= PEER_FLAG_COMPLETED; break;
101 case 3: OT_FLAG( &peer ) |= PEER_FLAG_STOPPED; break; 101 case 3: OT_PEERFLAG( &peer ) |= PEER_FLAG_STOPPED; break;
102 default: break; 102 default: break;
103 } 103 }
104 104
105 if( !left ) 105 if( !left )
106 OT_FLAG( &peer ) |= PEER_FLAG_SEEDING; 106 OT_PEERFLAG( &peer ) |= PEER_FLAG_SEEDING;
107 107
108 outpacket[0] = htonl( 1 ); /* announce action */ 108 outpacket[0] = htonl( 1 ); /* announce action */
109 outpacket[1] = inpacket[12/4]; 109 outpacket[1] = inpacket[12/4];
110 110
111 if( OT_FLAG( &peer ) & PEER_FLAG_STOPPED ) /* Peer is gone. */ 111 if( OT_PEERFLAG( &peer ) & PEER_FLAG_STOPPED ) /* Peer is gone. */
112 r = remove_peer_from_torrent( hash, &peer, static_outbuf, FLAG_UDP ); 112 r = remove_peer_from_torrent( hash, &peer, static_outbuf, FLAG_UDP );
113 else { 113 else {
114 torrent = add_peer_to_torrent( hash, &peer WANT_SYNC_PARAM( 0 ) ); 114 torrent = add_peer_to_torrent( hash, &peer WANT_SYNC_PARAM( 0 ) );