File indexing completed on 2025-01-05 04:37:17

0001 /*
0002     SPDX-FileCopyrightText: 2005 Joris Guisson <joris.guisson@gmail.com>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 #include "peerinterface.h"
0007 #include <util/functions.h>
0008 
0009 namespace bt
0010 {
0011 PeerInterface::PeerInterface(const PeerID &peer_id, Uint32 num_chunks)
0012     : peer_id(peer_id)
0013     , pieces(num_chunks)
0014 {
0015     stats.interested = false;
0016     stats.am_interested = false;
0017     stats.choked = true;
0018     stats.interested = false;
0019     stats.am_interested = false;
0020     stats.download_rate = 0;
0021     stats.upload_rate = 0;
0022     stats.perc_of_file = 0;
0023     stats.snubbed = false;
0024     stats.dht_support = false;
0025     stats.fast_extensions = false;
0026     stats.extension_protocol = false;
0027     stats.bytes_downloaded = stats.bytes_uploaded = 0;
0028     stats.aca_score = 0.0;
0029     stats.has_upload_slot = false;
0030     stats.num_up_requests = stats.num_down_requests = 0;
0031     stats.encrypted = false;
0032     stats.local = false;
0033     stats.max_request_queue = 0;
0034     stats.time_choked = CurrentTime();
0035     stats.time_unchoked = 0;
0036     stats.partial_seed = false;
0037     killed = false;
0038     paused = false;
0039 }
0040 
0041 PeerInterface::~PeerInterface()
0042 {
0043 }
0044 
0045 }