summaryrefslogtreecommitdiff
path: root/opentracker.c
diff options
context:
space:
mode:
Diffstat (limited to 'opentracker.c')
-rw-r--r--opentracker.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/opentracker.c b/opentracker.c
index a83b276..7217f63 100644
--- a/opentracker.c
+++ b/opentracker.c
@@ -563,10 +563,10 @@ static void handle_udp4( int64 serversocket ) {
563 unsigned long *inpacket = (unsigned long*)static_inbuf; 563 unsigned long *inpacket = (unsigned long*)static_inbuf;
564 unsigned long *outpacket = (unsigned long*)static_outbuf; 564 unsigned long *outpacket = (unsigned long*)static_outbuf;
565 unsigned long numwant, left, event; 565 unsigned long numwant, left, event;
566 uint16 port; 566 uint16 port, remoteport;
567 size_t r; 567 size_t r;
568 568
569 r = socket_recv4( serversocket, static_inbuf, 8192, remoteip, &port); 569 r = socket_recv4( serversocket, static_inbuf, 8192, remoteip, &remoteport);
570 570
571 /* Minimum udp tracker packet size, also catches error */ 571 /* Minimum udp tracker packet size, also catches error */
572 if( r < 16 ) 572 if( r < 16 )
@@ -576,7 +576,7 @@ static void handle_udp4( int64 serversocket ) {
576 case 0: /* This is a connect action */ 576 case 0: /* This is a connect action */
577 outpacket[0] = 0; outpacket[1] = inpacket[3]; 577 outpacket[0] = 0; outpacket[1] = inpacket[3];
578 outpacket[2] = inpacket[0]; outpacket[3] = inpacket[1]; 578 outpacket[2] = inpacket[0]; outpacket[3] = inpacket[1];
579 socket_send4( serversocket, static_outbuf, 16, remoteip, port ); 579 socket_send4( serversocket, static_outbuf, 16, remoteip, remoteport );
580 break; 580 break;
581 case 1: /* This is an announce action */ 581 case 1: /* This is an announce action */
582 /* Minimum udp announce packet size */ 582 /* Minimum udp announce packet size */
@@ -611,7 +611,7 @@ static void handle_udp4( int64 serversocket ) {
611 outpacket[1] = inpacket[12/4]; 611 outpacket[1] = inpacket[12/4];
612 outpacket[2] = htonl( OT_CLIENT_REQUEST_INTERVAL_RANDOM ); 612 outpacket[2] = htonl( OT_CLIENT_REQUEST_INTERVAL_RANDOM );
613 outpacket[3] = outpacket[4] = 0; 613 outpacket[3] = outpacket[4] = 0;
614 socket_send4( serversocket, static_outbuf, 20, remoteip, port ); 614 socket_send4( serversocket, static_outbuf, 20, remoteip, remoteport );
615 } else { 615 } else {
616 torrent = add_peer_to_torrent( hash, &peer ); 616 torrent = add_peer_to_torrent( hash, &peer );
617 if( !torrent ) 617 if( !torrent )
@@ -620,7 +620,7 @@ static void handle_udp4( int64 serversocket ) {
620 outpacket[0] = htonl( 1 ); 620 outpacket[0] = htonl( 1 );
621 outpacket[1] = inpacket[12/4]; 621 outpacket[1] = inpacket[12/4];
622 r = 8 + return_peers_for_torrent( torrent, numwant, static_outbuf + 8, 0 ); 622 r = 8 + return_peers_for_torrent( torrent, numwant, static_outbuf + 8, 0 );
623 socket_send4( serversocket, static_outbuf, r, remoteip, port ); 623 socket_send4( serversocket, static_outbuf, r, remoteip, remoteport );
624 } 624 }
625 break; 625 break;
626 } 626 }