mirror of https://github.com/aria2/aria2
rename TorrentMan::uploadedSize to TorrentMan::uploadLength
parent
8b94be7475
commit
b99ff98e40
|
@ -255,7 +255,7 @@ void PeerInteractionCommand::receiveMessage() {
|
||||||
e->torrentMan->pieceLength,
|
e->torrentMan->pieceLength,
|
||||||
peerConnection);
|
peerConnection);
|
||||||
sendMessageQueue->addPendingMessage(pendingMessage);
|
sendMessageQueue->addPendingMessage(pendingMessage);
|
||||||
e->torrentMan->addUploadedSize(message->getLength());
|
e->torrentMan->addUploadLength(message->getLength());
|
||||||
e->torrentMan->addDeltaUpload(message->getLength());
|
e->torrentMan->addDeltaUpload(message->getLength());
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -41,7 +41,7 @@ void TorrentConsoleDownloadEngine::printStatistics() {
|
||||||
}
|
}
|
||||||
printf(" UP:%.2f(%s) %dpeers",
|
printf(" UP:%.2f(%s) %dpeers",
|
||||||
uploadSpeed/1000.0,
|
uploadSpeed/1000.0,
|
||||||
Util::llitos(torrentMan->getUploadedSize(), true).c_str(),
|
Util::llitos(torrentMan->getUploadLength(), true).c_str(),
|
||||||
torrentMan->connections);
|
torrentMan->connections);
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
|
|
||||||
TorrentMan::TorrentMan():bitfield(NULL),
|
TorrentMan::TorrentMan():bitfield(NULL),
|
||||||
peerEntryIdCounter(0), cuidCounter(0),
|
peerEntryIdCounter(0), cuidCounter(0),
|
||||||
downloadLength(0), uploadedSize(0),
|
downloadLength(0), uploadLength(0),
|
||||||
preDownloadedSize(0), preUploadedSize(0),
|
preDownloadedSize(0), preUploadedSize(0),
|
||||||
deltaDownload(0), deltaUpload(0),
|
deltaDownload(0), deltaUpload(0),
|
||||||
storeDir("."),
|
storeDir("."),
|
||||||
|
@ -301,7 +301,7 @@ void TorrentMan::setup(string metaInfoFile) {
|
||||||
peerId += Util::itos((int)(((double)10)*random()/(RAND_MAX+1.0)));
|
peerId += Util::itos((int)(((double)10)*random()/(RAND_MAX+1.0)));
|
||||||
}
|
}
|
||||||
|
|
||||||
uploadedSize = 0;
|
uploadLength = 0;
|
||||||
downloadLength = 0;
|
downloadLength = 0;
|
||||||
Dictionary* topDic = (Dictionary*)MetaFileUtil::parseMetaFile(metaInfoFile);
|
Dictionary* topDic = (Dictionary*)MetaFileUtil::parseMetaFile(metaInfoFile);
|
||||||
const Dictionary* infoDic = (const Dictionary*)topDic->get("info");
|
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) {
|
if(fread(&downloadLength, sizeof(downloadLength), 1, file) < 1) {
|
||||||
throw new DlAbortEx(strerror(errno));
|
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));
|
throw new DlAbortEx(strerror(errno));
|
||||||
}
|
}
|
||||||
preDownloadedSize = downloadLength;
|
preDownloadedSize = downloadLength;
|
||||||
preUploadedSize = uploadedSize;
|
preUploadedSize = uploadLength;
|
||||||
delete [] savedBitfield;
|
delete [] savedBitfield;
|
||||||
} catch(Exception* ex) {
|
} catch(Exception* ex) {
|
||||||
delete [] savedBitfield;
|
delete [] savedBitfield;
|
||||||
|
@ -476,7 +476,7 @@ void TorrentMan::save() const {
|
||||||
if(fwrite(&downloadLength, sizeof(downloadLength), 1, file) < 1) {
|
if(fwrite(&downloadLength, sizeof(downloadLength), 1, file) < 1) {
|
||||||
throw new DlAbortEx(strerror(errno));
|
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));
|
throw new DlAbortEx(strerror(errno));
|
||||||
}
|
}
|
||||||
fclose(file);
|
fclose(file);
|
||||||
|
|
|
@ -74,7 +74,7 @@ private:
|
||||||
int peerEntryIdCounter;
|
int peerEntryIdCounter;
|
||||||
int cuidCounter;
|
int cuidCounter;
|
||||||
long long int downloadLength;
|
long long int downloadLength;
|
||||||
long long int uploadedSize;
|
long long int uploadLength;
|
||||||
long long int preDownloadedSize;
|
long long int preDownloadedSize;
|
||||||
long long int preUploadedSize;
|
long long int preUploadedSize;
|
||||||
int deltaDownload;
|
int deltaDownload;
|
||||||
|
@ -185,15 +185,15 @@ public:
|
||||||
long long int getDownloadLength() const { return downloadLength; }
|
long long int getDownloadLength() const { return downloadLength; }
|
||||||
void setDownloadLength(long long int length) { downloadLength = length; }
|
void setDownloadLength(long long int length) { downloadLength = length; }
|
||||||
|
|
||||||
void addUploadedSize(int size) { uploadedSize += size; }
|
void addUploadLength(int deltaLength) { uploadLength += deltaLength; }
|
||||||
long long int getUploadedSize() const { return uploadedSize; }
|
long long int getUploadLength() const { return uploadLength; }
|
||||||
void setUploadedSize(long long int size) { uploadedSize = size; }
|
void setUploadLength(long long int length) { uploadLength = length; }
|
||||||
|
|
||||||
long long int getSessionDownloadedSize() const {
|
long long int getSessionDownloadedSize() const {
|
||||||
return downloadLength-preDownloadedSize;
|
return downloadLength-preDownloadedSize;
|
||||||
}
|
}
|
||||||
long long int getSessionUploadedSize() const {
|
long long int getSessionUploadedSize() const {
|
||||||
return uploadedSize-preUploadedSize;
|
return uploadLength-preUploadedSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setFileMode(int mode) {
|
void setFileMode(int mode) {
|
||||||
|
|
Loading…
Reference in New Issue