mirror of
				git://erdgeist.org/opentracker
				synced 2025-11-03 19:33:23 +08:00 
			
		
		
		
	Bugfix: API change missed in two points, when calling return_peers_for_torrent. is_tcp was replaced by FLAG_TCP or FLAG_UDP
This commit is contained in:
		
							parent
							
								
									0dafc2ab26
								
							
						
					
					
						commit
						719858548d
					
				@ -488,7 +488,7 @@ static ssize_t http_handle_announce( const int64 client_socket, char *data ) {
 | 
			
		||||
    len = remove_peer_from_torrent( hash, &peer, SUCCESS_HTTP_HEADER_LENGTH + static_outbuf, FLAG_TCP );
 | 
			
		||||
  else {
 | 
			
		||||
    torrent = add_peer_to_torrent( hash, &peer  WANT_SYNC_PARAM( 0 ) );
 | 
			
		||||
    if( !torrent || !( len = return_peers_for_torrent( hash, numwant, SUCCESS_HTTP_HEADER_LENGTH + static_outbuf, 1 ) ) ) HTTPERROR_500;
 | 
			
		||||
    if( !torrent || !( len = return_peers_for_torrent( hash, numwant, SUCCESS_HTTP_HEADER_LENGTH + static_outbuf, FLAG_TCP ) ) ) HTTPERROR_500;
 | 
			
		||||
  }
 | 
			
		||||
  stats_issue_event( EVENT_ANNOUNCE, FLAG_TCP, len);
 | 
			
		||||
  return len;
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										2
									
								
								ot_udp.c
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								ot_udp.c
									
									
									
									
									
								
							@ -115,7 +115,7 @@ void handle_udp4( int64 serversocket ) {
 | 
			
		||||
        if( !torrent )
 | 
			
		||||
          return; /* XXX maybe send error */
 | 
			
		||||
 | 
			
		||||
        r = 8 + return_peers_for_torrent( hash, numwant, static_outbuf + 8, 0 );
 | 
			
		||||
        r = 8 + return_peers_for_torrent( hash, numwant, static_outbuf + 8, FLAG_UDP );
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      socket_send4( serversocket, static_outbuf, r, remoteip, remoteport );
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user