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