udp first connect needs to be counted as a connection too

dynamic-accesslists
denis 18 years ago
parent f07ec869d8
commit 45d34960b0

@ -605,6 +605,7 @@ static void handle_udp4( int64 serversocket ) {
outpacket[0] = 0; outpacket[1] = inpacket[3]; outpacket[0] = 0; outpacket[1] = inpacket[3];
outpacket[2] = inpacket[0]; outpacket[3] = inpacket[1]; outpacket[2] = inpacket[0]; outpacket[3] = inpacket[1];
socket_send4( serversocket, static_outbuf, 16, remoteip, remoteport ); socket_send4( serversocket, static_outbuf, 16, remoteip, remoteport );
ot_overall_udp_successfulannounces++;
break; break;
case 1: /* This is an announce action */ case 1: /* This is an announce action */
/* Minimum udp announce packet size */ /* Minimum udp announce packet size */
@ -640,6 +641,7 @@ static void handle_udp4( int64 serversocket ) {
outpacket[2] = htonl( OT_CLIENT_REQUEST_INTERVAL_RANDOM ); outpacket[2] = htonl( OT_CLIENT_REQUEST_INTERVAL_RANDOM );
outpacket[3] = outpacket[4] = 0; outpacket[3] = outpacket[4] = 0;
socket_send4( serversocket, static_outbuf, 20, remoteip, remoteport ); socket_send4( serversocket, static_outbuf, 20, remoteip, remoteport );
ot_overall_udp_successfulannounces++;
} else { } else {
torrent = add_peer_to_torrent( hash, &peer ); torrent = add_peer_to_torrent( hash, &peer );
if( !torrent ) if( !torrent )
@ -649,7 +651,7 @@ static void handle_udp4( int64 serversocket ) {
outpacket[1] = inpacket[12/4]; outpacket[1] = inpacket[12/4];
r = 8 + return_peers_for_torrent( torrent, numwant, static_outbuf + 8, 0 ); r = 8 + return_peers_for_torrent( torrent, numwant, static_outbuf + 8, 0 );
socket_send4( serversocket, static_outbuf, r, remoteip, remoteport ); socket_send4( serversocket, static_outbuf, r, remoteip, remoteport );
ot_overall_udp_successfulannounces++; ot_overall_udp_successfulannounces++;
} }
break; break;
} }

Loading…
Cancel
Save