|
From: <arn...@us...> - 2007-12-09 22:06:45
|
Revision: 929
http://dcplusplus.svn.sourceforge.net/dcplusplus/?rev=929&view=rev
Author: arnetheduck
Date: 2007-12-09 14:06:36 -0800 (Sun, 09 Dec 2007)
Log Message:
-----------
tentative multisource crash fix
Modified Paths:
--------------
dcplusplus/trunk/changelog.txt
dcplusplus/trunk/dcpp/Download.cpp
dcplusplus/trunk/dcpp/DownloadManager.cpp
Modified: dcplusplus/trunk/changelog.txt
===================================================================
--- dcplusplus/trunk/changelog.txt 2007-12-04 21:17:15 UTC (rev 928)
+++ dcplusplus/trunk/changelog.txt 2007-12-09 22:06:36 UTC (rev 929)
@@ -25,6 +25,7 @@
* Finished UCMD extension draft implementation
* Fixed status bars (poy)
* Fixed protocol error STA being sent as type C
+* Fixed a multisource download crash
-- 0.703 2007-11-08 --
* Fixed invalid strings (thanks james ross)
Modified: dcplusplus/trunk/dcpp/Download.cpp
===================================================================
--- dcplusplus/trunk/dcpp/Download.cpp 2007-12-04 21:17:15 UTC (rev 928)
+++ dcplusplus/trunk/dcpp/Download.cpp 2007-12-09 22:06:36 UTC (rev 929)
@@ -61,10 +61,10 @@
}
if(qi.isSet(QueueItem::FLAG_RESUME)) {
+#ifdef PORT_ME
const string& target = (getTempTarget().empty() ? getPath() : getTempTarget());
int64_t start = File::getSize(target);
-#ifdef PORT_ME
// Only use antifrag if we don't have a previous non-antifrag part
if( BOOLSETTING(ANTI_FRAG) && (start == -1) ) {
int64_t aSize = File::getSize(target + Download::ANTI_FRAG_EXT);
@@ -85,6 +85,7 @@
Download::~Download() {
getUserConnection().setDownload(0);
+ delete file;
}
AdcCommand Download::getCommand(bool zlib) {
Modified: dcplusplus/trunk/dcpp/DownloadManager.cpp
===================================================================
--- dcplusplus/trunk/dcpp/DownloadManager.cpp 2007-12-04 21:17:15 UTC (rev 928)
+++ dcplusplus/trunk/dcpp/DownloadManager.cpp 2007-12-09 22:06:36 UTC (rev 929)
@@ -341,8 +341,6 @@
if(d->getType() == Transfer::TYPE_TREE) {
d->getFile()->flush();
- delete d->getFile();
- d->setFile(NULL);
int64_t bl = 1024;
while(bl * (int64_t)d->getTigerTree().getLeaves().size() < d->getTigerTree().getFileSize())
@@ -367,8 +365,6 @@
// First, finish writing the file (flushing the buffers and closing the file...)
try {
d->getFile()->flush();
- delete d->getFile();
- d->setFile(0);
} catch(const FileException& e) {
failDownload(aSource, e.getError());
return;
@@ -493,8 +489,6 @@
} catch(const Exception&) {
}
}
- delete d->getFile();
- d->setFile(NULL);
if(d->isSet(Download::FLAG_ANTI_FRAG)) {
d->unsetFlag(Download::FLAG_ANTI_FRAG);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|