/* */ #include "BtHaveMessage.h" #include "Peer.h" #include "PieceStorage.h" #include "message.h" #include "DlAbortEx.h" namespace aria2 { const std::string BtHaveMessage::NAME("have"); SharedHandle BtHaveMessage::create (const unsigned char* data, size_t dataLength) { return IndexBtMessage::create(data, dataLength); } void BtHaveMessage::doReceivedAction() { if(_metadataGetMode) { return; } peer->updateBitfield(getIndex(), 1); pieceStorage->addPieceStats(getIndex()); if(peer->isSeeder() && pieceStorage->downloadFinished()) { throw DL_ABORT_EX(MSG_GOOD_BYE_SEEDER); } } } // namespace aria2