summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog16
-rw-r--r--src/DefaultBtMessageDispatcher.cc6
-rw-r--r--src/DefaultPeerStorage.h2
-rw-r--r--src/HttpResponseCommand.cc2
4 files changed, 21 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 6265f359..4e41b684 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2007-02-03 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
+
+ To lower CPU usage in BitTorrent download when --max-upload-limit
+ command-line option specified:
+
+ * src/DefaultBtMessageDispatcher.cc
+ (sendMessages): Calculate uploading speed only when current message
+ is uploading data and is not sent yet.
+
+ * src/DefaultPeerStorage.h
+ (MAX_PEER_LIST_SIZE): 100 -> 60, because 60 is well enough.
+
+ * src/HttpResponseCommand.cc
+ (handleDefaultEncoding): Added the cast to int32_t to itos.
+ This fixes compile error in Soralis 10.
+
2007-01-30 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
To fix segfault in Metalink download:
diff --git a/src/DefaultBtMessageDispatcher.cc b/src/DefaultBtMessageDispatcher.cc
index 91ad32f0..b7e8f3f8 100644
--- a/src/DefaultBtMessageDispatcher.cc
+++ b/src/DefaultBtMessageDispatcher.cc
@@ -61,10 +61,10 @@ void DefaultBtMessageDispatcher::sendMessages() {
while(messageQueue.size() > 0) {
BtMessageHandle msg = messageQueue.front();
messageQueue.pop_front();
- if(maxUploadSpeedLimit > 0) {
+ if(maxUploadSpeedLimit > 0 &&
+ msg->isUploading() && !msg->isSendingInProgress()) {
TransferStat stat = peerStorage->calculateStat();
- if(maxUploadSpeedLimit < stat.getUploadSpeed() &&
- msg->isUploading() && !msg->isSendingInProgress()) {
+ if(maxUploadSpeedLimit < stat.getUploadSpeed()) {
tempQueue.push_back(msg);
continue;
}
diff --git a/src/DefaultPeerStorage.h b/src/DefaultPeerStorage.h
index 756700dd..21ba102e 100644
--- a/src/DefaultPeerStorage.h
+++ b/src/DefaultPeerStorage.h
@@ -41,7 +41,7 @@
#include "Logger.h"
#include "BtRuntime.h"
-#define MAX_PEER_LIST_SIZE 100
+#define MAX_PEER_LIST_SIZE 60
#define MAX_PEER_ERROR 5
class DefaultPeerStorage : public PeerStorage {
diff --git a/src/HttpResponseCommand.cc b/src/HttpResponseCommand.cc
index c2cc4070..030d8460 100644
--- a/src/HttpResponseCommand.cc
+++ b/src/HttpResponseCommand.cc
@@ -145,7 +145,7 @@ bool HttpResponseCommand::handleDefaultEncoding(const HttpHeader& headers) {
req->setKeepAlive(false);
e->segmentMan->isSplittable = false;
e->segmentMan->downloadStarted = true;
- e->segmentMan->diskWriter->initAndOpenFile("/tmp/aria2"+Util::itos(getpid()));
+ e->segmentMan->diskWriter->initAndOpenFile("/tmp/aria2"+Util::itos((int32_t)getpid()));
createHttpDownloadCommand();
return true;
}