summaryrefslogtreecommitdiff
path: root/opentracker.c
diff options
context:
space:
mode:
authordenis <>2007-03-15 23:33:09 +0000
committerdenis <>2007-03-15 23:33:09 +0000
commit45d34960b0ffee1b436da2a784ff4549c6333971 (patch)
tree96c4d1d1c8866fc6f99777c692345df51cf2cc28 /opentracker.c
parentf07ec869d80b4467de76212d6e73bd5dd7739642 (diff)
udp first connect needs to be counted as a connection too
Diffstat (limited to 'opentracker.c')
-rw-r--r--opentracker.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/opentracker.c b/opentracker.c
index c8c3cd5..5b3a48d 100644
--- a/opentracker.c
+++ b/opentracker.c
@@ -605,6 +605,7 @@ static void handle_udp4( int64 serversocket ) {
605 outpacket[0] = 0; outpacket[1] = inpacket[3]; 605 outpacket[0] = 0; outpacket[1] = inpacket[3];
606 outpacket[2] = inpacket[0]; outpacket[3] = inpacket[1]; 606 outpacket[2] = inpacket[0]; outpacket[3] = inpacket[1];
607 socket_send4( serversocket, static_outbuf, 16, remoteip, remoteport ); 607 socket_send4( serversocket, static_outbuf, 16, remoteip, remoteport );
608 ot_overall_udp_successfulannounces++;
608 break; 609 break;
609 case 1: /* This is an announce action */ 610 case 1: /* This is an announce action */
610 /* Minimum udp announce packet size */ 611 /* Minimum udp announce packet size */
@@ -640,6 +641,7 @@ static void handle_udp4( int64 serversocket ) {
640 outpacket[2] = htonl( OT_CLIENT_REQUEST_INTERVAL_RANDOM ); 641 outpacket[2] = htonl( OT_CLIENT_REQUEST_INTERVAL_RANDOM );
641 outpacket[3] = outpacket[4] = 0; 642 outpacket[3] = outpacket[4] = 0;
642 socket_send4( serversocket, static_outbuf, 20, remoteip, remoteport ); 643 socket_send4( serversocket, static_outbuf, 20, remoteip, remoteport );
644 ot_overall_udp_successfulannounces++;
643 } else { 645 } else {
644 torrent = add_peer_to_torrent( hash, &peer ); 646 torrent = add_peer_to_torrent( hash, &peer );
645 if( !torrent ) 647 if( !torrent )
@@ -649,7 +651,7 @@ static void handle_udp4( int64 serversocket ) {
649 outpacket[1] = inpacket[12/4]; 651 outpacket[1] = inpacket[12/4];
650 r = 8 + return_peers_for_torrent( torrent, numwant, static_outbuf + 8, 0 ); 652 r = 8 + return_peers_for_torrent( torrent, numwant, static_outbuf + 8, 0 );
651 socket_send4( serversocket, static_outbuf, r, remoteip, remoteport ); 653 socket_send4( serversocket, static_outbuf, r, remoteip, remoteport );
652 ot_overall_udp_successfulannounces++; 654 ot_overall_udp_successfulannounces++;
653 } 655 }
654 break; 656 break;
655 } 657 }