mirror of
https://github.com/aria2/aria2.git
synced 2025-01-08 11:01:38 +00:00
rename TorrentMan::uploadedSize to TorrentMan::uploadLength
This commit is contained in:
parent
8b94be7475
commit
b99ff98e40
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user