From b99ff98e4069b95aa181daa56b45e4b995060977 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Fri, 31 Mar 2006 15:05:08 +0000 Subject: [PATCH] rename TorrentMan::uploadedSize to TorrentMan::uploadLength --- src/PeerInteractionCommand.cc | 2 +- src/TorrentConsoleDownloadEngine.cc | 2 +- src/TorrentMan.cc | 10 +++++----- src/TorrentMan.h | 10 +++++----- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/PeerInteractionCommand.cc b/src/PeerInteractionCommand.cc index d0b374ee..0ca1f6ed 100644 --- a/src/PeerInteractionCommand.cc +++ b/src/PeerInteractionCommand.cc @@ -255,7 +255,7 @@ void PeerInteractionCommand::receiveMessage() { e->torrentMan->pieceLength, peerConnection); sendMessageQueue->addPendingMessage(pendingMessage); - e->torrentMan->addUploadedSize(message->getLength()); + e->torrentMan->addUploadLength(message->getLength()); e->torrentMan->addDeltaUpload(message->getLength()); } break; diff --git a/src/TorrentConsoleDownloadEngine.cc b/src/TorrentConsoleDownloadEngine.cc index aa5d5413..5cee357f 100644 --- a/src/TorrentConsoleDownloadEngine.cc +++ b/src/TorrentConsoleDownloadEngine.cc @@ -41,7 +41,7 @@ void TorrentConsoleDownloadEngine::printStatistics() { } printf(" UP:%.2f(%s) %dpeers", uploadSpeed/1000.0, - Util::llitos(torrentMan->getUploadedSize(), true).c_str(), + Util::llitos(torrentMan->getUploadLength(), true).c_str(), torrentMan->connections); fflush(stdout); } diff --git a/src/TorrentMan.cc b/src/TorrentMan.cc index f68037d2..cb8739a2 100644 --- a/src/TorrentMan.cc +++ b/src/TorrentMan.cc @@ -35,7 +35,7 @@ TorrentMan::TorrentMan():bitfield(NULL), peerEntryIdCounter(0), cuidCounter(0), - downloadLength(0), uploadedSize(0), + downloadLength(0), uploadLength(0), preDownloadedSize(0), preUploadedSize(0), deltaDownload(0), deltaUpload(0), storeDir("."), @@ -301,7 +301,7 @@ void TorrentMan::setup(string metaInfoFile) { peerId += Util::itos((int)(((double)10)*random()/(RAND_MAX+1.0))); } - uploadedSize = 0; + uploadLength = 0; downloadLength = 0; Dictionary* topDic = (Dictionary*)MetaFileUtil::parseMetaFile(metaInfoFile); const Dictionary* infoDic = (const Dictionary*)topDic->get("info"); @@ -448,11 +448,11 @@ void TorrentMan::read(FILE* file) { if(fread(&downloadLength, sizeof(downloadLength), 1, file) < 1) { throw new DlAbortEx(strerror(errno)); } - if(fread(&uploadedSize, sizeof(uploadedSize), 1, file) < 1) { + if(fread(&uploadLength, sizeof(uploadLength), 1, file) < 1) { throw new DlAbortEx(strerror(errno)); } preDownloadedSize = downloadLength; - preUploadedSize = uploadedSize; + preUploadedSize = uploadLength; delete [] savedBitfield; } catch(Exception* ex) { delete [] savedBitfield; @@ -476,7 +476,7 @@ void TorrentMan::save() const { if(fwrite(&downloadLength, sizeof(downloadLength), 1, file) < 1) { throw new DlAbortEx(strerror(errno)); } - if(fwrite(&uploadedSize, sizeof(uploadedSize), 1, file) < 1) { + if(fwrite(&uploadLength, sizeof(uploadLength), 1, file) < 1) { throw new DlAbortEx(strerror(errno)); } fclose(file); diff --git a/src/TorrentMan.h b/src/TorrentMan.h index 93c506d6..4e169769 100644 --- a/src/TorrentMan.h +++ b/src/TorrentMan.h @@ -74,7 +74,7 @@ private: int peerEntryIdCounter; int cuidCounter; long long int downloadLength; - long long int uploadedSize; + long long int uploadLength; long long int preDownloadedSize; long long int preUploadedSize; int deltaDownload; @@ -185,15 +185,15 @@ public: long long int getDownloadLength() const { return downloadLength; } void setDownloadLength(long long int length) { downloadLength = length; } - void addUploadedSize(int size) { uploadedSize += size; } - long long int getUploadedSize() const { return uploadedSize; } - void setUploadedSize(long long int size) { uploadedSize = size; } + void addUploadLength(int deltaLength) { uploadLength += deltaLength; } + long long int getUploadLength() const { return uploadLength; } + void setUploadLength(long long int length) { uploadLength = length; } long long int getSessionDownloadedSize() const { return downloadLength-preDownloadedSize; } long long int getSessionUploadedSize() const { - return uploadedSize-preUploadedSize; + return uploadLength-preUploadedSize; } void setFileMode(int mode) {