2009-12-05 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>

Fixed the bug that connection is always dropped if handshake
	message in extension protocol don't have metadata_size.
	src/HandshakeExtensionMessage.cc
	* src/HandshakeExtensionMessage.cc
pull/1/head
Tatsuhiro Tsujikawa 2009-12-05 07:51:04 +00:00
parent 1016f51f7a
commit c44cf31df7
2 changed files with 9 additions and 2 deletions

View File

@ -1,3 +1,10 @@
2009-12-05 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed the bug that connection is always dropped if handshake
message in extension protocol don't have metadata_size.
src/HandshakeExtensionMessage.cc
* src/HandshakeExtensionMessage.cc
2009-12-05 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Updated "URI, MAGNET, TORRENT_FILE, METALINK_FILE" section. Added

View File

@ -113,7 +113,7 @@ void HandshakeExtensionMessage::doReceivedAction()
BDE& attrs = _dctx->getAttribute(bittorrent::BITTORRENT);
if(!attrs.containsKey(bittorrent::METADATA) &&
!_peer->getExtensionMessageID("ut_metadata")) {
// TODO In metadataGetMode, if peer dont' support metadata
// TODO In metadataGetMode, if peer don't support metadata
// transfer, should we drop connection? There is a possibility
// that peer can still tell us peers using PEX.
throw DL_ABORT_EX("Peer doesn't support ut_metadata extension. Goodbye.");
@ -133,7 +133,7 @@ void HandshakeExtensionMessage::doReceivedAction()
_dctx->getOwnerRequestGroup()->getPieceStorage();
pieceStorage->setEndGamePieceNum(0);
}
} else {
} else if(!attrs.containsKey(bittorrent::METADATA)) {
throw DL_ABORT_EX("Peer didn't provide metadata_size."
" It seems that it doesn't have whole metadata.");
}