From e88a799172b8af6f5e187c32f8d28856eafe1678 Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Mon, 6 Oct 2008 20:18:42 +0000 Subject: [PATCH] Bugfix: API change missed in two points, when calling return_peers_for_torrent. is_tcp was replaced by FLAG_TCP or FLAG_UDP --- ot_http.c | 4 ++-- ot_udp.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ot_http.c b/ot_http.c index a9502f2..6fbab88 100644 --- a/ot_http.c +++ b/ot_http.c @@ -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; @@ -576,4 +576,4 @@ ssize_t http_handle_request( const int64 client_socket, char *data, size_t recv_ return reply_size; } -const char *g_version_http_c = "$Source: /home/cvsroot/opentracker/ot_http.c,v $: $Revision: 1.11 $\n"; +const char *g_version_http_c = "$Source: /home/cvsroot/opentracker/ot_http.c,v $: $Revision: 1.12 $\n"; diff --git a/ot_udp.c b/ot_udp.c index fa2976d..e059d81 100644 --- a/ot_udp.c +++ b/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 ); @@ -138,4 +138,4 @@ void handle_udp4( int64 serversocket ) { } } -const char *g_version_udp_c = "$Source: /home/cvsroot/opentracker/ot_udp.c,v $: $Revision: 1.14 $\n"; +const char *g_version_udp_c = "$Source: /home/cvsroot/opentracker/ot_udp.c,v $: $Revision: 1.15 $\n";