2007-05-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>

* Added the simultaneous download feature.
	* src/main.cc: Print "Exception caught: " when exception is 
caught.
pull/1/head
Tatsuhiro Tsujikawa 2007-05-20 14:27:28 +00:00
parent 079d2844ec
commit f3995b1f7e
6 changed files with 10 additions and 8 deletions

View File

@ -1,7 +1,8 @@
2007-05-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
* Added the simultaneous download feature.
* src/main.cc: Print "Exception caught: " when exception is caught.
2007-04-06 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
* src/PeerAbstractCommand.cc

1
TODO
View File

@ -37,3 +37,4 @@
* Do not use ufilename in multi-simultaneous download mode.
* Merge umask patch.
https://sourceforge.net/tracker/index.php?func=detail&aid=1718641&group_id=159897&atid=813673
* Use CUIDCounter to generate CUID.

View File

@ -113,9 +113,7 @@ void RequestGroup::shouldCancelDownloadForSafety()
_segmentMan->getFilePath().c_str(),
_segmentMan->getSegmentFilePath().c_str());
throw new FatalException(EX_FILE_ALREADY_EXISTS,
_segmentMan->getFilePath().c_str(),
_segmentMan->getSegmentFilePath().c_str());
throw new FatalException(EX_DOWNLOAD_ABORTED);
}
}

View File

@ -81,9 +81,10 @@ RequestInfos TorrentRequestInfo::execute() {
} else {
if(PIECE_STORAGE(btContext)->getDiskAdaptor()->fileExists()) {
if(op->get(PREF_ALLOW_OVERWRITE) != V_TRUE) {
throw new FatalException(EX_FILE_ALREADY_EXISTS,
PIECE_STORAGE(btContext)->getDiskAdaptor()->getFilePath().c_str(),
BT_PROGRESS_INFO_FILE(btContext)->getFilename().c_str());
logger->notice(MSG_FILE_ALREADY_EXISTS,
PIECE_STORAGE(btContext)->getDiskAdaptor()->getFilePath().c_str(),
BT_PROGRESS_INFO_FILE(btContext)->getFilename().c_str());
throw new FatalException(EX_DOWNLOAD_ABORTED);
} else {
PIECE_STORAGE(btContext)->getDiskAdaptor()->openExistingFile();
#ifdef ENABLE_MESSAGE_DIGEST

View File

@ -741,7 +741,7 @@ int main(int argc, char* argv[]) {
*/
}
} catch(Exception* ex) {
cerr << ex->getMsg() << endl;
cerr << "Exception caught:\n" << ex->getMsg() << endl;
delete ex;
exit(EXIT_FAILURE);
}

View File

@ -118,4 +118,5 @@
#define EX_INVALID_PAYLOAD_SIZE _("Invalid payload size for %s, size=%d. It should be %d.")
#define EX_INVALID_BT_MESSAGE_ID _("Invalid ID=%d for %s. It should be %d.")
#define EX_INVALID_CHUNK_CHECKSUM _("Chunk checksum validation failed. checksumIndex=%d, offset=%lld, expectedHash=%s, actualHash=%s")
#define EX_DOWNLOAD_ABORTED _("Download aborted.")
#endif // _D_MESSAGE_H_