summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ot_udp.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/ot_udp.c b/ot_udp.c
index c841375..0a6458e 100644
--- a/ot_udp.c
+++ b/ot_udp.c
@@ -30,7 +30,6 @@ static void udp_make_connectionid( uint32_t * connid, const char * remoteip ) {
30 memcpy( connid, g_static_connid, 8 ); 30 memcpy( connid, g_static_connid, 8 );
31} 31}
32 32
33#if 0
34static 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 ) {
35 /* Touch unused variable */ 34 /* Touch unused variable */
36 (void)remoteip; 35 (void)remoteip;
@@ -38,7 +37,6 @@ static int udp_test_connectionid( const uint32_t * const connid, const char * re
38 /* Test against our static secret */ 37 /* Test against our static secret */
39 return !memcmp( connid, g_static_connid, 8 ); 38 return !memcmp( connid, g_static_connid, 8 );
40} 39}
41#endif
42 40
43/* UDP implementation according to http://xbtt.sourceforge.net/udp_tracker_protocol.html */ 41/* UDP implementation according to http://xbtt.sourceforge.net/udp_tracker_protocol.html */
44void handle_udp4( int64 serversocket ) { 42void handle_udp4( int64 serversocket ) {
@@ -81,8 +79,8 @@ void handle_udp4( int64 serversocket ) {
81 if( r < 98 ) 79 if( r < 98 )
82 return; 80 return;
83 81
84/* if( !udp_test_connectionid( inpacket, remoteip )) 82 if( !udp_test_connectionid( inpacket, remoteip ))
85 fprintf( stderr, "UDP Connection id missmatch.\n" ); */ 83 fprintf( stderr, "UDP connect Connection id missmatch.\n" );
86 84
87 /* We do only want to know, if it is zero */ 85 /* We do only want to know, if it is zero */
88 left = inpacket[64/4] | inpacket[68/4]; 86 left = inpacket[64/4] | inpacket[68/4];
@@ -125,8 +123,8 @@ void handle_udp4( int64 serversocket ) {
125 break; 123 break;
126 124
127 case 2: /* This is a scrape action */ 125 case 2: /* This is a scrape action */
128/* if( !udp_test_connectionid( inpacket, remoteip )) 126 if( !udp_test_connectionid( inpacket, remoteip ))
129 fprintf( stderr, "UDP Connection id missmatch.\n" ); */ 127 fprintf( stderr, "UDP scrape Connection id missmatch.\n" );
130 128
131 outpacket[0] = htonl( 2 ); /* scrape action */ 129 outpacket[0] = htonl( 2 ); /* scrape action */
132 outpacket[1] = inpacket[12/4]; 130 outpacket[1] = inpacket[12/4];