Fixed bug which causes segmentation fault when bad piece is got.

pull/4/head
Tatsuhiro Tsujikawa 2011-12-09 21:34:18 +09:00
parent 9752704614
commit 2eed1c3914
1 changed files with 1 additions and 1 deletions

View File

@ -178,6 +178,7 @@ DefaultBtMessageFactory::createBtMessage
temp->setBtMessageValidator(validator);
}
temp->setDownloadContext(downloadContext_);
temp->setPeerStorage(peerStorage_);
msg = temp;
break;
}
@ -340,7 +341,6 @@ DefaultBtMessageFactory::createPieceMessage
pieceStorage_->getPieceLength(index)));
msg->setBtMessageValidator(validator);
msg->setDownloadContext(downloadContext_);
msg->setPeerStorage(peerStorage_);
setCommonProperty(msg);
return msg;
}