mirror of https://github.com/aria2/aria2
2006-04-06 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
To print ETA: * src/TorrentDownloadEngine.cc (afterEachIteration): Added download completion handling when dealing with TorrentMan::isPartialDownloadingMode() == true. * src/TorrentDownloadEngine.h (onPartialDownloadingCompletes): New function. * src/TorrentConsoleDownloadEngine.h (startup): New variable. (sessionDownloadLength): New variable. (avgSpeed): New variable. (eta): New variable. * src/TorrentConsoleDownloadEngine.cc (initStatistics): Initialized new variables: eta, avgSpeed, startup. (calculateSpeed): Calculate average speed and ETA. (printStatistics): Added ETA. * src/Util.h (secfmt): New function. * src/Util.cc (secfmt): New function. 2006-04-05 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> To detect "keep alive" flooding: * src/PeerInteractionCommand.h (keepAliveCount): New variable * src/PeerInteractionCommand.cc (Constructor): Initialized new variable: keepAliveCount. (detectMessageFlooding): Added "keep alive" flooding detection. (receiveMessage): Increase keepAliveCount when "keep alive" message received. To add the ability to download only specified files in multi-file torrent: * src/BitfieldMan.h (filterBitfield): New variable. (filterEnabled): New variable. (setFilterBit): New function. (enableFilter): New function. (disableFilter): New function. (isFilterEnabled): New function. (getFilteredTotalLength): New function. (getCompletedLength): New function. * src/BitfieldMan.cc (Constructor): Initialized new variable: filterBitfield, filterEnabled. (CopyConstructor): Added filterBitfield and filterEnabled. (operator==): Added filterBitfield and filterEnabled. (Destructor): Added filterBitfield. (getMissingIndex): Use filterBitfield. (getMissingUnusedIndex): Use filterBitfield. (getFirstMissingUnusedIndex): Use filterBitfield. (getFirstMissingUnusedIndex): Use filterBitfield. (getAllMissingIndexes): Use filterBitfield. (countMissingBlock): Use filterBitfield. (countBlock): Use filterBitfield. (setBitInternal): Added new argument on. (setUseBit): Use setBitInternal. (unsetUseBit): Use setBitInternal. (setBit): Use setBitInternal. (unsetBit): Use setBitInternal. (isAllBitSet): Use filterBitfield. (setFilterBit): New function. (addFilter): New function. (enableFilter): New function. (disableFilter): New function. (clearFilter): New function. (isFilterEnabled): New function. (getFilteredTotalLength): New function. (getCompletedLength): New function. * src/TorrentMan.h [FileEntry](Constructor): Updated signature. Initalized newly added variables. [FileEntry](offset): New variable. [FileEntry](extracted): New variable. [FileEntry](requested): New variable. (readFileEntry): New function. (option): New variable. (splitMultiFile): Removed const qualifier. (fixFilename): Removed const qualifier. (readFileEntryFromMetaInfoFile): New function. (finishPartialDownloadingMode): New function. (isPartialDownloadingMode): New function. (setFileEntriesToDownload): New function. (getCompletedLength): New function. (getPartialTotalLength): New function. * src/TorrentMan.cc (readFileEntry): New function. (setup): Use readFileEntry. If no-preallocation option is specified, use DefaultDiskWriter. (readFileEntryFromMetaInfoFile): New function. (fixFilename): Removed const qualifier. (splitMultiFile): Removed const qualifier. (setFileEntriesToDownload): New function. (isPartialDownloadingMode): New function. (finishPartialDownloadingMode): New function. (getCompletedLength): New function. (getPartialTotalLength): New function. * src/TorrentConsoleDownloadEngine.h (partialDownloadLengthDiff): New variable. (partialTotalLength): New variable. (downloadLength): New variable. (totalLength): New variable. * src/TorrentConsoleDownloadEngine.cc (onPartialDownloadingCompletes): Added log. (initStatistics): Initialized new variables: partialDownloadLengthDiff, partialTotalLength, downloadLength, totalLength. (calculate): Calculate downloadLength and totalLength. * src/prefs.h :New definition PREF_NO_PREALLOCATION * src/main.cc (addCommand): Changed argument signature. (main): Added new variable: args. Added new option "torrent-show-files" "no-preallocation". Usage is not updated yet. 2006-04-02 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> * src/PeerMessage.cc (setBitfield): Fixed invalid memory de-allocation.pull/1/head
parent
7228402dad
commit
9a52be6a29
118
ChangeLog
118
ChangeLog
|
@ -1,3 +1,121 @@
|
||||||
|
2006-04-06 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
||||||
|
|
||||||
|
To print ETA:
|
||||||
|
|
||||||
|
* src/TorrentDownloadEngine.cc (afterEachIteration): Added download
|
||||||
|
completion handling when dealing with
|
||||||
|
TorrentMan::isPartialDownloadingMode() == true.
|
||||||
|
* src/TorrentDownloadEngine.h (onPartialDownloadingCompletes):
|
||||||
|
New function.
|
||||||
|
* src/TorrentConsoleDownloadEngine.h (startup): New variable.
|
||||||
|
(sessionDownloadLength): New variable.
|
||||||
|
(avgSpeed): New variable.
|
||||||
|
(eta): New variable.
|
||||||
|
* src/TorrentConsoleDownloadEngine.cc (initStatistics): Initialized
|
||||||
|
new variables: eta, avgSpeed, startup.
|
||||||
|
(calculateSpeed): Calculate average speed and ETA.
|
||||||
|
(printStatistics): Added ETA.
|
||||||
|
|
||||||
|
* src/Util.h (secfmt): New function.
|
||||||
|
* src/Util.cc (secfmt): New function.
|
||||||
|
|
||||||
|
2006-04-05 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
||||||
|
|
||||||
|
To detect "keep alive" flooding:
|
||||||
|
|
||||||
|
* src/PeerInteractionCommand.h (keepAliveCount): New variable
|
||||||
|
* src/PeerInteractionCommand.cc (Constructor): Initialized new
|
||||||
|
variable: keepAliveCount.
|
||||||
|
(detectMessageFlooding): Added "keep alive" flooding detection.
|
||||||
|
(receiveMessage): Increase keepAliveCount when "keep alive" message
|
||||||
|
received.
|
||||||
|
|
||||||
|
To add the ability to download only specified files in multi-file
|
||||||
|
torrent:
|
||||||
|
|
||||||
|
* src/BitfieldMan.h (filterBitfield): New variable.
|
||||||
|
(filterEnabled): New variable.
|
||||||
|
(setFilterBit): New function.
|
||||||
|
(enableFilter): New function.
|
||||||
|
(disableFilter): New function.
|
||||||
|
(isFilterEnabled): New function.
|
||||||
|
(getFilteredTotalLength): New function.
|
||||||
|
(getCompletedLength): New function.
|
||||||
|
* src/BitfieldMan.cc (Constructor): Initialized new variable:
|
||||||
|
filterBitfield, filterEnabled.
|
||||||
|
(CopyConstructor): Added filterBitfield and filterEnabled.
|
||||||
|
(operator==): Added filterBitfield and filterEnabled.
|
||||||
|
(Destructor): Added filterBitfield.
|
||||||
|
(getMissingIndex): Use filterBitfield.
|
||||||
|
(getMissingUnusedIndex): Use filterBitfield.
|
||||||
|
(getFirstMissingUnusedIndex): Use filterBitfield.
|
||||||
|
(getFirstMissingUnusedIndex): Use filterBitfield.
|
||||||
|
(getAllMissingIndexes): Use filterBitfield.
|
||||||
|
(countMissingBlock): Use filterBitfield.
|
||||||
|
(countBlock): Use filterBitfield.
|
||||||
|
(setBitInternal): Added new argument on.
|
||||||
|
(setUseBit): Use setBitInternal.
|
||||||
|
(unsetUseBit): Use setBitInternal.
|
||||||
|
(setBit): Use setBitInternal.
|
||||||
|
(unsetBit): Use setBitInternal.
|
||||||
|
(isAllBitSet): Use filterBitfield.
|
||||||
|
(setFilterBit): New function.
|
||||||
|
(addFilter): New function.
|
||||||
|
(enableFilter): New function.
|
||||||
|
(disableFilter): New function.
|
||||||
|
(clearFilter): New function.
|
||||||
|
(isFilterEnabled): New function.
|
||||||
|
(getFilteredTotalLength): New function.
|
||||||
|
(getCompletedLength): New function.
|
||||||
|
|
||||||
|
* src/TorrentMan.h [FileEntry](Constructor): Updated signature.
|
||||||
|
Initalized newly added variables.
|
||||||
|
[FileEntry](offset): New variable.
|
||||||
|
[FileEntry](extracted): New variable.
|
||||||
|
[FileEntry](requested): New variable.
|
||||||
|
(readFileEntry): New function.
|
||||||
|
(option): New variable.
|
||||||
|
(splitMultiFile): Removed const qualifier.
|
||||||
|
(fixFilename): Removed const qualifier.
|
||||||
|
(readFileEntryFromMetaInfoFile): New function.
|
||||||
|
(finishPartialDownloadingMode): New function.
|
||||||
|
(isPartialDownloadingMode): New function.
|
||||||
|
(setFileEntriesToDownload): New function.
|
||||||
|
(getCompletedLength): New function.
|
||||||
|
(getPartialTotalLength): New function.
|
||||||
|
* src/TorrentMan.cc (readFileEntry): New function.
|
||||||
|
(setup): Use readFileEntry. If no-preallocation option is specified,
|
||||||
|
use DefaultDiskWriter.
|
||||||
|
(readFileEntryFromMetaInfoFile): New function.
|
||||||
|
(fixFilename): Removed const qualifier.
|
||||||
|
(splitMultiFile): Removed const qualifier.
|
||||||
|
(setFileEntriesToDownload): New function.
|
||||||
|
(isPartialDownloadingMode): New function.
|
||||||
|
(finishPartialDownloadingMode): New function.
|
||||||
|
(getCompletedLength): New function.
|
||||||
|
(getPartialTotalLength): New function.
|
||||||
|
|
||||||
|
* src/TorrentConsoleDownloadEngine.h (partialDownloadLengthDiff):
|
||||||
|
New variable.
|
||||||
|
(partialTotalLength): New variable.
|
||||||
|
(downloadLength): New variable.
|
||||||
|
(totalLength): New variable.
|
||||||
|
* src/TorrentConsoleDownloadEngine.cc (onPartialDownloadingCompletes):
|
||||||
|
Added log.
|
||||||
|
(initStatistics): Initialized new variables: partialDownloadLengthDiff,
|
||||||
|
partialTotalLength, downloadLength, totalLength.
|
||||||
|
(calculate): Calculate downloadLength and totalLength.
|
||||||
|
|
||||||
|
* src/prefs.h :New definition PREF_NO_PREALLOCATION
|
||||||
|
|
||||||
|
* src/main.cc (addCommand): Changed argument signature.
|
||||||
|
(main): Added new variable: args. Added new option "torrent-show-files"
|
||||||
|
"no-preallocation". Usage is not updated yet.
|
||||||
|
|
||||||
|
2006-04-02 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
||||||
|
|
||||||
|
* src/PeerMessage.cc (setBitfield): Fixed invalid memory de-allocation.
|
||||||
|
|
||||||
2006-04-01 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
2006-04-01 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
||||||
|
|
||||||
Attempt to add the ability to listing file entries in a .torrent file.
|
Attempt to add the ability to listing file entries in a .torrent file.
|
||||||
|
|
2
README
2
README
|
@ -32,7 +32,7 @@ The executable is aria2c in src directory.
|
||||||
4. Dependency
|
4. Dependency
|
||||||
-------------
|
-------------
|
||||||
In order to enable HTTPS support, you need GNU TLS or OpenSSL.
|
In order to enable HTTPS support, you need GNU TLS or OpenSSL.
|
||||||
In order to enable BitTorrent support, you need GNUTLS+GCRYPT or OpenSSL.
|
In order to enable BitTorrent support, you need GNU TLS+libgcrypt or OpenSSL.
|
||||||
|
|
||||||
GNU TLS has precedence over OpenSSL if both libraries are installed.
|
GNU TLS has precedence over OpenSSL if both libraries are installed.
|
||||||
If you prefer OpenSSL, run configure with "--without-gnutls".
|
If you prefer OpenSSL, run configure with "--without-gnutls".
|
||||||
|
|
|
@ -23,7 +23,8 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
BitfieldMan::BitfieldMan(int blockLength, long long int totalLength)
|
BitfieldMan::BitfieldMan(int blockLength, long long int totalLength)
|
||||||
:blockLength(blockLength), totalLength(totalLength) {
|
:blockLength(blockLength), totalLength(totalLength), filterBitfield(0),
|
||||||
|
filterEnabled(false) {
|
||||||
if(blockLength > 0 && totalLength > 0) {
|
if(blockLength > 0 && totalLength > 0) {
|
||||||
blocks = totalLength/blockLength+(totalLength%blockLength ? 1 : 0);
|
blocks = totalLength/blockLength+(totalLength%blockLength ? 1 : 0);
|
||||||
bitfieldLength = blocks/8+(blocks%8 ? 1 : 0);
|
bitfieldLength = blocks/8+(blocks%8 ? 1 : 0);
|
||||||
|
@ -43,11 +44,21 @@ BitfieldMan::BitfieldMan(const BitfieldMan& bitfieldMan) {
|
||||||
useBitfield = new unsigned char[bitfieldLength];
|
useBitfield = new unsigned char[bitfieldLength];
|
||||||
memcpy(bitfield, bitfieldMan.bitfield, bitfieldLength);
|
memcpy(bitfield, bitfieldMan.bitfield, bitfieldLength);
|
||||||
memcpy(useBitfield, bitfieldMan.useBitfield, bitfieldLength);
|
memcpy(useBitfield, bitfieldMan.useBitfield, bitfieldLength);
|
||||||
|
filterEnabled = bitfieldMan.filterEnabled;
|
||||||
|
if(bitfieldMan.filterBitfield) {
|
||||||
|
filterBitfield = new unsigned char[bitfieldLength];
|
||||||
|
memcpy(filterBitfield, bitfieldMan.filterBitfield, bitfieldLength);
|
||||||
|
} else {
|
||||||
|
filterBitfield = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BitfieldMan::~BitfieldMan() {
|
BitfieldMan::~BitfieldMan() {
|
||||||
delete [] bitfield;
|
delete [] bitfield;
|
||||||
delete [] useBitfield;
|
delete [] useBitfield;
|
||||||
|
if(filterBitfield) {
|
||||||
|
delete [] filterBitfield;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BitfieldMan& BitfieldMan::operator=(const BitfieldMan& bitfieldMan) {
|
BitfieldMan& BitfieldMan::operator=(const BitfieldMan& bitfieldMan) {
|
||||||
|
@ -64,6 +75,17 @@ BitfieldMan& BitfieldMan::operator=(const BitfieldMan& bitfieldMan) {
|
||||||
bitfieldLength = bitfieldMan.bitfieldLength;
|
bitfieldLength = bitfieldMan.bitfieldLength;
|
||||||
memcpy(bitfield, bitfieldMan.bitfield, bitfieldLength);
|
memcpy(bitfield, bitfieldMan.bitfield, bitfieldLength);
|
||||||
memcpy(useBitfield, bitfieldMan.useBitfield, bitfieldLength);
|
memcpy(useBitfield, bitfieldMan.useBitfield, bitfieldLength);
|
||||||
|
filterEnabled = bitfieldMan.filterEnabled;
|
||||||
|
if(bitfieldLength != bitfieldMan.bitfieldLength) {
|
||||||
|
delete [] filterBitfield;
|
||||||
|
filterBitfield = 0;
|
||||||
|
}
|
||||||
|
if(bitfieldMan.filterBitfield) {
|
||||||
|
if(!filterBitfield) {
|
||||||
|
filterBitfield = new unsigned char[bitfieldLength];
|
||||||
|
}
|
||||||
|
memcpy(filterBitfield, bitfieldMan.filterBitfield, bitfieldLength);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
@ -108,6 +130,9 @@ int BitfieldMan::getMissingIndex(const unsigned char* peerBitfield, int length)
|
||||||
unsigned char* tempBitfield = new unsigned char[bitfieldLength];
|
unsigned char* tempBitfield = new unsigned char[bitfieldLength];
|
||||||
for(int i = 0; i < bitfieldLength; i++) {
|
for(int i = 0; i < bitfieldLength; i++) {
|
||||||
tempBitfield[i] = peerBitfield[i] & ~bitfield[i];
|
tempBitfield[i] = peerBitfield[i] & ~bitfield[i];
|
||||||
|
if(filterEnabled) {
|
||||||
|
tempBitfield[i] &= filterBitfield[i];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
int max = countSetBit(tempBitfield, bitfieldLength);
|
int max = countSetBit(tempBitfield, bitfieldLength);
|
||||||
int index = getMissingIndexRandomly(tempBitfield, bitfieldLength, max);
|
int index = getMissingIndexRandomly(tempBitfield, bitfieldLength, max);
|
||||||
|
@ -122,6 +147,9 @@ int BitfieldMan::getMissingUnusedIndex(const unsigned char* peerBitfield, int le
|
||||||
unsigned char* tempBitfield = new unsigned char[bitfieldLength];
|
unsigned char* tempBitfield = new unsigned char[bitfieldLength];
|
||||||
for(int i = 0; i < bitfieldLength; i++) {
|
for(int i = 0; i < bitfieldLength; i++) {
|
||||||
tempBitfield[i] = peerBitfield[i] & ~bitfield[i] & ~useBitfield[i];
|
tempBitfield[i] = peerBitfield[i] & ~bitfield[i] & ~useBitfield[i];
|
||||||
|
if(filterEnabled) {
|
||||||
|
tempBitfield[i] &= filterBitfield[i];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
int max = countSetBit(tempBitfield, bitfieldLength);
|
int max = countSetBit(tempBitfield, bitfieldLength);
|
||||||
int index = getMissingIndexRandomly(tempBitfield, bitfieldLength, max);
|
int index = getMissingIndexRandomly(tempBitfield, bitfieldLength, max);
|
||||||
|
@ -135,6 +163,9 @@ int BitfieldMan::getFirstMissingUnusedIndex(const unsigned char* peerBitfield, i
|
||||||
}
|
}
|
||||||
for(int i = 0; i < bitfieldLength; i++) {
|
for(int i = 0; i < bitfieldLength; i++) {
|
||||||
unsigned char bit = peerBitfield[i] & ~bitfield[i] & ~useBitfield[i];
|
unsigned char bit = peerBitfield[i] & ~bitfield[i] & ~useBitfield[i];
|
||||||
|
if(filterEnabled) {
|
||||||
|
bit &= filterBitfield[i];
|
||||||
|
}
|
||||||
for(int bs = 7; bs >= 0 && i*8+7-bs < blocks; bs--) {
|
for(int bs = 7; bs >= 0 && i*8+7-bs < blocks; bs--) {
|
||||||
unsigned char mask = 1 << bs;
|
unsigned char mask = 1 << bs;
|
||||||
if(bit & mask) {
|
if(bit & mask) {
|
||||||
|
@ -148,6 +179,9 @@ int BitfieldMan::getFirstMissingUnusedIndex(const unsigned char* peerBitfield, i
|
||||||
int BitfieldMan::getFirstMissingUnusedIndex() const {
|
int BitfieldMan::getFirstMissingUnusedIndex() const {
|
||||||
for(int i = 0; i < bitfieldLength; i++) {
|
for(int i = 0; i < bitfieldLength; i++) {
|
||||||
unsigned char bit = ~bitfield[i] & ~useBitfield[i];
|
unsigned char bit = ~bitfield[i] & ~useBitfield[i];
|
||||||
|
if(filterEnabled) {
|
||||||
|
bit &= filterBitfield[i];
|
||||||
|
}
|
||||||
for(int bs = 7; bs >= 0 && i*8+7-bs < blocks; bs--) {
|
for(int bs = 7; bs >= 0 && i*8+7-bs < blocks; bs--) {
|
||||||
unsigned char mask = 1 << bs;
|
unsigned char mask = 1 << bs;
|
||||||
if(bit & mask) {
|
if(bit & mask) {
|
||||||
|
@ -162,6 +196,9 @@ BlockIndexes BitfieldMan::getAllMissingIndexes() const {
|
||||||
BlockIndexes missingIndexes;
|
BlockIndexes missingIndexes;
|
||||||
for(int i = 0; i < bitfieldLength; i++) {
|
for(int i = 0; i < bitfieldLength; i++) {
|
||||||
unsigned char bit = ~bitfield[i];
|
unsigned char bit = ~bitfield[i];
|
||||||
|
if(filterEnabled) {
|
||||||
|
bit &= filterBitfield[i];
|
||||||
|
}
|
||||||
for(int bs = 7; bs >= 0 && i*8+7-bs < blocks; bs--) {
|
for(int bs = 7; bs >= 0 && i*8+7-bs < blocks; bs--) {
|
||||||
unsigned char mask = 1 << bs;
|
unsigned char mask = 1 << bs;
|
||||||
if(bit & mask) {
|
if(bit & mask) {
|
||||||
|
@ -173,37 +210,64 @@ BlockIndexes BitfieldMan::getAllMissingIndexes() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
int BitfieldMan::countMissingBlock() const {
|
int BitfieldMan::countMissingBlock() const {
|
||||||
|
if(filterEnabled) {
|
||||||
|
unsigned char* temp = new unsigned char[bitfieldLength];
|
||||||
|
for(int i = 0; i < bitfieldLength; i++) {
|
||||||
|
temp[i] = bitfield[i]&filterBitfield[i];
|
||||||
|
}
|
||||||
|
int count = countSetBit(filterBitfield, bitfieldLength)-
|
||||||
|
countSetBit(temp, bitfieldLength);
|
||||||
|
delete [] temp;
|
||||||
|
return count;
|
||||||
|
} else {
|
||||||
return blocks-countSetBit(bitfield, bitfieldLength);
|
return blocks-countSetBit(bitfield, bitfieldLength);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int BitfieldMan::countBlock() const {
|
||||||
|
if(filterEnabled) {
|
||||||
|
return countSetBit(filterBitfield, bitfieldLength);
|
||||||
|
} else {
|
||||||
|
return blocks;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool BitfieldMan::setBitInternal(unsigned char* bitfield, int index, bool on) {
|
||||||
|
if(blocks <= index) { return false; }
|
||||||
|
unsigned char mask = 128 >> index%8;
|
||||||
|
if(on) {
|
||||||
|
bitfield[index/8] |= mask;
|
||||||
|
} else {
|
||||||
|
bitfield[index/8] &= ~mask;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool BitfieldMan::setUseBit(int index) {
|
bool BitfieldMan::setUseBit(int index) {
|
||||||
if(blocks <= index) { return false; }
|
return setBitInternal(useBitfield, index, true);
|
||||||
unsigned char mask = 128 >> index%8;
|
|
||||||
useBitfield[index/8] |= mask;
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BitfieldMan::unsetUseBit(int index) {
|
bool BitfieldMan::unsetUseBit(int index) {
|
||||||
if(blocks <= index) { return false; }
|
return setBitInternal(useBitfield, index, false);
|
||||||
unsigned char mask = 128 >> index%8;
|
|
||||||
useBitfield[index/8] &= ~mask;
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BitfieldMan::setBit(int index) {
|
bool BitfieldMan::setBit(int index) {
|
||||||
if(blocks <= index) { return false; }
|
return setBitInternal(bitfield, index, true);
|
||||||
unsigned char mask = 128 >> index%8;
|
|
||||||
bitfield[index/8] |= mask;
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BitfieldMan::unsetBit(int index) {
|
bool BitfieldMan::unsetBit(int index) {
|
||||||
if(blocks <= index) { return false; }
|
return setBitInternal(bitfield, index, false);
|
||||||
unsigned char mask = 128 >> index%8;
|
|
||||||
bitfield[index/8] &= ~mask;
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BitfieldMan::isAllBitSet() const {
|
bool BitfieldMan::isAllBitSet() const {
|
||||||
|
if(filterEnabled) {
|
||||||
|
for(int i = 0; i < bitfieldLength-1; i++) {
|
||||||
|
if((bitfield[i]&filterBitfield[i]) != filterBitfield[i]) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
for(int i = 0; i < bitfieldLength-1; i++) {
|
for(int i = 0; i < bitfieldLength-1; i++) {
|
||||||
if(bitfield[i] != 0xff) {
|
if(bitfield[i] != 0xff) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -215,6 +279,7 @@ bool BitfieldMan::isAllBitSet() const {
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool BitfieldMan::isBitSetInternal(const unsigned char* bitfield, int index) const {
|
bool BitfieldMan::isBitSetInternal(const unsigned char* bitfield, int index) const {
|
||||||
if(blocks <= index) { return false; }
|
if(blocks <= index) { return false; }
|
||||||
|
@ -248,3 +313,77 @@ void BitfieldMan::setAllBit() {
|
||||||
setBit(i);
|
setBit(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool BitfieldMan::setFilterBit(int index) {
|
||||||
|
return setBitInternal(filterBitfield, index, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
void BitfieldMan::addFilter(long long int offset, long long int length) {
|
||||||
|
if(!filterBitfield) {
|
||||||
|
filterBitfield = new unsigned char[bitfieldLength];
|
||||||
|
memset(filterBitfield, 0, bitfieldLength);
|
||||||
|
}
|
||||||
|
int startBlock = offset/blockLength;
|
||||||
|
int endBlock = (offset+length-1)/blockLength;
|
||||||
|
for(int i = startBlock; i <= endBlock && i < blocks; i++) {
|
||||||
|
setFilterBit(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void BitfieldMan::enableFilter() {
|
||||||
|
filterEnabled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void BitfieldMan::disableFilter() {
|
||||||
|
filterEnabled = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void BitfieldMan::clearFilter() {
|
||||||
|
if(filterBitfield) {
|
||||||
|
delete [] filterBitfield;
|
||||||
|
filterBitfield = 0;
|
||||||
|
}
|
||||||
|
filterEnabled = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool BitfieldMan::isFilterEnabled() const {
|
||||||
|
return filterEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
long long int BitfieldMan::getFilteredTotalLength() const {
|
||||||
|
if(!filterBitfield) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
int filteredBlocks = countSetBit(filterBitfield, bitfieldLength);
|
||||||
|
if(filteredBlocks == 0) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if(isBitSetInternal(filterBitfield, blocks-1)) {
|
||||||
|
return ((long long int)filteredBlocks-1)*blockLength+getLastBlockLength();
|
||||||
|
} else {
|
||||||
|
return ((long long int)filteredBlocks)*blockLength;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
long long int BitfieldMan::getCompletedLength() const {
|
||||||
|
unsigned char* temp = new unsigned char[bitfieldLength];
|
||||||
|
for(int i = 0; i < bitfieldLength; i++) {
|
||||||
|
temp[i] = bitfield[i];
|
||||||
|
if(filterEnabled) {
|
||||||
|
temp[i] &= filterBitfield[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
int completedBlocks = countSetBit(temp, bitfieldLength);
|
||||||
|
long long int completedLength = 0;
|
||||||
|
if(completedBlocks == 0) {
|
||||||
|
completedLength = 0;
|
||||||
|
} else {
|
||||||
|
if(isBitSetInternal(temp, blocks-1)) {
|
||||||
|
completedLength = ((long long int)completedBlocks-1)*blockLength+getLastBlockLength();
|
||||||
|
} else {
|
||||||
|
completedLength = ((long long int)completedBlocks)*blockLength;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
delete [] temp;
|
||||||
|
return completedLength;
|
||||||
|
}
|
||||||
|
|
|
@ -33,12 +33,15 @@ private:
|
||||||
long long int totalLength;
|
long long int totalLength;
|
||||||
unsigned char* bitfield;
|
unsigned char* bitfield;
|
||||||
unsigned char* useBitfield;
|
unsigned char* useBitfield;
|
||||||
|
unsigned char* filterBitfield;
|
||||||
int bitfieldLength;
|
int bitfieldLength;
|
||||||
int blocks;
|
int blocks;
|
||||||
|
bool filterEnabled;
|
||||||
int countSetBit(const unsigned char* bitfield, int len) const;
|
int countSetBit(const unsigned char* bitfield, int len) const;
|
||||||
int getMissingIndexRandomly(const unsigned char* bitfield, int len, int randMax) const;
|
int getMissingIndexRandomly(const unsigned char* bitfield, int len, int randMax) const;
|
||||||
bool isBitSetInternal(const unsigned char* bitfield, int index) const;
|
bool isBitSetInternal(const unsigned char* bitfield, int index) const;
|
||||||
|
bool setBitInternal(unsigned char* bitfield, int index, bool on);
|
||||||
|
bool setFilterBit(int index);
|
||||||
public:
|
public:
|
||||||
BitfieldMan(int blockLength, long long int totalLength);
|
BitfieldMan(int blockLength, long long int totalLength);
|
||||||
BitfieldMan(const BitfieldMan& bitfieldMan);
|
BitfieldMan(const BitfieldMan& bitfieldMan);
|
||||||
|
@ -61,11 +64,29 @@ public:
|
||||||
}
|
}
|
||||||
long long int getTotalLength() const { return totalLength; }
|
long long int getTotalLength() const { return totalLength; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* affected by filter
|
||||||
|
*/
|
||||||
int getMissingIndex(const unsigned char* bitfield, int len) const;
|
int getMissingIndex(const unsigned char* bitfield, int len) const;
|
||||||
|
/**
|
||||||
|
* affected by filter
|
||||||
|
*/
|
||||||
int getFirstMissingUnusedIndex(const unsigned char* bitfield, int len) const;
|
int getFirstMissingUnusedIndex(const unsigned char* bitfield, int len) const;
|
||||||
|
/**
|
||||||
|
* affected by filter
|
||||||
|
*/
|
||||||
int getFirstMissingUnusedIndex() const;
|
int getFirstMissingUnusedIndex() const;
|
||||||
|
/**
|
||||||
|
* affected by filter
|
||||||
|
*/
|
||||||
int getMissingUnusedIndex(const unsigned char* bitfield, int len) const;
|
int getMissingUnusedIndex(const unsigned char* bitfield, int len) const;
|
||||||
|
/**
|
||||||
|
* affected by filter
|
||||||
|
*/
|
||||||
BlockIndexes getAllMissingIndexes() const;
|
BlockIndexes getAllMissingIndexes() const;
|
||||||
|
/**
|
||||||
|
* affected by filter
|
||||||
|
*/
|
||||||
int countMissingBlock() const;
|
int countMissingBlock() const;
|
||||||
bool setUseBit(int index);
|
bool setUseBit(int index);
|
||||||
bool unsetUseBit(int index);
|
bool unsetUseBit(int index);
|
||||||
|
@ -76,12 +97,18 @@ public:
|
||||||
bool isBitSet(int index) const;
|
bool isBitSet(int index) const;
|
||||||
bool isUseBitSet(int index) const;
|
bool isUseBitSet(int index) const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* affected by filter
|
||||||
|
*/
|
||||||
bool isAllBitSet() const;
|
bool isAllBitSet() const;
|
||||||
|
|
||||||
const unsigned char* getBitfield() const { return bitfield; }
|
const unsigned char* getBitfield() const { return bitfield; }
|
||||||
int getBitfieldLength() const { return bitfieldLength; }
|
int getBitfieldLength() const { return bitfieldLength; }
|
||||||
|
|
||||||
int countBlock() const { return blocks; }
|
/**
|
||||||
|
* affected by filter
|
||||||
|
*/
|
||||||
|
int countBlock() const;
|
||||||
|
|
||||||
void setBitfield(const unsigned char* bitfield, int bitfieldLength);
|
void setBitfield(const unsigned char* bitfield, int bitfieldLength);
|
||||||
|
|
||||||
|
@ -90,6 +117,15 @@ public:
|
||||||
|
|
||||||
void addFilter(long long int offset, long long int length);
|
void addFilter(long long int offset, long long int length);
|
||||||
void clearFilter();
|
void clearFilter();
|
||||||
|
|
||||||
|
void enableFilter();
|
||||||
|
void disableFilter();
|
||||||
|
bool isFilterEnabled() const;
|
||||||
|
long long int getFilteredTotalLength() const;
|
||||||
|
/**
|
||||||
|
* affected by filter
|
||||||
|
*/
|
||||||
|
long long int getCompletedLength() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _D_BITFIELD_MAN_H_
|
#endif // _D_BITFIELD_MAN_H_
|
||||||
|
|
|
@ -50,6 +50,7 @@ PeerInteractionCommand::PeerInteractionCommand(int cuid, Peer* peer,
|
||||||
freqCheckPoint.tv_usec = 0;
|
freqCheckPoint.tv_usec = 0;
|
||||||
chokeUnchokeCount = 0;
|
chokeUnchokeCount = 0;
|
||||||
haveCount = 0;
|
haveCount = 0;
|
||||||
|
keepAliveCount = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
PeerInteractionCommand::~PeerInteractionCommand() {
|
PeerInteractionCommand::~PeerInteractionCommand() {
|
||||||
|
@ -147,11 +148,13 @@ void PeerInteractionCommand::detectMessageFlooding() {
|
||||||
} else {
|
} else {
|
||||||
if(Util::difftv(now, freqCheckPoint) >= 5*1000000) {
|
if(Util::difftv(now, freqCheckPoint) >= 5*1000000) {
|
||||||
if(chokeUnchokeCount*1.0/(Util::difftv(now, freqCheckPoint)/1000000) >= 0.4
|
if(chokeUnchokeCount*1.0/(Util::difftv(now, freqCheckPoint)/1000000) >= 0.4
|
||||||
|| haveCount*1.0/(Util::difftv(now, freqCheckPoint)/1000000) >= 20.0) {
|
|| haveCount*1.0/(Util::difftv(now, freqCheckPoint)/1000000) >= 20.0
|
||||||
|
|| keepAliveCount*1.0/(Util::difftv(now, freqCheckPoint)/1000000) >= 1.0) {
|
||||||
throw new DlAbortEx("flooding detected.");
|
throw new DlAbortEx("flooding detected.");
|
||||||
} else {
|
} else {
|
||||||
chokeUnchokeCount = 0;
|
chokeUnchokeCount = 0;
|
||||||
haveCount = 0;
|
haveCount = 0;
|
||||||
|
keepAliveCount = 0;
|
||||||
freqCheckPoint = now;
|
freqCheckPoint = now;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -220,6 +223,7 @@ void PeerInteractionCommand::receiveMessage() {
|
||||||
try {
|
try {
|
||||||
switch(message->getId()) {
|
switch(message->getId()) {
|
||||||
case PeerMessage::KEEP_ALIVE:
|
case PeerMessage::KEEP_ALIVE:
|
||||||
|
keepAliveCount++;
|
||||||
break;
|
break;
|
||||||
case PeerMessage::CHOKE:
|
case PeerMessage::CHOKE:
|
||||||
if(!peer->peerChoking) {
|
if(!peer->peerChoking) {
|
||||||
|
|
|
@ -41,6 +41,7 @@ private:
|
||||||
struct timeval freqCheckPoint;
|
struct timeval freqCheckPoint;
|
||||||
int chokeUnchokeCount;
|
int chokeUnchokeCount;
|
||||||
int haveCount;
|
int haveCount;
|
||||||
|
int keepAliveCount;
|
||||||
void receiveMessage();
|
void receiveMessage();
|
||||||
void detectMessageFlooding();
|
void detectMessageFlooding();
|
||||||
void checkLongTimePeerChoking();
|
void checkLongTimePeerChoking();
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
void PeerMessage::setBitfield(const unsigned char* bitfield, int bitfieldLength) {
|
void PeerMessage::setBitfield(const unsigned char* bitfield, int bitfieldLength) {
|
||||||
if(this->bitfield != NULL) {
|
if(this->bitfield != NULL) {
|
||||||
delete [] bitfield;
|
delete [] this->bitfield;
|
||||||
}
|
}
|
||||||
this->bitfieldLength = bitfieldLength;
|
this->bitfieldLength = bitfieldLength;
|
||||||
this->bitfield = new unsigned char[this->bitfieldLength];
|
this->bitfield = new unsigned char[this->bitfieldLength];
|
||||||
|
@ -33,7 +33,7 @@ void PeerMessage::setBitfield(const unsigned char* bitfield, int bitfieldLength)
|
||||||
|
|
||||||
void PeerMessage::setBlock(const char* block, int blockLength) {
|
void PeerMessage::setBlock(const char* block, int blockLength) {
|
||||||
if(this->block != NULL) {
|
if(this->block != NULL) {
|
||||||
delete [] block;
|
delete [] this->block;
|
||||||
}
|
}
|
||||||
this->blockLength = blockLength;
|
this->blockLength = blockLength;
|
||||||
this->block = new char[this->blockLength];
|
this->block = new char[this->blockLength];
|
||||||
|
|
|
@ -26,21 +26,26 @@ TorrentConsoleDownloadEngine::TorrentConsoleDownloadEngine() {}
|
||||||
|
|
||||||
TorrentConsoleDownloadEngine::~TorrentConsoleDownloadEngine() {}
|
TorrentConsoleDownloadEngine::~TorrentConsoleDownloadEngine() {}
|
||||||
|
|
||||||
|
void TorrentConsoleDownloadEngine::onPartialDownloadingCompletes() {
|
||||||
|
printf("Download of specified files has completed. Continue normal download operation.\n");
|
||||||
|
}
|
||||||
|
|
||||||
void TorrentConsoleDownloadEngine::printStatistics() {
|
void TorrentConsoleDownloadEngine::printStatistics() {
|
||||||
printf("\r ");
|
printf("\r ");
|
||||||
printf("\r");
|
printf("\r");
|
||||||
if(torrentMan->downloadComplete()) {
|
if(torrentMan->downloadComplete()) {
|
||||||
printf("Download Completed ");
|
printf("Download Completed ");
|
||||||
} else {
|
} else {
|
||||||
printf("%s/%sB %d%% DW:%.2f",
|
printf("%s/%sB %d%% %s D:%.2f",
|
||||||
Util::llitos(torrentMan->getDownloadLength(), true).c_str(),
|
Util::llitos(downloadLength, true).c_str(),
|
||||||
Util::llitos(torrentMan->getTotalLength(), true).c_str(),
|
Util::llitos(totalLength, true).c_str(),
|
||||||
(torrentMan->getTotalLength() == 0 ?
|
(totalLength == 0 ?
|
||||||
0 : (int)((torrentMan->getDownloadLength()*100)/torrentMan->getTotalLength())),
|
0 : (int)((downloadLength*100)/totalLength)),
|
||||||
downloadSpeed/1000.0);
|
avgSpeed == 0 ? "-" : Util::secfmt(eta).c_str(),
|
||||||
|
downloadSpeed/1024.0);
|
||||||
}
|
}
|
||||||
printf(" UP:%.2f(%s) %dpeers",
|
printf(" U:%.2f(%s) %dpeers",
|
||||||
uploadSpeed/1000.0,
|
uploadSpeed/1024.0,
|
||||||
Util::llitos(torrentMan->getUploadLength(), true).c_str(),
|
Util::llitos(torrentMan->getUploadLength(), true).c_str(),
|
||||||
torrentMan->connections);
|
torrentMan->connections);
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
@ -52,11 +57,21 @@ void TorrentConsoleDownloadEngine::initStatistics() {
|
||||||
lastElapsed = 0;
|
lastElapsed = 0;
|
||||||
gettimeofday(&cp[0], NULL);
|
gettimeofday(&cp[0], NULL);
|
||||||
gettimeofday(&cp[1], NULL);
|
gettimeofday(&cp[1], NULL);
|
||||||
|
gettimeofday(&startup, NULL);
|
||||||
sessionDownloadLengthArray[0] = 0;
|
sessionDownloadLengthArray[0] = 0;
|
||||||
sessionDownloadLengthArray[1] = 0;
|
sessionDownloadLengthArray[1] = 0;
|
||||||
sessionUploadLengthArray[0] = 0;
|
sessionUploadLengthArray[0] = 0;
|
||||||
sessionUploadLengthArray[1] = 0;
|
sessionUploadLengthArray[1] = 0;
|
||||||
currentCp = 0;
|
currentCp = 0;
|
||||||
|
eta = 0;
|
||||||
|
avgSpeed = 0;
|
||||||
|
sessionDownloadLength = 0;
|
||||||
|
downloadLength = 0;
|
||||||
|
totalLength = 0;
|
||||||
|
if(torrentMan->isPartialDownloadingMode()) {
|
||||||
|
partialDownloadLengthDiff = torrentMan->getDownloadLength()-torrentMan->getCompletedLength();
|
||||||
|
partialTotalLength = torrentMan->getPartialTotalLength();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int TorrentConsoleDownloadEngine::calculateSpeed(long long int sessionLength, long long int elapsed) {
|
int TorrentConsoleDownloadEngine::calculateSpeed(long long int sessionLength, long long int elapsed) {
|
||||||
|
@ -74,12 +89,28 @@ void TorrentConsoleDownloadEngine::calculateStatistics() {
|
||||||
sessionDownloadLengthArray[1] += torrentMan->getDeltaDownloadLength();
|
sessionDownloadLengthArray[1] += torrentMan->getDeltaDownloadLength();
|
||||||
sessionUploadLengthArray[1] += torrentMan->getDeltaUploadLength();
|
sessionUploadLengthArray[1] += torrentMan->getDeltaUploadLength();
|
||||||
|
|
||||||
|
sessionDownloadLength += torrentMan->getDeltaDownloadLength();
|
||||||
|
|
||||||
downloadSpeed = calculateSpeed(sessionDownloadLengthArray[currentCp], elapsed);
|
downloadSpeed = calculateSpeed(sessionDownloadLengthArray[currentCp], elapsed);
|
||||||
uploadSpeed = calculateSpeed(sessionUploadLengthArray[currentCp], elapsed);
|
uploadSpeed = calculateSpeed(sessionUploadLengthArray[currentCp], elapsed);
|
||||||
|
|
||||||
torrentMan->resetDeltaDownloadLength();
|
torrentMan->resetDeltaDownloadLength();
|
||||||
torrentMan->resetDeltaUploadLength();
|
torrentMan->resetDeltaUploadLength();
|
||||||
|
|
||||||
|
if(torrentMan->isPartialDownloadingMode()) {
|
||||||
|
downloadLength = torrentMan->getDownloadLength()-partialDownloadLengthDiff;
|
||||||
|
totalLength = partialTotalLength;
|
||||||
|
} else {
|
||||||
|
downloadLength = torrentMan->getDownloadLength();
|
||||||
|
totalLength = torrentMan->getTotalLength();
|
||||||
|
}
|
||||||
|
|
||||||
|
avgSpeed = calculateSpeed(sessionDownloadLength,
|
||||||
|
Util::difftv(now, startup));
|
||||||
|
if(avgSpeed != 0) {
|
||||||
|
eta = (totalLength-downloadLength)/avgSpeed;
|
||||||
|
}
|
||||||
|
|
||||||
if(elapsed-lastElapsed >= 1000000) {
|
if(elapsed-lastElapsed >= 1000000) {
|
||||||
printStatistics();
|
printStatistics();
|
||||||
lastElapsed = elapsed;
|
lastElapsed = elapsed;
|
||||||
|
|
|
@ -39,11 +39,21 @@ private:
|
||||||
int downloadSpeed;
|
int downloadSpeed;
|
||||||
int uploadSpeed;
|
int uploadSpeed;
|
||||||
long long int lastElapsed;
|
long long int lastElapsed;
|
||||||
|
long long int partialDownloadLengthDiff;
|
||||||
|
long long int partialTotalLength;
|
||||||
|
struct timeval startup;
|
||||||
|
long long int sessionDownloadLength;
|
||||||
|
int avgSpeed;
|
||||||
|
int eta;
|
||||||
|
long long int downloadLength;
|
||||||
|
long long int totalLength;
|
||||||
|
|
||||||
void printStatistics();
|
void printStatistics();
|
||||||
int calculateSpeed(long long int sessionLength, long long int elapsed);
|
int calculateSpeed(long long int sessionLength, long long int elapsed);
|
||||||
protected:
|
protected:
|
||||||
void initStatistics();
|
void initStatistics();
|
||||||
void calculateStatistics();
|
void calculateStatistics();
|
||||||
|
void onPartialDownloadingCompletes();
|
||||||
public:
|
public:
|
||||||
TorrentConsoleDownloadEngine();
|
TorrentConsoleDownloadEngine();
|
||||||
~TorrentConsoleDownloadEngine();
|
~TorrentConsoleDownloadEngine();
|
||||||
|
|
|
@ -35,7 +35,15 @@ void TorrentDownloadEngine::afterEachIteration() {
|
||||||
torrentMan->diskWriter->closeFile();
|
torrentMan->diskWriter->closeFile();
|
||||||
torrentMan->save();
|
torrentMan->save();
|
||||||
torrentMan->fixFilename();
|
torrentMan->fixFilename();
|
||||||
|
if(torrentMan->isPartialDownloadingMode()) {
|
||||||
|
torrentMan->finishPartialDownloadingMode();
|
||||||
|
onPartialDownloadingCompletes();
|
||||||
|
if(torrentMan->downloadComplete()) {
|
||||||
filenameFixed = true;
|
filenameFixed = true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
filenameFixed = true;
|
||||||
|
}
|
||||||
torrentMan->diskWriter->openExistingFile(torrentMan->getTempFilePath());
|
torrentMan->diskWriter->openExistingFile(torrentMan->getTempFilePath());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,6 +31,7 @@ private:
|
||||||
protected:
|
protected:
|
||||||
void onEndOfRun();
|
void onEndOfRun();
|
||||||
void afterEachIteration();
|
void afterEachIteration();
|
||||||
|
virtual void onPartialDownloadingCompletes() = 0;
|
||||||
public:
|
public:
|
||||||
TorrentDownloadEngine():filenameFixed(false) {}
|
TorrentDownloadEngine():filenameFixed(false) {}
|
||||||
virtual ~TorrentDownloadEngine() {}
|
virtual ~TorrentDownloadEngine() {}
|
||||||
|
|
|
@ -29,6 +29,8 @@
|
||||||
#include "File.h"
|
#include "File.h"
|
||||||
#include "message.h"
|
#include "message.h"
|
||||||
#include "PreAllocationDiskWriter.h"
|
#include "PreAllocationDiskWriter.h"
|
||||||
|
#include "DefaultDiskWriter.h"
|
||||||
|
#include "prefs.h"
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <libgen.h>
|
#include <libgen.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -295,28 +297,12 @@ bool TorrentMan::downloadComplete() const {
|
||||||
return bitfield->isAllBitSet();
|
return bitfield->isAllBitSet();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TorrentMan::setup(string metaInfoFile) {
|
void TorrentMan::readFileEntry(const Dictionary* infoDic, const string& defaultName) {
|
||||||
peerId = "-A2****-";
|
|
||||||
for(int i = 0; i < 12; i++) {
|
|
||||||
peerId += Util::itos((int)(((double)10)*random()/(RAND_MAX+1.0)));
|
|
||||||
}
|
|
||||||
|
|
||||||
uploadLength = 0;
|
|
||||||
downloadLength = 0;
|
|
||||||
Dictionary* topDic = (Dictionary*)MetaFileUtil::parseMetaFile(metaInfoFile);
|
|
||||||
const Dictionary* infoDic = (const Dictionary*)topDic->get("info");
|
|
||||||
ShaVisitor v;
|
|
||||||
infoDic->accept(&v);
|
|
||||||
unsigned char md[20];
|
|
||||||
int len;
|
|
||||||
v.getHash(md, len);
|
|
||||||
setInfoHash(md);
|
|
||||||
|
|
||||||
Data* topName = (Data*)infoDic->get("name");
|
Data* topName = (Data*)infoDic->get("name");
|
||||||
if(topName != NULL) {
|
if(topName != NULL) {
|
||||||
name = topName->toString();
|
name = topName->toString();
|
||||||
} else {
|
} else {
|
||||||
char* basec = strdup(metaInfoFile.c_str());
|
char* basec = strdup(defaultName.c_str());
|
||||||
name = string(basename(basec))+".file";
|
name = string(basename(basec))+".file";
|
||||||
free(basec);
|
free(basec);
|
||||||
}
|
}
|
||||||
|
@ -328,6 +314,7 @@ void TorrentMan::setup(string metaInfoFile) {
|
||||||
totalLength = length->toLLInt();
|
totalLength = length->toLLInt();
|
||||||
} else {
|
} else {
|
||||||
long long int length = 0;
|
long long int length = 0;
|
||||||
|
long long int offset = 0;
|
||||||
// multi-file mode
|
// multi-file mode
|
||||||
setFileMode(MULTI);
|
setFileMode(MULTI);
|
||||||
multiFileTopDir = new Directory(name);
|
multiFileTopDir = new Directory(name);
|
||||||
|
@ -350,11 +337,33 @@ void TorrentMan::setup(string metaInfoFile) {
|
||||||
}
|
}
|
||||||
Data* lastpath = (Data*)paths.back();
|
Data* lastpath = (Data*)paths.back();
|
||||||
filePath.append("/").append(lastpath->toString());
|
filePath.append("/").append(lastpath->toString());
|
||||||
FileEntry fileEntry(filePath, lengthData->toLLInt());
|
FileEntry fileEntry(filePath, lengthData->toLLInt(), offset);
|
||||||
multiFileEntries.push_back(fileEntry);
|
multiFileEntries.push_back(fileEntry);
|
||||||
|
offset += fileEntry.length;
|
||||||
}
|
}
|
||||||
totalLength = length;
|
totalLength = length;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void TorrentMan::setup(string metaInfoFile) {
|
||||||
|
peerId = "-A2****-";
|
||||||
|
for(int i = 0; i < 12; i++) {
|
||||||
|
peerId += Util::itos((int)(((double)10)*random()/(RAND_MAX+1.0)));
|
||||||
|
}
|
||||||
|
|
||||||
|
uploadLength = 0;
|
||||||
|
downloadLength = 0;
|
||||||
|
Dictionary* topDic = (Dictionary*)MetaFileUtil::parseMetaFile(metaInfoFile);
|
||||||
|
const Dictionary* infoDic = (const Dictionary*)topDic->get("info");
|
||||||
|
ShaVisitor v;
|
||||||
|
infoDic->accept(&v);
|
||||||
|
unsigned char md[20];
|
||||||
|
int len;
|
||||||
|
v.getHash(md, len);
|
||||||
|
setInfoHash(md);
|
||||||
|
|
||||||
|
readFileEntry(infoDic, metaInfoFile);
|
||||||
|
|
||||||
announce = ((Data*)topDic->get("announce"))->toString();
|
announce = ((Data*)topDic->get("announce"))->toString();
|
||||||
pieceLength = ((Data*)infoDic->get("piece length"))->toInt();
|
pieceLength = ((Data*)infoDic->get("piece length"))->toInt();
|
||||||
pieces = totalLength/pieceLength+(totalLength%pieceLength ? 1 : 0);
|
pieces = totalLength/pieceLength+(totalLength%pieceLength ? 1 : 0);
|
||||||
|
@ -371,7 +380,11 @@ void TorrentMan::setup(string metaInfoFile) {
|
||||||
initBitfield();
|
initBitfield();
|
||||||
delete topDic;
|
delete topDic;
|
||||||
|
|
||||||
|
if(option->get(PREF_NO_PREALLOCATION) == V_TRUE) {
|
||||||
|
diskWriter = new DefaultDiskWriter();
|
||||||
|
} else {
|
||||||
diskWriter = new PreAllocationDiskWriter(totalLength);
|
diskWriter = new PreAllocationDiskWriter(totalLength);
|
||||||
|
}
|
||||||
if(segmentFileExists()) {
|
if(segmentFileExists()) {
|
||||||
load();
|
load();
|
||||||
diskWriter->openExistingFile(getTempFilePath());
|
diskWriter->openExistingFile(getTempFilePath());
|
||||||
|
@ -385,6 +398,12 @@ const MultiFileEntries& TorrentMan::getMultiFileEntries() const {
|
||||||
return multiFileEntries;
|
return multiFileEntries;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TorrentMan::readFileEntryFromMetaInfoFile(const string& metaInfoFile) {
|
||||||
|
Dictionary* topDic = (Dictionary*)MetaFileUtil::parseMetaFile(metaInfoFile);
|
||||||
|
const Dictionary* infoDic = (const Dictionary*)topDic->get("info");
|
||||||
|
readFileEntry(infoDic, metaInfoFile);
|
||||||
|
}
|
||||||
|
|
||||||
string TorrentMan::getName() const {
|
string TorrentMan::getName() const {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
@ -498,7 +517,7 @@ void TorrentMan::remove() const {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TorrentMan::fixFilename() const {
|
void TorrentMan::fixFilename() {
|
||||||
if(fileMode == SINGLE) {
|
if(fileMode == SINGLE) {
|
||||||
copySingleFile();
|
copySingleFile();
|
||||||
} else {
|
} else {
|
||||||
|
@ -511,15 +530,18 @@ void TorrentMan::copySingleFile() const {
|
||||||
Util::fileCopy(getFilePath(), getTempFilePath());
|
Util::fileCopy(getFilePath(), getTempFilePath());
|
||||||
}
|
}
|
||||||
|
|
||||||
void TorrentMan::splitMultiFile() const {
|
void TorrentMan::splitMultiFile() {
|
||||||
logger->info("creating directories");
|
logger->info("creating directories");
|
||||||
multiFileTopDir->createDir(storeDir, true);
|
multiFileTopDir->createDir(storeDir, true);
|
||||||
long long int offset = 0;
|
long long int offset = 0;
|
||||||
for(MultiFileEntries::const_iterator itr = multiFileEntries.begin();
|
for(MultiFileEntries::iterator itr = multiFileEntries.begin();
|
||||||
itr != multiFileEntries.end(); itr++) {
|
itr != multiFileEntries.end(); itr++) {
|
||||||
|
if(!itr->extracted && itr->requested) {
|
||||||
string dest = storeDir+"/"+itr->path;
|
string dest = storeDir+"/"+itr->path;
|
||||||
logger->info("writing file %s", dest.c_str());
|
logger->info("writing file %s", dest.c_str());
|
||||||
Util::rangedFileCopy(dest, getTempFilePath(), offset, itr->length);
|
Util::rangedFileCopy(dest, getTempFilePath(), offset, itr->length);
|
||||||
|
itr->extracted = true;
|
||||||
|
}
|
||||||
offset += itr->length;
|
offset += itr->length;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -527,3 +549,59 @@ void TorrentMan::splitMultiFile() const {
|
||||||
void TorrentMan::deleteTempFile() const {
|
void TorrentMan::deleteTempFile() const {
|
||||||
unlink(getTempFilePath().c_str());
|
unlink(getTempFilePath().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// bool TorrentMan::unextractedFileEntryExists() const {
|
||||||
|
// if(fileMode == SINGLE) {
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
// for(MultiFileEntries::const_iterator itr = multiFileEntries.begin();
|
||||||
|
// itr != multiFileEntries.end(); itr++) {
|
||||||
|
// if(!itr->extracted) {
|
||||||
|
// return true;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
void TorrentMan::setFileEntriesToDownload(const Strings& filePaths) {
|
||||||
|
if(fileMode != MULTI) {
|
||||||
|
throw new DlAbortEx("only multi-mode supports partial downloading mode.");
|
||||||
|
}
|
||||||
|
// clear all requested flags in multiFileEntries.
|
||||||
|
for(MultiFileEntries::iterator itr = multiFileEntries.begin();
|
||||||
|
itr != multiFileEntries.end(); itr++) {
|
||||||
|
itr->requested = false;
|
||||||
|
}
|
||||||
|
for(Strings::const_iterator pitr = filePaths.begin();
|
||||||
|
pitr != filePaths.end(); pitr++) {
|
||||||
|
bool found = false;
|
||||||
|
for(MultiFileEntries::iterator itr = multiFileEntries.begin();
|
||||||
|
itr != multiFileEntries.end(); itr++) {
|
||||||
|
if(*pitr == itr->path) {
|
||||||
|
itr->requested = true;
|
||||||
|
found = true;
|
||||||
|
bitfield->addFilter(itr->offset, itr->length);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!found) {
|
||||||
|
throw new DlAbortEx("no such file entry <%s>", (*pitr).c_str());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
bitfield->enableFilter();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TorrentMan::isPartialDownloadingMode() const {
|
||||||
|
return bitfield->isFilterEnabled();
|
||||||
|
}
|
||||||
|
|
||||||
|
void TorrentMan::finishPartialDownloadingMode() {
|
||||||
|
bitfield->clearFilter();
|
||||||
|
}
|
||||||
|
|
||||||
|
long long int TorrentMan::getCompletedLength() const {
|
||||||
|
return bitfield->getCompletedLength();
|
||||||
|
}
|
||||||
|
|
||||||
|
long long int TorrentMan::getPartialTotalLength() const {
|
||||||
|
return bitfield->getFilteredTotalLength();
|
||||||
|
}
|
||||||
|
|
|
@ -29,6 +29,8 @@
|
||||||
#include "DiskWriter.h"
|
#include "DiskWriter.h"
|
||||||
#include "Piece.h"
|
#include "Piece.h"
|
||||||
#include "Directory.h"
|
#include "Directory.h"
|
||||||
|
#include "Dictionary.h"
|
||||||
|
#include "Option.h"
|
||||||
#include <deque>
|
#include <deque>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
@ -48,7 +50,12 @@ class FileEntry {
|
||||||
public:
|
public:
|
||||||
string path;
|
string path;
|
||||||
long long int length;
|
long long int length;
|
||||||
FileEntry(string path, long long int length):path(path), length(length) {}
|
long long int offset;
|
||||||
|
bool extracted;
|
||||||
|
bool requested;
|
||||||
|
FileEntry(string path, long long int length, long long int offset):
|
||||||
|
path(path), length(length), offset(offset),
|
||||||
|
extracted(false), requested(true) {}
|
||||||
~FileEntry() {}
|
~FileEntry() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -90,6 +97,7 @@ private:
|
||||||
void deleteUsedPiece(const Piece& piece);
|
void deleteUsedPiece(const Piece& piece);
|
||||||
int deleteUsedPiecesByFillRate(int fillRate, int toDelete);
|
int deleteUsedPiecesByFillRate(int fillRate, int toDelete);
|
||||||
void reduceUsedPieces(int max);
|
void reduceUsedPieces(int max);
|
||||||
|
void readFileEntry(const Dictionary* infoDic, const string& defaultName);
|
||||||
public:
|
public:
|
||||||
int pieceLength;
|
int pieceLength;
|
||||||
int pieces;
|
int pieces;
|
||||||
|
@ -108,6 +116,7 @@ public:
|
||||||
|
|
||||||
const Logger* logger;
|
const Logger* logger;
|
||||||
DiskWriter* diskWriter;
|
DiskWriter* diskWriter;
|
||||||
|
const Option* option;
|
||||||
|
|
||||||
int getNewCuid() { return ++cuidCounter; }
|
int getNewCuid() { return ++cuidCounter; }
|
||||||
|
|
||||||
|
@ -213,8 +222,8 @@ public:
|
||||||
void remove() const;
|
void remove() const;
|
||||||
|
|
||||||
void copySingleFile() const;
|
void copySingleFile() const;
|
||||||
void splitMultiFile() const;
|
void splitMultiFile();
|
||||||
void fixFilename() const;
|
void fixFilename();
|
||||||
void deleteTempFile() const;
|
void deleteTempFile() const;
|
||||||
|
|
||||||
void setPort(int port) { this->port = port; }
|
void setPort(int port) { this->port = port; }
|
||||||
|
@ -223,9 +232,20 @@ public:
|
||||||
int countUsedPiece() const { return usedPieces.size(); }
|
int countUsedPiece() const { return usedPieces.size(); }
|
||||||
int countAdvertisedPiece() const { return haves.size(); }
|
int countAdvertisedPiece() const { return haves.size(); }
|
||||||
|
|
||||||
|
void readFileEntryFromMetaInfoFile(const string& metaInfoFile);
|
||||||
const MultiFileEntries& getMultiFileEntries() const;
|
const MultiFileEntries& getMultiFileEntries() const;
|
||||||
string getName() const;
|
string getName() const;
|
||||||
|
|
||||||
|
//bool unextractedFileEntryExists() const;
|
||||||
|
|
||||||
|
void finishPartialDownloadingMode();
|
||||||
|
bool isPartialDownloadingMode() const;
|
||||||
|
|
||||||
|
void setFileEntriesToDownload(const Strings& filePaths);
|
||||||
|
|
||||||
|
long long int getCompletedLength() const;
|
||||||
|
long long int getPartialTotalLength() const;
|
||||||
|
|
||||||
enum FILE_MODE {
|
enum FILE_MODE {
|
||||||
SINGLE,
|
SINGLE,
|
||||||
MULTI
|
MULTI
|
||||||
|
|
21
src/Util.cc
21
src/Util.cc
|
@ -258,3 +258,24 @@ bool Util::isPowerOf(int num, int base) {
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string Util::secfmt(int sec) {
|
||||||
|
string str;
|
||||||
|
if(sec >= 3600) {
|
||||||
|
str = itos(sec/3600)+"h";
|
||||||
|
sec %= 3600;
|
||||||
|
}
|
||||||
|
if(sec >= 60) {
|
||||||
|
int min = sec/60;
|
||||||
|
if(min < 10) {
|
||||||
|
str += "0";
|
||||||
|
}
|
||||||
|
str += itos(min)+"m";
|
||||||
|
sec %= 60;
|
||||||
|
}
|
||||||
|
if(sec < 10) {
|
||||||
|
str += "0";
|
||||||
|
}
|
||||||
|
str += itos(sec)+"s";
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
|
@ -68,6 +68,8 @@ public:
|
||||||
static void rangedFileCopy(const string& destFile, const string& src, long long int srcOffset, long long int length);
|
static void rangedFileCopy(const string& destFile, const string& src, long long int srcOffset, long long int length);
|
||||||
|
|
||||||
static bool isPowerOf(int num, int base);
|
static bool isPowerOf(int num, int base);
|
||||||
|
|
||||||
|
static string secfmt(int sec);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _D_UTIL_H_
|
#endif // _D_UTIL_H_
|
||||||
|
|
44
src/main.cc
44
src/main.cc
|
@ -99,7 +99,7 @@ void torrentHandler(int signal) {
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void addCommand(int cuid, const char* url, string referer, Requests& requests) {
|
void addCommand(int cuid, const string& url, string referer, Requests& requests) {
|
||||||
Request* req = new Request();
|
Request* req = new Request();
|
||||||
req->setReferer(referer);
|
req->setReferer(referer);
|
||||||
if(req->setUrl(url)) {
|
if(req->setUrl(url)) {
|
||||||
|
@ -232,6 +232,7 @@ int main(int argc, char* argv[]) {
|
||||||
bool daemonMode = false;
|
bool daemonMode = false;
|
||||||
string referer;
|
string referer;
|
||||||
string torrentFile;
|
string torrentFile;
|
||||||
|
Strings args;
|
||||||
#ifdef ENABLE_BITTORRENT
|
#ifdef ENABLE_BITTORRENT
|
||||||
bool followTorrent = true;
|
bool followTorrent = true;
|
||||||
#else
|
#else
|
||||||
|
@ -281,6 +282,8 @@ int main(int argc, char* argv[]) {
|
||||||
#ifdef ENABLE_BITTORRENT
|
#ifdef ENABLE_BITTORRENT
|
||||||
{ "torrent-file", required_argument, &lopt, 15 },
|
{ "torrent-file", required_argument, &lopt, 15 },
|
||||||
{ "follow-torrent", required_argument, &lopt, 16 },
|
{ "follow-torrent", required_argument, &lopt, 16 },
|
||||||
|
{ "torrent-show-files", no_argument, &lopt, 17 },
|
||||||
|
{ "no-preallocation", no_argument, &lopt, 18 },
|
||||||
#endif // ENABLE_BITTORRENT
|
#endif // ENABLE_BITTORRENT
|
||||||
{ "version", no_argument, NULL, 'v' },
|
{ "version", no_argument, NULL, 'v' },
|
||||||
{ "help", no_argument, NULL, 'h' },
|
{ "help", no_argument, NULL, 'h' },
|
||||||
|
@ -407,6 +410,13 @@ int main(int argc, char* argv[]) {
|
||||||
showUsage();
|
showUsage();
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
case 17:
|
||||||
|
op->put(PREF_TORRENT_SHOW_FILES, V_TRUE);
|
||||||
|
break;
|
||||||
|
case 18:
|
||||||
|
op->put(PREF_NO_PREALLOCATION, V_TRUE);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -482,6 +492,11 @@ int main(int argc, char* argv[]) {
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for(int i = 1; optind+i-1 < argc; i++) {
|
||||||
|
args.push_back(argv[optind+i-1]);
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef HAVE_LIBSSL
|
#ifdef HAVE_LIBSSL
|
||||||
// for SSL initialization
|
// for SSL initialization
|
||||||
SSL_load_error_strings();
|
SSL_load_error_strings();
|
||||||
|
@ -530,11 +545,14 @@ int main(int argc, char* argv[]) {
|
||||||
e->segmentMan->splitter = splitter;
|
e->segmentMan->splitter = splitter;
|
||||||
|
|
||||||
Requests requests;
|
Requests requests;
|
||||||
for(int i = 1; optind+i-1 < argc; i++) {
|
int cuidCounter = 1;
|
||||||
|
for(Strings::const_iterator itr = args.begin(); itr != args.end(); itr++) {
|
||||||
for(int s = 1; s <= split; s++) {
|
for(int s = 1; s <= split; s++) {
|
||||||
addCommand(split*(i-1)+s, argv[optind+i-1], referer, requests);
|
addCommand(cuidCounter, *itr, referer, requests);
|
||||||
|
cuidCounter++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
e->run();
|
e->run();
|
||||||
|
|
||||||
if(e->segmentMan->finished()) {
|
if(e->segmentMan->finished()) {
|
||||||
|
@ -575,26 +593,34 @@ int main(int argc, char* argv[]) {
|
||||||
te->torrentMan = new TorrentMan();
|
te->torrentMan = new TorrentMan();
|
||||||
te->torrentMan->setStoreDir(dir);
|
te->torrentMan->setStoreDir(dir);
|
||||||
te->torrentMan->logger = logger;
|
te->torrentMan->logger = logger;
|
||||||
te->torrentMan->setup(torrentFile.empty() ?
|
te->torrentMan->option = op;
|
||||||
downloadedTorrentFile : torrentFile);
|
string targetTorrentFile = torrentFile.empty() ?
|
||||||
|
downloadedTorrentFile : torrentFile;
|
||||||
if(op->get(PREF_TORRENT_SHOW_FILES) == V_TRUE) {
|
if(op->get(PREF_TORRENT_SHOW_FILES) == V_TRUE) {
|
||||||
cout << "File listing:" << endl;
|
te->torrentMan->readFileEntryFromMetaInfoFile(targetTorrentFile);
|
||||||
|
cout << "Files:" << endl;
|
||||||
switch(te->torrentMan->getFileMode()) {
|
switch(te->torrentMan->getFileMode()) {
|
||||||
case TorrentMan::SINGLE:
|
case TorrentMan::SINGLE:
|
||||||
printf("%s %s\nBytes", te->torrentMan->getName().c_str(),
|
printf("%s %s Bytes\n", te->torrentMan->getName().c_str(),
|
||||||
Util::llitos(te->torrentMan->getTotalLength(), true).c_str());
|
Util::llitos(te->torrentMan->getTotalLength(), true).c_str());
|
||||||
break;
|
break;
|
||||||
case TorrentMan::MULTI: {
|
case TorrentMan::MULTI: {
|
||||||
const MultiFileEntries& entries = te->torrentMan->getMultiFileEntries();
|
const MultiFileEntries& entries = te->torrentMan->getMultiFileEntries();
|
||||||
for(MultiFileEntries::const_iterator itr = entries.begin();
|
for(MultiFileEntries::const_iterator itr = entries.begin();
|
||||||
itr != entries.end(); itr++) {
|
itr != entries.end(); itr++) {
|
||||||
printf("%s %s\nBytes", itr->path.c_str(),
|
printf("%s %s Bytes\n", itr->path.c_str(),
|
||||||
Util::llitos(itr->length, true).c_str());
|
Util::llitos(itr->length, true).c_str());
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
exit(0);
|
exit(0);
|
||||||
|
} else {
|
||||||
|
te->torrentMan->setup(targetTorrentFile);
|
||||||
|
if(!torrentFile.empty() && !args.empty() &&
|
||||||
|
te->torrentMan->getFileMode() == TorrentMan::MULTI) {
|
||||||
|
te->torrentMan->setFileEntriesToDownload(args);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
PeerListenCommand* listenCommand =
|
PeerListenCommand* listenCommand =
|
||||||
new PeerListenCommand(te->torrentMan->getNewCuid(), te);
|
new PeerListenCommand(te->torrentMan->getNewCuid(), te);
|
||||||
|
|
|
@ -90,5 +90,6 @@
|
||||||
#define PREF_PEER_CONNECTION_TIMEOUT "peer_connection_timeout"
|
#define PREF_PEER_CONNECTION_TIMEOUT "peer_connection_timeout"
|
||||||
// values: true | false
|
// values: true | false
|
||||||
#define PREF_TORRENT_SHOW_FILES "torrent_show_files"
|
#define PREF_TORRENT_SHOW_FILES "torrent_show_files"
|
||||||
|
// values: true | false
|
||||||
|
#define PREF_NO_PREALLOCATION "no_preallocation"
|
||||||
#endif // _D_PREFS_H_
|
#endif // _D_PREFS_H_
|
||||||
|
|
|
@ -10,6 +10,7 @@ class BitfieldManTest:public CppUnit::TestFixture {
|
||||||
CPPUNIT_TEST(testGetBlockSize);
|
CPPUNIT_TEST(testGetBlockSize);
|
||||||
CPPUNIT_TEST(testGetFirstMissingUnusedIndex);
|
CPPUNIT_TEST(testGetFirstMissingUnusedIndex);
|
||||||
CPPUNIT_TEST(testIsAllBitSet);
|
CPPUNIT_TEST(testIsAllBitSet);
|
||||||
|
CPPUNIT_TEST(testFilter);
|
||||||
CPPUNIT_TEST_SUITE_END();
|
CPPUNIT_TEST_SUITE_END();
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@ -20,6 +21,7 @@ public:
|
||||||
void testGetBlockSize();
|
void testGetBlockSize();
|
||||||
void testGetFirstMissingUnusedIndex();
|
void testGetFirstMissingUnusedIndex();
|
||||||
void testIsAllBitSet();
|
void testIsAllBitSet();
|
||||||
|
void testFilter();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -27,12 +29,12 @@ CPPUNIT_TEST_SUITE_REGISTRATION( BitfieldManTest );
|
||||||
|
|
||||||
void BitfieldManTest::testGetBlockSize() {
|
void BitfieldManTest::testGetBlockSize() {
|
||||||
BitfieldMan bt1(1024, 1024*10);
|
BitfieldMan bt1(1024, 1024*10);
|
||||||
CPPUNIT_ASSERT_EQUAL(1024, bt1.getBlockSize(9));
|
CPPUNIT_ASSERT_EQUAL(1024, bt1.getBlockLength(9));
|
||||||
|
|
||||||
BitfieldMan bt2(1024, 1024*10+1);
|
BitfieldMan bt2(1024, 1024*10+1);
|
||||||
CPPUNIT_ASSERT_EQUAL(1024, bt2.getBlockSize(9));
|
CPPUNIT_ASSERT_EQUAL(1024, bt2.getBlockLength(9));
|
||||||
CPPUNIT_ASSERT_EQUAL(1, bt2.getBlockSize(10));
|
CPPUNIT_ASSERT_EQUAL(1, bt2.getBlockLength(10));
|
||||||
CPPUNIT_ASSERT_EQUAL(0, bt2.getBlockSize(11));
|
CPPUNIT_ASSERT_EQUAL(0, bt2.getBlockLength(11));
|
||||||
}
|
}
|
||||||
|
|
||||||
void BitfieldManTest::testGetFirstMissingUnusedIndex() {
|
void BitfieldManTest::testGetFirstMissingUnusedIndex() {
|
||||||
|
@ -69,8 +71,68 @@ void BitfieldManTest::testIsAllBitSet() {
|
||||||
}
|
}
|
||||||
CPPUNIT_ASSERT(!bt1.isAllBitSet());
|
CPPUNIT_ASSERT(!bt1.isAllBitSet());
|
||||||
|
|
||||||
for(int i = 0; i < bt1.getBlocks(); i++) {
|
for(int i = 0; i < bt1.countBlock(); i++) {
|
||||||
CPPUNIT_ASSERT(bt1.setBit(i));
|
CPPUNIT_ASSERT(bt1.setBit(i));
|
||||||
}
|
}
|
||||||
CPPUNIT_ASSERT(bt1.isAllBitSet());
|
CPPUNIT_ASSERT(bt1.isAllBitSet());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BitfieldManTest::testFilter() {
|
||||||
|
// set random seed here in order to get same random numbers.
|
||||||
|
srandom(100);
|
||||||
|
BitfieldMan btman(2, 32);
|
||||||
|
|
||||||
|
// test offset=4, length=12
|
||||||
|
btman.addFilter(4, 12);
|
||||||
|
btman.enableFilter();
|
||||||
|
unsigned char peerBt[2];
|
||||||
|
memset(peerBt, 0xff, sizeof(peerBt));
|
||||||
|
|
||||||
|
int index;
|
||||||
|
index = btman.getMissingUnusedIndex(peerBt, sizeof(peerBt));
|
||||||
|
btman.setUseBit(index);
|
||||||
|
CPPUNIT_ASSERT_EQUAL(3, index);
|
||||||
|
index = btman.getMissingUnusedIndex(peerBt, sizeof(peerBt));
|
||||||
|
btman.setUseBit(index);
|
||||||
|
CPPUNIT_ASSERT_EQUAL(4, index);
|
||||||
|
index = btman.getMissingUnusedIndex(peerBt, sizeof(peerBt));
|
||||||
|
btman.setUseBit(index);
|
||||||
|
CPPUNIT_ASSERT_EQUAL(2, index);
|
||||||
|
index = btman.getMissingUnusedIndex(peerBt, sizeof(peerBt));
|
||||||
|
btman.setUseBit(index);
|
||||||
|
CPPUNIT_ASSERT_EQUAL(6, index);
|
||||||
|
index = btman.getMissingUnusedIndex(peerBt, sizeof(peerBt));
|
||||||
|
btman.setUseBit(index);
|
||||||
|
CPPUNIT_ASSERT_EQUAL(5, index);
|
||||||
|
index = btman.getMissingUnusedIndex(peerBt, sizeof(peerBt));
|
||||||
|
btman.setUseBit(index);
|
||||||
|
CPPUNIT_ASSERT_EQUAL(7, index);
|
||||||
|
index = btman.getMissingUnusedIndex(peerBt, sizeof(peerBt));
|
||||||
|
btman.setUseBit(index);
|
||||||
|
CPPUNIT_ASSERT_EQUAL(-1, index);
|
||||||
|
CPPUNIT_ASSERT_EQUAL((long long int)12, btman.getFilteredTotalLength());
|
||||||
|
|
||||||
|
// test offset=5, length=2
|
||||||
|
btman.clearAllBit();
|
||||||
|
btman.clearFilter();
|
||||||
|
btman.addFilter(5, 2);
|
||||||
|
btman.enableFilter();
|
||||||
|
index = btman.getMissingUnusedIndex(peerBt, sizeof(peerBt));
|
||||||
|
btman.setUseBit(index);
|
||||||
|
btman.setBit(index);
|
||||||
|
CPPUNIT_ASSERT_EQUAL(3, index);
|
||||||
|
index = btman.getMissingUnusedIndex(peerBt, sizeof(peerBt));
|
||||||
|
btman.setUseBit(index);
|
||||||
|
btman.setBit(index);
|
||||||
|
CPPUNIT_ASSERT_EQUAL(2, index);
|
||||||
|
index = btman.getMissingUnusedIndex(peerBt, sizeof(peerBt));
|
||||||
|
btman.setUseBit(index);
|
||||||
|
CPPUNIT_ASSERT_EQUAL(-1, index);
|
||||||
|
CPPUNIT_ASSERT_EQUAL((long long int)4, btman.getFilteredTotalLength());
|
||||||
|
CPPUNIT_ASSERT(btman.isAllBitSet());
|
||||||
|
|
||||||
|
BitfieldMan btman2(2, 31);
|
||||||
|
btman2.addFilter(0, 31);
|
||||||
|
btman2.enableFilter();
|
||||||
|
CPPUNIT_ASSERT_EQUAL((long long int)31, btman2.getFilteredTotalLength());
|
||||||
|
}
|
||||||
|
|
|
@ -61,9 +61,9 @@ void CookieBoxTest::testCriteriaFind() {
|
||||||
box.add(c3);
|
box.add(c3);
|
||||||
box.add(c4);
|
box.add(c4);
|
||||||
|
|
||||||
vector<Cookie> result1 = box.criteriaFind("rednoah.com", "/downloads", false);
|
Cookies result1 = box.criteriaFind("rednoah.com", "/downloads", false);
|
||||||
CPPUNIT_ASSERT_EQUAL(2, (int)result1.size());
|
CPPUNIT_ASSERT_EQUAL(2, (int)result1.size());
|
||||||
vector<Cookie>::iterator itr = result1.begin();
|
Cookies::iterator itr = result1.begin();
|
||||||
CPPUNIT_ASSERT_EQUAL(string("SESSIONID1=1"), (*itr).toString());
|
CPPUNIT_ASSERT_EQUAL(string("SESSIONID1=1"), (*itr).toString());
|
||||||
itr++;
|
itr++;
|
||||||
CPPUNIT_ASSERT_EQUAL(string("SESSIONID2=2"), (*itr).toString());
|
CPPUNIT_ASSERT_EQUAL(string("SESSIONID2=2"), (*itr).toString());
|
||||||
|
|
|
@ -17,6 +17,15 @@ aria2c_SOURCES = AllTest.cc\
|
||||||
PeerMessageUtilTest.cc\
|
PeerMessageUtilTest.cc\
|
||||||
BitfieldManTest.cc\
|
BitfieldManTest.cc\
|
||||||
DefaultDiskWriterTest.cc
|
DefaultDiskWriterTest.cc
|
||||||
aria2c_CXXFLAGS = ${CPPUNIT_CFLAGS} -I../src -I../lib -Wall -D_FILE_OFFSET_BITS=64
|
#aria2c_CXXFLAGS = ${CPPUNIT_CFLAGS} -I../src -I../lib -Wall -D_FILE_OFFSET_BITS=64
|
||||||
aria2c_LDFLAGS = ${CPPUNIT_LIBS}
|
#aria2c_LDFLAGS = ${CPPUNIT_LIBS}
|
||||||
aria2c_LDADD = ../src/libaria2c.a
|
|
||||||
|
aria2c_LDADD = ../src/libaria2c.a\
|
||||||
|
${CPPUNIT_LIBS} @LIBGNUTLS_LIBS@\
|
||||||
|
@LIBGCRYPT_LIBS@ @OPENSSL_LIBS@
|
||||||
|
AM_CPPFLAGS = -Wall\
|
||||||
|
${CPPUNIT_CFLAGS}\
|
||||||
|
-I ../src\
|
||||||
|
-I../lib -I../intl -I$(top_srcdir)/intl\
|
||||||
|
@LIBGNUTLS_CFLAGS@ @LIBGCRYPT_CFLAGS@ @OPENSSL_CFLAGS@\
|
||||||
|
-D_FILE_OFFSET_BITS=64 -DLOCALEDIR=\"$(localedir)\" @DEFS@
|
||||||
|
|
311
test/Makefile.in
311
test/Makefile.in
|
@ -56,20 +56,17 @@ mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||||
CONFIG_HEADER = $(top_builddir)/config.h
|
CONFIG_HEADER = $(top_builddir)/config.h
|
||||||
CONFIG_CLEAN_FILES =
|
CONFIG_CLEAN_FILES =
|
||||||
am__EXEEXT_1 = aria2c$(EXEEXT)
|
am__EXEEXT_1 = aria2c$(EXEEXT)
|
||||||
am_aria2c_OBJECTS = aria2c-AllTest.$(OBJEXT) \
|
am_aria2c_OBJECTS = AllTest.$(OBJEXT) RequestTest.$(OBJEXT) \
|
||||||
aria2c-RequestTest.$(OBJEXT) \
|
ChunkedEncodingTest.$(OBJEXT) FileTest.$(OBJEXT) \
|
||||||
aria2c-ChunkedEncodingTest.$(OBJEXT) aria2c-FileTest.$(OBJEXT) \
|
OptionTest.$(OBJEXT) Base64Test.$(OBJEXT) UtilTest.$(OBJEXT) \
|
||||||
aria2c-OptionTest.$(OBJEXT) aria2c-Base64Test.$(OBJEXT) \
|
CookieBoxTest.$(OBJEXT) DataTest.$(OBJEXT) \
|
||||||
aria2c-UtilTest.$(OBJEXT) aria2c-CookieBoxTest.$(OBJEXT) \
|
DictionaryTest.$(OBJEXT) ListTest.$(OBJEXT) \
|
||||||
aria2c-DataTest.$(OBJEXT) aria2c-DictionaryTest.$(OBJEXT) \
|
MetaFileUtilTest.$(OBJEXT) ShaVisitorTest.$(OBJEXT) \
|
||||||
aria2c-ListTest.$(OBJEXT) aria2c-MetaFileUtilTest.$(OBJEXT) \
|
TorrentManTest.$(OBJEXT) PeerMessageUtilTest.$(OBJEXT) \
|
||||||
aria2c-ShaVisitorTest.$(OBJEXT) \
|
BitfieldManTest.$(OBJEXT) DefaultDiskWriterTest.$(OBJEXT)
|
||||||
aria2c-TorrentManTest.$(OBJEXT) \
|
|
||||||
aria2c-PeerMessageUtilTest.$(OBJEXT) \
|
|
||||||
aria2c-BitfieldManTest.$(OBJEXT) \
|
|
||||||
aria2c-DefaultDiskWriterTest.$(OBJEXT)
|
|
||||||
aria2c_OBJECTS = $(am_aria2c_OBJECTS)
|
aria2c_OBJECTS = $(am_aria2c_OBJECTS)
|
||||||
aria2c_DEPENDENCIES = ../src/libaria2c.a
|
am__DEPENDENCIES_1 =
|
||||||
|
aria2c_DEPENDENCIES = ../src/libaria2c.a $(am__DEPENDENCIES_1)
|
||||||
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
|
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
|
||||||
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||||
am__depfiles_maybe = depfiles
|
am__depfiles_maybe = depfiles
|
||||||
|
@ -225,9 +222,19 @@ aria2c_SOURCES = AllTest.cc\
|
||||||
BitfieldManTest.cc\
|
BitfieldManTest.cc\
|
||||||
DefaultDiskWriterTest.cc
|
DefaultDiskWriterTest.cc
|
||||||
|
|
||||||
aria2c_CXXFLAGS = ${CPPUNIT_CFLAGS} -I../src -I../lib -Wall -D_FILE_OFFSET_BITS=64
|
#aria2c_CXXFLAGS = ${CPPUNIT_CFLAGS} -I../src -I../lib -Wall -D_FILE_OFFSET_BITS=64
|
||||||
aria2c_LDFLAGS = ${CPPUNIT_LIBS}
|
#aria2c_LDFLAGS = ${CPPUNIT_LIBS}
|
||||||
aria2c_LDADD = ../src/libaria2c.a
|
aria2c_LDADD = ../src/libaria2c.a\
|
||||||
|
${CPPUNIT_LIBS} @LIBGNUTLS_LIBS@\
|
||||||
|
@LIBGCRYPT_LIBS@ @OPENSSL_LIBS@
|
||||||
|
|
||||||
|
AM_CPPFLAGS = -Wall\
|
||||||
|
${CPPUNIT_CFLAGS}\
|
||||||
|
-I ../src\
|
||||||
|
-I../lib -I../intl -I$(top_srcdir)/intl\
|
||||||
|
@LIBGNUTLS_CFLAGS@ @LIBGCRYPT_CFLAGS@ @OPENSSL_CFLAGS@\
|
||||||
|
-D_FILE_OFFSET_BITS=64 -DLOCALEDIR=\"$(localedir)\" @DEFS@
|
||||||
|
|
||||||
all: all-am
|
all: all-am
|
||||||
|
|
||||||
.SUFFIXES:
|
.SUFFIXES:
|
||||||
|
@ -274,23 +281,23 @@ mostlyclean-compile:
|
||||||
distclean-compile:
|
distclean-compile:
|
||||||
-rm -f *.tab.c
|
-rm -f *.tab.c
|
||||||
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aria2c-AllTest.Po@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AllTest.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aria2c-Base64Test.Po@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Base64Test.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aria2c-BitfieldManTest.Po@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/BitfieldManTest.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aria2c-ChunkedEncodingTest.Po@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ChunkedEncodingTest.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aria2c-CookieBoxTest.Po@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CookieBoxTest.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aria2c-DataTest.Po@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DataTest.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aria2c-DefaultDiskWriterTest.Po@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DefaultDiskWriterTest.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aria2c-DictionaryTest.Po@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DictionaryTest.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aria2c-FileTest.Po@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FileTest.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aria2c-ListTest.Po@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ListTest.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aria2c-MetaFileUtilTest.Po@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MetaFileUtilTest.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aria2c-OptionTest.Po@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OptionTest.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aria2c-PeerMessageUtilTest.Po@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PeerMessageUtilTest.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aria2c-RequestTest.Po@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RequestTest.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aria2c-ShaVisitorTest.Po@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ShaVisitorTest.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aria2c-TorrentManTest.Po@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TorrentManTest.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aria2c-UtilTest.Po@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/UtilTest.Po@am__quote@
|
||||||
|
|
||||||
.cc.o:
|
.cc.o:
|
||||||
@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
|
@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
|
||||||
|
@ -305,244 +312,6 @@ distclean-compile:
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||||
@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
|
@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
|
||||||
|
|
||||||
aria2c-AllTest.o: AllTest.cc
|
|
||||||
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -MT aria2c-AllTest.o -MD -MP -MF "$(DEPDIR)/aria2c-AllTest.Tpo" -c -o aria2c-AllTest.o `test -f 'AllTest.cc' || echo '$(srcdir)/'`AllTest.cc; \
|
|
||||||
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/aria2c-AllTest.Tpo" "$(DEPDIR)/aria2c-AllTest.Po"; else rm -f "$(DEPDIR)/aria2c-AllTest.Tpo"; exit 1; fi
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='AllTest.cc' object='aria2c-AllTest.o' libtool=no @AMDEPBACKSLASH@
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
|
||||||
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -c -o aria2c-AllTest.o `test -f 'AllTest.cc' || echo '$(srcdir)/'`AllTest.cc
|
|
||||||
|
|
||||||
aria2c-AllTest.obj: AllTest.cc
|
|
||||||
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -MT aria2c-AllTest.obj -MD -MP -MF "$(DEPDIR)/aria2c-AllTest.Tpo" -c -o aria2c-AllTest.obj `if test -f 'AllTest.cc'; then $(CYGPATH_W) 'AllTest.cc'; else $(CYGPATH_W) '$(srcdir)/AllTest.cc'; fi`; \
|
|
||||||
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/aria2c-AllTest.Tpo" "$(DEPDIR)/aria2c-AllTest.Po"; else rm -f "$(DEPDIR)/aria2c-AllTest.Tpo"; exit 1; fi
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='AllTest.cc' object='aria2c-AllTest.obj' libtool=no @AMDEPBACKSLASH@
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
|
||||||
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -c -o aria2c-AllTest.obj `if test -f 'AllTest.cc'; then $(CYGPATH_W) 'AllTest.cc'; else $(CYGPATH_W) '$(srcdir)/AllTest.cc'; fi`
|
|
||||||
|
|
||||||
aria2c-RequestTest.o: RequestTest.cc
|
|
||||||
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -MT aria2c-RequestTest.o -MD -MP -MF "$(DEPDIR)/aria2c-RequestTest.Tpo" -c -o aria2c-RequestTest.o `test -f 'RequestTest.cc' || echo '$(srcdir)/'`RequestTest.cc; \
|
|
||||||
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/aria2c-RequestTest.Tpo" "$(DEPDIR)/aria2c-RequestTest.Po"; else rm -f "$(DEPDIR)/aria2c-RequestTest.Tpo"; exit 1; fi
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='RequestTest.cc' object='aria2c-RequestTest.o' libtool=no @AMDEPBACKSLASH@
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
|
||||||
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -c -o aria2c-RequestTest.o `test -f 'RequestTest.cc' || echo '$(srcdir)/'`RequestTest.cc
|
|
||||||
|
|
||||||
aria2c-RequestTest.obj: RequestTest.cc
|
|
||||||
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -MT aria2c-RequestTest.obj -MD -MP -MF "$(DEPDIR)/aria2c-RequestTest.Tpo" -c -o aria2c-RequestTest.obj `if test -f 'RequestTest.cc'; then $(CYGPATH_W) 'RequestTest.cc'; else $(CYGPATH_W) '$(srcdir)/RequestTest.cc'; fi`; \
|
|
||||||
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/aria2c-RequestTest.Tpo" "$(DEPDIR)/aria2c-RequestTest.Po"; else rm -f "$(DEPDIR)/aria2c-RequestTest.Tpo"; exit 1; fi
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='RequestTest.cc' object='aria2c-RequestTest.obj' libtool=no @AMDEPBACKSLASH@
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
|
||||||
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -c -o aria2c-RequestTest.obj `if test -f 'RequestTest.cc'; then $(CYGPATH_W) 'RequestTest.cc'; else $(CYGPATH_W) '$(srcdir)/RequestTest.cc'; fi`
|
|
||||||
|
|
||||||
aria2c-ChunkedEncodingTest.o: ChunkedEncodingTest.cc
|
|
||||||
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -MT aria2c-ChunkedEncodingTest.o -MD -MP -MF "$(DEPDIR)/aria2c-ChunkedEncodingTest.Tpo" -c -o aria2c-ChunkedEncodingTest.o `test -f 'ChunkedEncodingTest.cc' || echo '$(srcdir)/'`ChunkedEncodingTest.cc; \
|
|
||||||
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/aria2c-ChunkedEncodingTest.Tpo" "$(DEPDIR)/aria2c-ChunkedEncodingTest.Po"; else rm -f "$(DEPDIR)/aria2c-ChunkedEncodingTest.Tpo"; exit 1; fi
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ChunkedEncodingTest.cc' object='aria2c-ChunkedEncodingTest.o' libtool=no @AMDEPBACKSLASH@
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
|
||||||
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -c -o aria2c-ChunkedEncodingTest.o `test -f 'ChunkedEncodingTest.cc' || echo '$(srcdir)/'`ChunkedEncodingTest.cc
|
|
||||||
|
|
||||||
aria2c-ChunkedEncodingTest.obj: ChunkedEncodingTest.cc
|
|
||||||
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -MT aria2c-ChunkedEncodingTest.obj -MD -MP -MF "$(DEPDIR)/aria2c-ChunkedEncodingTest.Tpo" -c -o aria2c-ChunkedEncodingTest.obj `if test -f 'ChunkedEncodingTest.cc'; then $(CYGPATH_W) 'ChunkedEncodingTest.cc'; else $(CYGPATH_W) '$(srcdir)/ChunkedEncodingTest.cc'; fi`; \
|
|
||||||
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/aria2c-ChunkedEncodingTest.Tpo" "$(DEPDIR)/aria2c-ChunkedEncodingTest.Po"; else rm -f "$(DEPDIR)/aria2c-ChunkedEncodingTest.Tpo"; exit 1; fi
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ChunkedEncodingTest.cc' object='aria2c-ChunkedEncodingTest.obj' libtool=no @AMDEPBACKSLASH@
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
|
||||||
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -c -o aria2c-ChunkedEncodingTest.obj `if test -f 'ChunkedEncodingTest.cc'; then $(CYGPATH_W) 'ChunkedEncodingTest.cc'; else $(CYGPATH_W) '$(srcdir)/ChunkedEncodingTest.cc'; fi`
|
|
||||||
|
|
||||||
aria2c-FileTest.o: FileTest.cc
|
|
||||||
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -MT aria2c-FileTest.o -MD -MP -MF "$(DEPDIR)/aria2c-FileTest.Tpo" -c -o aria2c-FileTest.o `test -f 'FileTest.cc' || echo '$(srcdir)/'`FileTest.cc; \
|
|
||||||
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/aria2c-FileTest.Tpo" "$(DEPDIR)/aria2c-FileTest.Po"; else rm -f "$(DEPDIR)/aria2c-FileTest.Tpo"; exit 1; fi
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='FileTest.cc' object='aria2c-FileTest.o' libtool=no @AMDEPBACKSLASH@
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
|
||||||
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -c -o aria2c-FileTest.o `test -f 'FileTest.cc' || echo '$(srcdir)/'`FileTest.cc
|
|
||||||
|
|
||||||
aria2c-FileTest.obj: FileTest.cc
|
|
||||||
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -MT aria2c-FileTest.obj -MD -MP -MF "$(DEPDIR)/aria2c-FileTest.Tpo" -c -o aria2c-FileTest.obj `if test -f 'FileTest.cc'; then $(CYGPATH_W) 'FileTest.cc'; else $(CYGPATH_W) '$(srcdir)/FileTest.cc'; fi`; \
|
|
||||||
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/aria2c-FileTest.Tpo" "$(DEPDIR)/aria2c-FileTest.Po"; else rm -f "$(DEPDIR)/aria2c-FileTest.Tpo"; exit 1; fi
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='FileTest.cc' object='aria2c-FileTest.obj' libtool=no @AMDEPBACKSLASH@
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
|
||||||
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -c -o aria2c-FileTest.obj `if test -f 'FileTest.cc'; then $(CYGPATH_W) 'FileTest.cc'; else $(CYGPATH_W) '$(srcdir)/FileTest.cc'; fi`
|
|
||||||
|
|
||||||
aria2c-OptionTest.o: OptionTest.cc
|
|
||||||
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -MT aria2c-OptionTest.o -MD -MP -MF "$(DEPDIR)/aria2c-OptionTest.Tpo" -c -o aria2c-OptionTest.o `test -f 'OptionTest.cc' || echo '$(srcdir)/'`OptionTest.cc; \
|
|
||||||
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/aria2c-OptionTest.Tpo" "$(DEPDIR)/aria2c-OptionTest.Po"; else rm -f "$(DEPDIR)/aria2c-OptionTest.Tpo"; exit 1; fi
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='OptionTest.cc' object='aria2c-OptionTest.o' libtool=no @AMDEPBACKSLASH@
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
|
||||||
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -c -o aria2c-OptionTest.o `test -f 'OptionTest.cc' || echo '$(srcdir)/'`OptionTest.cc
|
|
||||||
|
|
||||||
aria2c-OptionTest.obj: OptionTest.cc
|
|
||||||
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -MT aria2c-OptionTest.obj -MD -MP -MF "$(DEPDIR)/aria2c-OptionTest.Tpo" -c -o aria2c-OptionTest.obj `if test -f 'OptionTest.cc'; then $(CYGPATH_W) 'OptionTest.cc'; else $(CYGPATH_W) '$(srcdir)/OptionTest.cc'; fi`; \
|
|
||||||
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/aria2c-OptionTest.Tpo" "$(DEPDIR)/aria2c-OptionTest.Po"; else rm -f "$(DEPDIR)/aria2c-OptionTest.Tpo"; exit 1; fi
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='OptionTest.cc' object='aria2c-OptionTest.obj' libtool=no @AMDEPBACKSLASH@
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
|
||||||
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -c -o aria2c-OptionTest.obj `if test -f 'OptionTest.cc'; then $(CYGPATH_W) 'OptionTest.cc'; else $(CYGPATH_W) '$(srcdir)/OptionTest.cc'; fi`
|
|
||||||
|
|
||||||
aria2c-Base64Test.o: Base64Test.cc
|
|
||||||
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -MT aria2c-Base64Test.o -MD -MP -MF "$(DEPDIR)/aria2c-Base64Test.Tpo" -c -o aria2c-Base64Test.o `test -f 'Base64Test.cc' || echo '$(srcdir)/'`Base64Test.cc; \
|
|
||||||
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/aria2c-Base64Test.Tpo" "$(DEPDIR)/aria2c-Base64Test.Po"; else rm -f "$(DEPDIR)/aria2c-Base64Test.Tpo"; exit 1; fi
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Base64Test.cc' object='aria2c-Base64Test.o' libtool=no @AMDEPBACKSLASH@
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
|
||||||
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -c -o aria2c-Base64Test.o `test -f 'Base64Test.cc' || echo '$(srcdir)/'`Base64Test.cc
|
|
||||||
|
|
||||||
aria2c-Base64Test.obj: Base64Test.cc
|
|
||||||
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -MT aria2c-Base64Test.obj -MD -MP -MF "$(DEPDIR)/aria2c-Base64Test.Tpo" -c -o aria2c-Base64Test.obj `if test -f 'Base64Test.cc'; then $(CYGPATH_W) 'Base64Test.cc'; else $(CYGPATH_W) '$(srcdir)/Base64Test.cc'; fi`; \
|
|
||||||
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/aria2c-Base64Test.Tpo" "$(DEPDIR)/aria2c-Base64Test.Po"; else rm -f "$(DEPDIR)/aria2c-Base64Test.Tpo"; exit 1; fi
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Base64Test.cc' object='aria2c-Base64Test.obj' libtool=no @AMDEPBACKSLASH@
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
|
||||||
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -c -o aria2c-Base64Test.obj `if test -f 'Base64Test.cc'; then $(CYGPATH_W) 'Base64Test.cc'; else $(CYGPATH_W) '$(srcdir)/Base64Test.cc'; fi`
|
|
||||||
|
|
||||||
aria2c-UtilTest.o: UtilTest.cc
|
|
||||||
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -MT aria2c-UtilTest.o -MD -MP -MF "$(DEPDIR)/aria2c-UtilTest.Tpo" -c -o aria2c-UtilTest.o `test -f 'UtilTest.cc' || echo '$(srcdir)/'`UtilTest.cc; \
|
|
||||||
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/aria2c-UtilTest.Tpo" "$(DEPDIR)/aria2c-UtilTest.Po"; else rm -f "$(DEPDIR)/aria2c-UtilTest.Tpo"; exit 1; fi
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='UtilTest.cc' object='aria2c-UtilTest.o' libtool=no @AMDEPBACKSLASH@
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
|
||||||
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -c -o aria2c-UtilTest.o `test -f 'UtilTest.cc' || echo '$(srcdir)/'`UtilTest.cc
|
|
||||||
|
|
||||||
aria2c-UtilTest.obj: UtilTest.cc
|
|
||||||
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -MT aria2c-UtilTest.obj -MD -MP -MF "$(DEPDIR)/aria2c-UtilTest.Tpo" -c -o aria2c-UtilTest.obj `if test -f 'UtilTest.cc'; then $(CYGPATH_W) 'UtilTest.cc'; else $(CYGPATH_W) '$(srcdir)/UtilTest.cc'; fi`; \
|
|
||||||
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/aria2c-UtilTest.Tpo" "$(DEPDIR)/aria2c-UtilTest.Po"; else rm -f "$(DEPDIR)/aria2c-UtilTest.Tpo"; exit 1; fi
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='UtilTest.cc' object='aria2c-UtilTest.obj' libtool=no @AMDEPBACKSLASH@
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
|
||||||
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -c -o aria2c-UtilTest.obj `if test -f 'UtilTest.cc'; then $(CYGPATH_W) 'UtilTest.cc'; else $(CYGPATH_W) '$(srcdir)/UtilTest.cc'; fi`
|
|
||||||
|
|
||||||
aria2c-CookieBoxTest.o: CookieBoxTest.cc
|
|
||||||
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -MT aria2c-CookieBoxTest.o -MD -MP -MF "$(DEPDIR)/aria2c-CookieBoxTest.Tpo" -c -o aria2c-CookieBoxTest.o `test -f 'CookieBoxTest.cc' || echo '$(srcdir)/'`CookieBoxTest.cc; \
|
|
||||||
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/aria2c-CookieBoxTest.Tpo" "$(DEPDIR)/aria2c-CookieBoxTest.Po"; else rm -f "$(DEPDIR)/aria2c-CookieBoxTest.Tpo"; exit 1; fi
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='CookieBoxTest.cc' object='aria2c-CookieBoxTest.o' libtool=no @AMDEPBACKSLASH@
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
|
||||||
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -c -o aria2c-CookieBoxTest.o `test -f 'CookieBoxTest.cc' || echo '$(srcdir)/'`CookieBoxTest.cc
|
|
||||||
|
|
||||||
aria2c-CookieBoxTest.obj: CookieBoxTest.cc
|
|
||||||
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -MT aria2c-CookieBoxTest.obj -MD -MP -MF "$(DEPDIR)/aria2c-CookieBoxTest.Tpo" -c -o aria2c-CookieBoxTest.obj `if test -f 'CookieBoxTest.cc'; then $(CYGPATH_W) 'CookieBoxTest.cc'; else $(CYGPATH_W) '$(srcdir)/CookieBoxTest.cc'; fi`; \
|
|
||||||
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/aria2c-CookieBoxTest.Tpo" "$(DEPDIR)/aria2c-CookieBoxTest.Po"; else rm -f "$(DEPDIR)/aria2c-CookieBoxTest.Tpo"; exit 1; fi
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='CookieBoxTest.cc' object='aria2c-CookieBoxTest.obj' libtool=no @AMDEPBACKSLASH@
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
|
||||||
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -c -o aria2c-CookieBoxTest.obj `if test -f 'CookieBoxTest.cc'; then $(CYGPATH_W) 'CookieBoxTest.cc'; else $(CYGPATH_W) '$(srcdir)/CookieBoxTest.cc'; fi`
|
|
||||||
|
|
||||||
aria2c-DataTest.o: DataTest.cc
|
|
||||||
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -MT aria2c-DataTest.o -MD -MP -MF "$(DEPDIR)/aria2c-DataTest.Tpo" -c -o aria2c-DataTest.o `test -f 'DataTest.cc' || echo '$(srcdir)/'`DataTest.cc; \
|
|
||||||
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/aria2c-DataTest.Tpo" "$(DEPDIR)/aria2c-DataTest.Po"; else rm -f "$(DEPDIR)/aria2c-DataTest.Tpo"; exit 1; fi
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='DataTest.cc' object='aria2c-DataTest.o' libtool=no @AMDEPBACKSLASH@
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
|
||||||
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -c -o aria2c-DataTest.o `test -f 'DataTest.cc' || echo '$(srcdir)/'`DataTest.cc
|
|
||||||
|
|
||||||
aria2c-DataTest.obj: DataTest.cc
|
|
||||||
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -MT aria2c-DataTest.obj -MD -MP -MF "$(DEPDIR)/aria2c-DataTest.Tpo" -c -o aria2c-DataTest.obj `if test -f 'DataTest.cc'; then $(CYGPATH_W) 'DataTest.cc'; else $(CYGPATH_W) '$(srcdir)/DataTest.cc'; fi`; \
|
|
||||||
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/aria2c-DataTest.Tpo" "$(DEPDIR)/aria2c-DataTest.Po"; else rm -f "$(DEPDIR)/aria2c-DataTest.Tpo"; exit 1; fi
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='DataTest.cc' object='aria2c-DataTest.obj' libtool=no @AMDEPBACKSLASH@
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
|
||||||
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -c -o aria2c-DataTest.obj `if test -f 'DataTest.cc'; then $(CYGPATH_W) 'DataTest.cc'; else $(CYGPATH_W) '$(srcdir)/DataTest.cc'; fi`
|
|
||||||
|
|
||||||
aria2c-DictionaryTest.o: DictionaryTest.cc
|
|
||||||
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -MT aria2c-DictionaryTest.o -MD -MP -MF "$(DEPDIR)/aria2c-DictionaryTest.Tpo" -c -o aria2c-DictionaryTest.o `test -f 'DictionaryTest.cc' || echo '$(srcdir)/'`DictionaryTest.cc; \
|
|
||||||
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/aria2c-DictionaryTest.Tpo" "$(DEPDIR)/aria2c-DictionaryTest.Po"; else rm -f "$(DEPDIR)/aria2c-DictionaryTest.Tpo"; exit 1; fi
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='DictionaryTest.cc' object='aria2c-DictionaryTest.o' libtool=no @AMDEPBACKSLASH@
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
|
||||||
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -c -o aria2c-DictionaryTest.o `test -f 'DictionaryTest.cc' || echo '$(srcdir)/'`DictionaryTest.cc
|
|
||||||
|
|
||||||
aria2c-DictionaryTest.obj: DictionaryTest.cc
|
|
||||||
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -MT aria2c-DictionaryTest.obj -MD -MP -MF "$(DEPDIR)/aria2c-DictionaryTest.Tpo" -c -o aria2c-DictionaryTest.obj `if test -f 'DictionaryTest.cc'; then $(CYGPATH_W) 'DictionaryTest.cc'; else $(CYGPATH_W) '$(srcdir)/DictionaryTest.cc'; fi`; \
|
|
||||||
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/aria2c-DictionaryTest.Tpo" "$(DEPDIR)/aria2c-DictionaryTest.Po"; else rm -f "$(DEPDIR)/aria2c-DictionaryTest.Tpo"; exit 1; fi
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='DictionaryTest.cc' object='aria2c-DictionaryTest.obj' libtool=no @AMDEPBACKSLASH@
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
|
||||||
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -c -o aria2c-DictionaryTest.obj `if test -f 'DictionaryTest.cc'; then $(CYGPATH_W) 'DictionaryTest.cc'; else $(CYGPATH_W) '$(srcdir)/DictionaryTest.cc'; fi`
|
|
||||||
|
|
||||||
aria2c-ListTest.o: ListTest.cc
|
|
||||||
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -MT aria2c-ListTest.o -MD -MP -MF "$(DEPDIR)/aria2c-ListTest.Tpo" -c -o aria2c-ListTest.o `test -f 'ListTest.cc' || echo '$(srcdir)/'`ListTest.cc; \
|
|
||||||
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/aria2c-ListTest.Tpo" "$(DEPDIR)/aria2c-ListTest.Po"; else rm -f "$(DEPDIR)/aria2c-ListTest.Tpo"; exit 1; fi
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ListTest.cc' object='aria2c-ListTest.o' libtool=no @AMDEPBACKSLASH@
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
|
||||||
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -c -o aria2c-ListTest.o `test -f 'ListTest.cc' || echo '$(srcdir)/'`ListTest.cc
|
|
||||||
|
|
||||||
aria2c-ListTest.obj: ListTest.cc
|
|
||||||
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -MT aria2c-ListTest.obj -MD -MP -MF "$(DEPDIR)/aria2c-ListTest.Tpo" -c -o aria2c-ListTest.obj `if test -f 'ListTest.cc'; then $(CYGPATH_W) 'ListTest.cc'; else $(CYGPATH_W) '$(srcdir)/ListTest.cc'; fi`; \
|
|
||||||
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/aria2c-ListTest.Tpo" "$(DEPDIR)/aria2c-ListTest.Po"; else rm -f "$(DEPDIR)/aria2c-ListTest.Tpo"; exit 1; fi
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ListTest.cc' object='aria2c-ListTest.obj' libtool=no @AMDEPBACKSLASH@
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
|
||||||
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -c -o aria2c-ListTest.obj `if test -f 'ListTest.cc'; then $(CYGPATH_W) 'ListTest.cc'; else $(CYGPATH_W) '$(srcdir)/ListTest.cc'; fi`
|
|
||||||
|
|
||||||
aria2c-MetaFileUtilTest.o: MetaFileUtilTest.cc
|
|
||||||
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -MT aria2c-MetaFileUtilTest.o -MD -MP -MF "$(DEPDIR)/aria2c-MetaFileUtilTest.Tpo" -c -o aria2c-MetaFileUtilTest.o `test -f 'MetaFileUtilTest.cc' || echo '$(srcdir)/'`MetaFileUtilTest.cc; \
|
|
||||||
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/aria2c-MetaFileUtilTest.Tpo" "$(DEPDIR)/aria2c-MetaFileUtilTest.Po"; else rm -f "$(DEPDIR)/aria2c-MetaFileUtilTest.Tpo"; exit 1; fi
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='MetaFileUtilTest.cc' object='aria2c-MetaFileUtilTest.o' libtool=no @AMDEPBACKSLASH@
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
|
||||||
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -c -o aria2c-MetaFileUtilTest.o `test -f 'MetaFileUtilTest.cc' || echo '$(srcdir)/'`MetaFileUtilTest.cc
|
|
||||||
|
|
||||||
aria2c-MetaFileUtilTest.obj: MetaFileUtilTest.cc
|
|
||||||
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -MT aria2c-MetaFileUtilTest.obj -MD -MP -MF "$(DEPDIR)/aria2c-MetaFileUtilTest.Tpo" -c -o aria2c-MetaFileUtilTest.obj `if test -f 'MetaFileUtilTest.cc'; then $(CYGPATH_W) 'MetaFileUtilTest.cc'; else $(CYGPATH_W) '$(srcdir)/MetaFileUtilTest.cc'; fi`; \
|
|
||||||
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/aria2c-MetaFileUtilTest.Tpo" "$(DEPDIR)/aria2c-MetaFileUtilTest.Po"; else rm -f "$(DEPDIR)/aria2c-MetaFileUtilTest.Tpo"; exit 1; fi
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='MetaFileUtilTest.cc' object='aria2c-MetaFileUtilTest.obj' libtool=no @AMDEPBACKSLASH@
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
|
||||||
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -c -o aria2c-MetaFileUtilTest.obj `if test -f 'MetaFileUtilTest.cc'; then $(CYGPATH_W) 'MetaFileUtilTest.cc'; else $(CYGPATH_W) '$(srcdir)/MetaFileUtilTest.cc'; fi`
|
|
||||||
|
|
||||||
aria2c-ShaVisitorTest.o: ShaVisitorTest.cc
|
|
||||||
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -MT aria2c-ShaVisitorTest.o -MD -MP -MF "$(DEPDIR)/aria2c-ShaVisitorTest.Tpo" -c -o aria2c-ShaVisitorTest.o `test -f 'ShaVisitorTest.cc' || echo '$(srcdir)/'`ShaVisitorTest.cc; \
|
|
||||||
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/aria2c-ShaVisitorTest.Tpo" "$(DEPDIR)/aria2c-ShaVisitorTest.Po"; else rm -f "$(DEPDIR)/aria2c-ShaVisitorTest.Tpo"; exit 1; fi
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ShaVisitorTest.cc' object='aria2c-ShaVisitorTest.o' libtool=no @AMDEPBACKSLASH@
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
|
||||||
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -c -o aria2c-ShaVisitorTest.o `test -f 'ShaVisitorTest.cc' || echo '$(srcdir)/'`ShaVisitorTest.cc
|
|
||||||
|
|
||||||
aria2c-ShaVisitorTest.obj: ShaVisitorTest.cc
|
|
||||||
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -MT aria2c-ShaVisitorTest.obj -MD -MP -MF "$(DEPDIR)/aria2c-ShaVisitorTest.Tpo" -c -o aria2c-ShaVisitorTest.obj `if test -f 'ShaVisitorTest.cc'; then $(CYGPATH_W) 'ShaVisitorTest.cc'; else $(CYGPATH_W) '$(srcdir)/ShaVisitorTest.cc'; fi`; \
|
|
||||||
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/aria2c-ShaVisitorTest.Tpo" "$(DEPDIR)/aria2c-ShaVisitorTest.Po"; else rm -f "$(DEPDIR)/aria2c-ShaVisitorTest.Tpo"; exit 1; fi
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='ShaVisitorTest.cc' object='aria2c-ShaVisitorTest.obj' libtool=no @AMDEPBACKSLASH@
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
|
||||||
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -c -o aria2c-ShaVisitorTest.obj `if test -f 'ShaVisitorTest.cc'; then $(CYGPATH_W) 'ShaVisitorTest.cc'; else $(CYGPATH_W) '$(srcdir)/ShaVisitorTest.cc'; fi`
|
|
||||||
|
|
||||||
aria2c-TorrentManTest.o: TorrentManTest.cc
|
|
||||||
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -MT aria2c-TorrentManTest.o -MD -MP -MF "$(DEPDIR)/aria2c-TorrentManTest.Tpo" -c -o aria2c-TorrentManTest.o `test -f 'TorrentManTest.cc' || echo '$(srcdir)/'`TorrentManTest.cc; \
|
|
||||||
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/aria2c-TorrentManTest.Tpo" "$(DEPDIR)/aria2c-TorrentManTest.Po"; else rm -f "$(DEPDIR)/aria2c-TorrentManTest.Tpo"; exit 1; fi
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='TorrentManTest.cc' object='aria2c-TorrentManTest.o' libtool=no @AMDEPBACKSLASH@
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
|
||||||
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -c -o aria2c-TorrentManTest.o `test -f 'TorrentManTest.cc' || echo '$(srcdir)/'`TorrentManTest.cc
|
|
||||||
|
|
||||||
aria2c-TorrentManTest.obj: TorrentManTest.cc
|
|
||||||
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -MT aria2c-TorrentManTest.obj -MD -MP -MF "$(DEPDIR)/aria2c-TorrentManTest.Tpo" -c -o aria2c-TorrentManTest.obj `if test -f 'TorrentManTest.cc'; then $(CYGPATH_W) 'TorrentManTest.cc'; else $(CYGPATH_W) '$(srcdir)/TorrentManTest.cc'; fi`; \
|
|
||||||
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/aria2c-TorrentManTest.Tpo" "$(DEPDIR)/aria2c-TorrentManTest.Po"; else rm -f "$(DEPDIR)/aria2c-TorrentManTest.Tpo"; exit 1; fi
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='TorrentManTest.cc' object='aria2c-TorrentManTest.obj' libtool=no @AMDEPBACKSLASH@
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
|
||||||
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -c -o aria2c-TorrentManTest.obj `if test -f 'TorrentManTest.cc'; then $(CYGPATH_W) 'TorrentManTest.cc'; else $(CYGPATH_W) '$(srcdir)/TorrentManTest.cc'; fi`
|
|
||||||
|
|
||||||
aria2c-PeerMessageUtilTest.o: PeerMessageUtilTest.cc
|
|
||||||
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -MT aria2c-PeerMessageUtilTest.o -MD -MP -MF "$(DEPDIR)/aria2c-PeerMessageUtilTest.Tpo" -c -o aria2c-PeerMessageUtilTest.o `test -f 'PeerMessageUtilTest.cc' || echo '$(srcdir)/'`PeerMessageUtilTest.cc; \
|
|
||||||
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/aria2c-PeerMessageUtilTest.Tpo" "$(DEPDIR)/aria2c-PeerMessageUtilTest.Po"; else rm -f "$(DEPDIR)/aria2c-PeerMessageUtilTest.Tpo"; exit 1; fi
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='PeerMessageUtilTest.cc' object='aria2c-PeerMessageUtilTest.o' libtool=no @AMDEPBACKSLASH@
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
|
||||||
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -c -o aria2c-PeerMessageUtilTest.o `test -f 'PeerMessageUtilTest.cc' || echo '$(srcdir)/'`PeerMessageUtilTest.cc
|
|
||||||
|
|
||||||
aria2c-PeerMessageUtilTest.obj: PeerMessageUtilTest.cc
|
|
||||||
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -MT aria2c-PeerMessageUtilTest.obj -MD -MP -MF "$(DEPDIR)/aria2c-PeerMessageUtilTest.Tpo" -c -o aria2c-PeerMessageUtilTest.obj `if test -f 'PeerMessageUtilTest.cc'; then $(CYGPATH_W) 'PeerMessageUtilTest.cc'; else $(CYGPATH_W) '$(srcdir)/PeerMessageUtilTest.cc'; fi`; \
|
|
||||||
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/aria2c-PeerMessageUtilTest.Tpo" "$(DEPDIR)/aria2c-PeerMessageUtilTest.Po"; else rm -f "$(DEPDIR)/aria2c-PeerMessageUtilTest.Tpo"; exit 1; fi
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='PeerMessageUtilTest.cc' object='aria2c-PeerMessageUtilTest.obj' libtool=no @AMDEPBACKSLASH@
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
|
||||||
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -c -o aria2c-PeerMessageUtilTest.obj `if test -f 'PeerMessageUtilTest.cc'; then $(CYGPATH_W) 'PeerMessageUtilTest.cc'; else $(CYGPATH_W) '$(srcdir)/PeerMessageUtilTest.cc'; fi`
|
|
||||||
|
|
||||||
aria2c-BitfieldManTest.o: BitfieldManTest.cc
|
|
||||||
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -MT aria2c-BitfieldManTest.o -MD -MP -MF "$(DEPDIR)/aria2c-BitfieldManTest.Tpo" -c -o aria2c-BitfieldManTest.o `test -f 'BitfieldManTest.cc' || echo '$(srcdir)/'`BitfieldManTest.cc; \
|
|
||||||
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/aria2c-BitfieldManTest.Tpo" "$(DEPDIR)/aria2c-BitfieldManTest.Po"; else rm -f "$(DEPDIR)/aria2c-BitfieldManTest.Tpo"; exit 1; fi
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='BitfieldManTest.cc' object='aria2c-BitfieldManTest.o' libtool=no @AMDEPBACKSLASH@
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
|
||||||
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -c -o aria2c-BitfieldManTest.o `test -f 'BitfieldManTest.cc' || echo '$(srcdir)/'`BitfieldManTest.cc
|
|
||||||
|
|
||||||
aria2c-BitfieldManTest.obj: BitfieldManTest.cc
|
|
||||||
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -MT aria2c-BitfieldManTest.obj -MD -MP -MF "$(DEPDIR)/aria2c-BitfieldManTest.Tpo" -c -o aria2c-BitfieldManTest.obj `if test -f 'BitfieldManTest.cc'; then $(CYGPATH_W) 'BitfieldManTest.cc'; else $(CYGPATH_W) '$(srcdir)/BitfieldManTest.cc'; fi`; \
|
|
||||||
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/aria2c-BitfieldManTest.Tpo" "$(DEPDIR)/aria2c-BitfieldManTest.Po"; else rm -f "$(DEPDIR)/aria2c-BitfieldManTest.Tpo"; exit 1; fi
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='BitfieldManTest.cc' object='aria2c-BitfieldManTest.obj' libtool=no @AMDEPBACKSLASH@
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
|
||||||
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -c -o aria2c-BitfieldManTest.obj `if test -f 'BitfieldManTest.cc'; then $(CYGPATH_W) 'BitfieldManTest.cc'; else $(CYGPATH_W) '$(srcdir)/BitfieldManTest.cc'; fi`
|
|
||||||
|
|
||||||
aria2c-DefaultDiskWriterTest.o: DefaultDiskWriterTest.cc
|
|
||||||
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -MT aria2c-DefaultDiskWriterTest.o -MD -MP -MF "$(DEPDIR)/aria2c-DefaultDiskWriterTest.Tpo" -c -o aria2c-DefaultDiskWriterTest.o `test -f 'DefaultDiskWriterTest.cc' || echo '$(srcdir)/'`DefaultDiskWriterTest.cc; \
|
|
||||||
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/aria2c-DefaultDiskWriterTest.Tpo" "$(DEPDIR)/aria2c-DefaultDiskWriterTest.Po"; else rm -f "$(DEPDIR)/aria2c-DefaultDiskWriterTest.Tpo"; exit 1; fi
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='DefaultDiskWriterTest.cc' object='aria2c-DefaultDiskWriterTest.o' libtool=no @AMDEPBACKSLASH@
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
|
||||||
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -c -o aria2c-DefaultDiskWriterTest.o `test -f 'DefaultDiskWriterTest.cc' || echo '$(srcdir)/'`DefaultDiskWriterTest.cc
|
|
||||||
|
|
||||||
aria2c-DefaultDiskWriterTest.obj: DefaultDiskWriterTest.cc
|
|
||||||
@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -MT aria2c-DefaultDiskWriterTest.obj -MD -MP -MF "$(DEPDIR)/aria2c-DefaultDiskWriterTest.Tpo" -c -o aria2c-DefaultDiskWriterTest.obj `if test -f 'DefaultDiskWriterTest.cc'; then $(CYGPATH_W) 'DefaultDiskWriterTest.cc'; else $(CYGPATH_W) '$(srcdir)/DefaultDiskWriterTest.cc'; fi`; \
|
|
||||||
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/aria2c-DefaultDiskWriterTest.Tpo" "$(DEPDIR)/aria2c-DefaultDiskWriterTest.Po"; else rm -f "$(DEPDIR)/aria2c-DefaultDiskWriterTest.Tpo"; exit 1; fi
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='DefaultDiskWriterTest.cc' object='aria2c-DefaultDiskWriterTest.obj' libtool=no @AMDEPBACKSLASH@
|
|
||||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
|
||||||
@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(aria2c_CXXFLAGS) $(CXXFLAGS) -c -o aria2c-DefaultDiskWriterTest.obj `if test -f 'DefaultDiskWriterTest.cc'; then $(CYGPATH_W) 'DefaultDiskWriterTest.cc'; else $(CYGPATH_W) '$(srcdir)/DefaultDiskWriterTest.cc'; fi`
|
|
||||||
uninstall-info-am:
|
uninstall-info-am:
|
||||||
|
|
||||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||||
|
|
|
@ -62,14 +62,14 @@ void PeerMessageUtilTest::testCreatePeerMessageKeepAlive() {
|
||||||
char msg[4];
|
char msg[4];
|
||||||
memset(msg, 0, sizeof(msg));
|
memset(msg, 0, sizeof(msg));
|
||||||
PeerMessage* pm = PeerMessageUtil::createPeerMessage(NULL, 0);
|
PeerMessage* pm = PeerMessageUtil::createPeerMessage(NULL, 0);
|
||||||
CPPUNIT_ASSERT_EQUAL((int)PeerMessage::KEEP_ALIVE, pm->id);
|
CPPUNIT_ASSERT_EQUAL((int)PeerMessage::KEEP_ALIVE, pm->getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
void PeerMessageUtilTest::testCreatePeerMessageChoke() {
|
void PeerMessageUtilTest::testCreatePeerMessageChoke() {
|
||||||
char msg[5];
|
char msg[5];
|
||||||
createNLengthMessage(msg, sizeof(msg), 1, 0);
|
createNLengthMessage(msg, sizeof(msg), 1, 0);
|
||||||
PeerMessage* pm = PeerMessageUtil::createPeerMessage(&msg[4], 1);
|
PeerMessage* pm = PeerMessageUtil::createPeerMessage(&msg[4], 1);
|
||||||
CPPUNIT_ASSERT_EQUAL((int)PeerMessage::CHOKE, pm->id);
|
CPPUNIT_ASSERT_EQUAL((int)PeerMessage::CHOKE, pm->getId());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
char msg[6];
|
char msg[6];
|
||||||
|
@ -84,7 +84,7 @@ void PeerMessageUtilTest::testCreatePeerMessageUnchoke() {
|
||||||
char msg[5];
|
char msg[5];
|
||||||
createNLengthMessage(msg, sizeof(msg), 1, 1);
|
createNLengthMessage(msg, sizeof(msg), 1, 1);
|
||||||
PeerMessage* pm = PeerMessageUtil::createPeerMessage(&msg[4], 1);
|
PeerMessage* pm = PeerMessageUtil::createPeerMessage(&msg[4], 1);
|
||||||
CPPUNIT_ASSERT_EQUAL((int)PeerMessage::UNCHOKE, pm->id);
|
CPPUNIT_ASSERT_EQUAL((int)PeerMessage::UNCHOKE, pm->getId());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
char msg[6];
|
char msg[6];
|
||||||
|
@ -99,7 +99,7 @@ void PeerMessageUtilTest::testCreatePeerMessageInterested() {
|
||||||
char msg[5];
|
char msg[5];
|
||||||
createNLengthMessage(msg, sizeof(msg), 1, 2);
|
createNLengthMessage(msg, sizeof(msg), 1, 2);
|
||||||
PeerMessage* pm = PeerMessageUtil::createPeerMessage(&msg[4], 1);
|
PeerMessage* pm = PeerMessageUtil::createPeerMessage(&msg[4], 1);
|
||||||
CPPUNIT_ASSERT_EQUAL((int)PeerMessage::INTERESTED, pm->id);
|
CPPUNIT_ASSERT_EQUAL((int)PeerMessage::INTERESTED, pm->getId());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
char msg[6];
|
char msg[6];
|
||||||
|
@ -114,7 +114,7 @@ void PeerMessageUtilTest::testCreatePeerMessageNotInterested() {
|
||||||
char msg[5];
|
char msg[5];
|
||||||
createNLengthMessage(msg, sizeof(msg), 1, 3);
|
createNLengthMessage(msg, sizeof(msg), 1, 3);
|
||||||
PeerMessage* pm = PeerMessageUtil::createPeerMessage(&msg[4], 1);
|
PeerMessage* pm = PeerMessageUtil::createPeerMessage(&msg[4], 1);
|
||||||
CPPUNIT_ASSERT_EQUAL((int)PeerMessage::NOT_INTERESTED, pm->id);
|
CPPUNIT_ASSERT_EQUAL((int)PeerMessage::NOT_INTERESTED, pm->getId());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
char msg[6];
|
char msg[6];
|
||||||
|
@ -130,8 +130,8 @@ void PeerMessageUtilTest::testCreatePeerMessageHave() {
|
||||||
createNLengthMessage(msg, sizeof(msg), 5, 4);
|
createNLengthMessage(msg, sizeof(msg), 5, 4);
|
||||||
setIntParam(&msg[5], 100);
|
setIntParam(&msg[5], 100);
|
||||||
PeerMessage* pm = PeerMessageUtil::createPeerMessage(&msg[4], 5);
|
PeerMessage* pm = PeerMessageUtil::createPeerMessage(&msg[4], 5);
|
||||||
CPPUNIT_ASSERT_EQUAL((int)PeerMessage::HAVE, pm->id);
|
CPPUNIT_ASSERT_EQUAL((int)PeerMessage::HAVE, pm->getId());
|
||||||
CPPUNIT_ASSERT_EQUAL(100, pm->index);
|
CPPUNIT_ASSERT_EQUAL(100, pm->getIndex());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
char msg[8];
|
char msg[8];
|
||||||
|
@ -153,10 +153,10 @@ void PeerMessageUtilTest::testCreatePeerMessageBitfield() {
|
||||||
char* msg = new char[msgLen];
|
char* msg = new char[msgLen];
|
||||||
createNLengthMessage(msg, msgLen, 3, 5);
|
createNLengthMessage(msg, msgLen, 3, 5);
|
||||||
PeerMessage* pm = PeerMessageUtil::createPeerMessage(&msg[4], 3);
|
PeerMessage* pm = PeerMessageUtil::createPeerMessage(&msg[4], 3);
|
||||||
CPPUNIT_ASSERT_EQUAL((int)PeerMessage::BITFIELD, pm->id);
|
CPPUNIT_ASSERT_EQUAL((int)PeerMessage::BITFIELD, pm->getId());
|
||||||
CPPUNIT_ASSERT_EQUAL((unsigned char)0, pm->bitfield[0]);
|
CPPUNIT_ASSERT_EQUAL((unsigned char)0, pm->getBitfield()[0]);
|
||||||
CPPUNIT_ASSERT_EQUAL((unsigned char)0, pm->bitfield[1]);
|
CPPUNIT_ASSERT_EQUAL((unsigned char)0, pm->getBitfield()[1]);
|
||||||
CPPUNIT_ASSERT_EQUAL(2, pm->bitfieldLen);
|
CPPUNIT_ASSERT_EQUAL(2, pm->getBitfieldLength());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
int msgLen = 5;
|
int msgLen = 5;
|
||||||
|
@ -174,10 +174,10 @@ void PeerMessageUtilTest::testCreatePeerMessageRequest() {
|
||||||
setIntParam(&msg[9], 16*1024);
|
setIntParam(&msg[9], 16*1024);
|
||||||
setIntParam(&msg[13], 16*1024-1);
|
setIntParam(&msg[13], 16*1024-1);
|
||||||
PeerMessage* pm = PeerMessageUtil::createPeerMessage(&msg[4], 13);
|
PeerMessage* pm = PeerMessageUtil::createPeerMessage(&msg[4], 13);
|
||||||
CPPUNIT_ASSERT_EQUAL((int)PeerMessage::REQUEST, pm->id);
|
CPPUNIT_ASSERT_EQUAL((int)PeerMessage::REQUEST, pm->getId());
|
||||||
CPPUNIT_ASSERT_EQUAL(1, pm->index);
|
CPPUNIT_ASSERT_EQUAL(1, pm->getIndex());
|
||||||
CPPUNIT_ASSERT_EQUAL(16*1024, pm->begin);
|
CPPUNIT_ASSERT_EQUAL(16*1024, pm->getBegin());
|
||||||
CPPUNIT_ASSERT_EQUAL(16*1024-1, pm->length);
|
CPPUNIT_ASSERT_EQUAL(16*1024-1, pm->getLength());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
char msg[13];
|
char msg[13];
|
||||||
|
@ -195,12 +195,12 @@ void PeerMessageUtilTest::testCreatePeerMessagePiece() {
|
||||||
setIntParam(&msg[5], 1);
|
setIntParam(&msg[5], 1);
|
||||||
setIntParam(&msg[9], 16*1024);
|
setIntParam(&msg[9], 16*1024);
|
||||||
PeerMessage* pm = PeerMessageUtil::createPeerMessage(&msg[4], 19);
|
PeerMessage* pm = PeerMessageUtil::createPeerMessage(&msg[4], 19);
|
||||||
CPPUNIT_ASSERT_EQUAL((int)PeerMessage::PIECE, pm->id);
|
CPPUNIT_ASSERT_EQUAL((int)PeerMessage::PIECE, pm->getId());
|
||||||
CPPUNIT_ASSERT_EQUAL(1, pm->index);
|
CPPUNIT_ASSERT_EQUAL(1, pm->getIndex());
|
||||||
CPPUNIT_ASSERT_EQUAL(16*1024, pm->begin);
|
CPPUNIT_ASSERT_EQUAL(16*1024, pm->getBegin());
|
||||||
CPPUNIT_ASSERT_EQUAL(10, pm->blockLen);
|
CPPUNIT_ASSERT_EQUAL(10, pm->getBlockLength());
|
||||||
for(int i = 0; i < 10; i++) {
|
for(int i = 0; i < 10; i++) {
|
||||||
CPPUNIT_ASSERT_EQUAL((char)0, pm->block[i]);
|
CPPUNIT_ASSERT_EQUAL((char)0, pm->getBlock()[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -220,10 +220,10 @@ void PeerMessageUtilTest::testCreatePeerMessageCancel() {
|
||||||
setIntParam(&msg[9], 16*1024);
|
setIntParam(&msg[9], 16*1024);
|
||||||
setIntParam(&msg[13], 16*1024-1);
|
setIntParam(&msg[13], 16*1024-1);
|
||||||
PeerMessage* pm = PeerMessageUtil::createPeerMessage(&msg[4], 13);
|
PeerMessage* pm = PeerMessageUtil::createPeerMessage(&msg[4], 13);
|
||||||
CPPUNIT_ASSERT_EQUAL((int)PeerMessage::CANCEL, pm->id);
|
CPPUNIT_ASSERT_EQUAL((int)PeerMessage::CANCEL, pm->getId());
|
||||||
CPPUNIT_ASSERT_EQUAL(1, pm->index);
|
CPPUNIT_ASSERT_EQUAL(1, pm->getIndex());
|
||||||
CPPUNIT_ASSERT_EQUAL(16*1024, pm->begin);
|
CPPUNIT_ASSERT_EQUAL(16*1024, pm->getBegin());
|
||||||
CPPUNIT_ASSERT_EQUAL(16*1024-1, pm->length);
|
CPPUNIT_ASSERT_EQUAL(16*1024-1, pm->getLength());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
char msg[13];
|
char msg[13];
|
||||||
|
@ -237,8 +237,8 @@ void PeerMessageUtilTest::testCreatePeerMessageCancel() {
|
||||||
|
|
||||||
void PeerMessageUtilTest::testCheckIntegrityHave() {
|
void PeerMessageUtilTest::testCheckIntegrityHave() {
|
||||||
PeerMessage* pm = new PeerMessage();
|
PeerMessage* pm = new PeerMessage();
|
||||||
pm->id = PeerMessage::HAVE;
|
pm->setId(PeerMessage::HAVE);
|
||||||
pm->index = 119;
|
pm->setIndex(119);
|
||||||
try {
|
try {
|
||||||
PeerMessageUtil::checkIntegrity(pm, 256*1024, 120, 256*1024*120);
|
PeerMessageUtil::checkIntegrity(pm, 256*1024, 120, 256*1024*120);
|
||||||
} catch(Exception* ex) {
|
} catch(Exception* ex) {
|
||||||
|
@ -246,7 +246,7 @@ void PeerMessageUtilTest::testCheckIntegrityHave() {
|
||||||
CPPUNIT_FAIL("");
|
CPPUNIT_FAIL("");
|
||||||
}
|
}
|
||||||
|
|
||||||
pm->index = 120;
|
pm->setIndex(120);
|
||||||
try {
|
try {
|
||||||
PeerMessageUtil::checkIntegrity(pm, 256*1024, 120, 256*1024*120);
|
PeerMessageUtil::checkIntegrity(pm, 256*1024, 120, 256*1024*120);
|
||||||
CPPUNIT_FAIL("exception must be throwed.");
|
CPPUNIT_FAIL("exception must be throwed.");
|
||||||
|
@ -256,62 +256,68 @@ void PeerMessageUtilTest::testCheckIntegrityHave() {
|
||||||
|
|
||||||
void PeerMessageUtilTest::testCheckIntegrityBitfield() {
|
void PeerMessageUtilTest::testCheckIntegrityBitfield() {
|
||||||
PeerMessage* pm = new PeerMessage();
|
PeerMessage* pm = new PeerMessage();
|
||||||
pm->id = PeerMessage::BITFIELD;
|
pm->setId(PeerMessage::BITFIELD);
|
||||||
pm->bitfieldLen = 15;
|
int bitfieldLength = 15;
|
||||||
pm->bitfield = new unsigned char[pm->bitfieldLen];
|
unsigned char* bitfield = new unsigned char[bitfieldLength];
|
||||||
memset(pm->bitfield, 1, pm->bitfieldLen);
|
memset(bitfield, 0xff, bitfieldLength);
|
||||||
|
pm->setBitfield(bitfield, bitfieldLength);
|
||||||
try {
|
try {
|
||||||
PeerMessageUtil::checkIntegrity(pm, 256*1024, 120, 256*1024*120);
|
PeerMessageUtil::checkIntegrity(pm, 256*1024, 120, 256*1024*120);
|
||||||
} catch(Exception* ex) {
|
} catch(Exception* ex) {
|
||||||
cerr << ex->getMsg() << endl;
|
cerr << ex->getMsg() << endl;
|
||||||
CPPUNIT_FAIL("");
|
CPPUNIT_FAIL("");
|
||||||
}
|
}
|
||||||
|
delete [] bitfield;
|
||||||
pm->bitfieldLen = 16;
|
bitfieldLength = 16;
|
||||||
pm->bitfield = new unsigned char[pm->bitfieldLen];
|
bitfield = new unsigned char[bitfieldLength];
|
||||||
memset(pm->bitfield, 1, pm->bitfieldLen);
|
memset(bitfield, 0xff, bitfieldLength);
|
||||||
|
pm->setBitfield(bitfield, bitfieldLength);
|
||||||
try {
|
try {
|
||||||
PeerMessageUtil::checkIntegrity(pm, 256*1024, 120, 256*1024*120);
|
PeerMessageUtil::checkIntegrity(pm, 256*1024, 120, 256*1024*120);
|
||||||
CPPUNIT_FAIL("exception must be throwed.");
|
CPPUNIT_FAIL("exception must be throwed.");
|
||||||
} catch(Exception* ex) {
|
} catch(Exception* ex) {
|
||||||
}
|
}
|
||||||
|
delete [] bitfield;
|
||||||
pm->bitfieldLen = 14;
|
bitfieldLength = 14;
|
||||||
pm->bitfield = new unsigned char[pm->bitfieldLen];
|
bitfield = new unsigned char[bitfieldLength];
|
||||||
memset(pm->bitfield, 1, pm->bitfieldLen);
|
memset(bitfield, 0xff, bitfieldLength);
|
||||||
|
pm->setBitfield(bitfield, bitfieldLength);
|
||||||
try {
|
try {
|
||||||
PeerMessageUtil::checkIntegrity(pm, 256*1024, 120, 256*1024*120);
|
PeerMessageUtil::checkIntegrity(pm, 256*1024, 120, 256*1024*120);
|
||||||
CPPUNIT_FAIL("exception must be throwed.");
|
CPPUNIT_FAIL("exception must be throwed.");
|
||||||
} catch(Exception* ex) {
|
} catch(Exception* ex) {
|
||||||
}
|
}
|
||||||
|
delete [] bitfield;
|
||||||
pm->bitfieldLen = 15;
|
bitfieldLength = 15;
|
||||||
pm->bitfield = new unsigned char[pm->bitfieldLen];
|
bitfield = new unsigned char[bitfieldLength];
|
||||||
memset(pm->bitfield, 1, pm->bitfieldLen);
|
memset(bitfield, 0xff, bitfieldLength);
|
||||||
pm->bitfield[pm->bitfieldLen-1] &= 0xfe;
|
bitfield[bitfieldLength-1] &= 0xfe;
|
||||||
|
pm->setBitfield(bitfield, bitfieldLength);
|
||||||
try {
|
try {
|
||||||
PeerMessageUtil::checkIntegrity(pm, 256*1024, 119, 256*1024*120);
|
PeerMessageUtil::checkIntegrity(pm, 256*1024, 119, 256*1024*120);
|
||||||
} catch(Exception* ex) {
|
} catch(Exception* ex) {
|
||||||
cerr << ex->getMsg() << endl;
|
cerr << ex->getMsg() << endl;
|
||||||
CPPUNIT_FAIL("");
|
CPPUNIT_FAIL("");
|
||||||
}
|
}
|
||||||
|
delete [] bitfield;
|
||||||
pm->bitfieldLen = 15;
|
bitfieldLength = 15;
|
||||||
pm->bitfield = new unsigned char[pm->bitfieldLen];
|
bitfield = new unsigned char[bitfieldLength];
|
||||||
memset(pm->bitfield, 1, pm->bitfieldLen);
|
memset(bitfield, 0xff, bitfieldLength);
|
||||||
|
pm->setBitfield(bitfield, bitfieldLength);
|
||||||
try {
|
try {
|
||||||
PeerMessageUtil::checkIntegrity(pm, 256*1024, 119, 256*1024*120);
|
PeerMessageUtil::checkIntegrity(pm, 256*1024, 119, 256*1024*120);
|
||||||
CPPUNIT_FAIL("exception must be throwed.");
|
CPPUNIT_FAIL("exception must be throwed.");
|
||||||
} catch(Exception* ex) {
|
} catch(Exception* ex) {
|
||||||
}
|
}
|
||||||
|
delete [] bitfield;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PeerMessageUtilTest::testCheckIntegrityRequest() {
|
void PeerMessageUtilTest::testCheckIntegrityRequest() {
|
||||||
PeerMessage* pm = new PeerMessage();
|
PeerMessage* pm = new PeerMessage();
|
||||||
pm->id = PeerMessage::REQUEST;
|
pm->setId(PeerMessage::REQUEST);
|
||||||
pm->index = 119;
|
pm->setIndex(119);
|
||||||
pm->begin = 0;
|
pm->setBegin(0);
|
||||||
pm->length = 16*1024;
|
pm->setLength(16*1024);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
PeerMessageUtil::checkIntegrity(pm, 256*1024, 120, 256*1024*120);
|
PeerMessageUtil::checkIntegrity(pm, 256*1024, 120, 256*1024*120);
|
||||||
|
@ -320,33 +326,24 @@ void PeerMessageUtilTest::testCheckIntegrityRequest() {
|
||||||
CPPUNIT_FAIL("");
|
CPPUNIT_FAIL("");
|
||||||
}
|
}
|
||||||
|
|
||||||
pm->begin = 256*1024;
|
pm->setBegin(256*1024);
|
||||||
pm->length = 16*1024;
|
pm->setLength(16*1024);
|
||||||
try {
|
try {
|
||||||
PeerMessageUtil::checkIntegrity(pm, 256*1024, 120, 256*1024*120);
|
PeerMessageUtil::checkIntegrity(pm, 256*1024, 120, 256*1024*120);
|
||||||
CPPUNIT_FAIL("exception must be throwed.");
|
CPPUNIT_FAIL("exception must be throwed.");
|
||||||
} catch(Exception* ex) {}
|
} catch(Exception* ex) {}
|
||||||
|
|
||||||
pm->begin = 0;
|
pm->setBegin(0);
|
||||||
pm->length = 256*1024+1;
|
pm->setLength(256*1024);
|
||||||
try {
|
try {
|
||||||
PeerMessageUtil::checkIntegrity(pm, 256*1024, 120, 256*1024*120);
|
PeerMessageUtil::checkIntegrity(pm, 256*1024, 120, 256*1024*120);
|
||||||
CPPUNIT_FAIL("exception must be throwed.");
|
CPPUNIT_FAIL("exception must be throwed.");
|
||||||
} catch(Exception* ex) {}
|
} catch(Exception* ex) {}
|
||||||
|
|
||||||
pm->begin = 0;
|
pm->setBegin(0);
|
||||||
pm->length = 256*1024;
|
pm->setLength(5);
|
||||||
try {
|
try {
|
||||||
PeerMessageUtil::checkIntegrity(pm, 256*1024, 120, 256*1024*120);
|
PeerMessageUtil::checkIntegrity(pm, 256*1024, 120, 256*1024*120);
|
||||||
} catch(Exception* ex) {
|
|
||||||
cerr << ex->getMsg() << endl;
|
|
||||||
CPPUNIT_FAIL("");
|
|
||||||
}
|
|
||||||
|
|
||||||
pm->begin = 0;
|
|
||||||
pm->length = 256*1024;
|
|
||||||
try {
|
|
||||||
PeerMessageUtil::checkIntegrity(pm, 256*1024, 120, 256*1024*120-1);
|
|
||||||
CPPUNIT_FAIL("exception must be throwed.");
|
CPPUNIT_FAIL("exception must be throwed.");
|
||||||
} catch(Exception* ex) {}
|
} catch(Exception* ex) {}
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,7 +39,7 @@ void ShaVisitorTest::testVisit() {
|
||||||
ShaVisitor v;
|
ShaVisitor v;
|
||||||
Data d("test", 4);
|
Data d("test", 4);
|
||||||
d.accept(&v);
|
d.accept(&v);
|
||||||
unsigned char md[EVP_MAX_MD_SIZE];
|
unsigned char md[20];
|
||||||
int len = 0;
|
int len = 0;
|
||||||
v.getHash(md, len);
|
v.getHash(md, len);
|
||||||
string hashHex = hexHash(md, len);
|
string hashHex = hexHash(md, len);
|
||||||
|
@ -51,7 +51,7 @@ void ShaVisitorTest::testVisitCompound() {
|
||||||
ShaVisitor v;
|
ShaVisitor v;
|
||||||
MetaEntry* e = MetaFileUtil::parseMetaFile("test.torrent");
|
MetaEntry* e = MetaFileUtil::parseMetaFile("test.torrent");
|
||||||
e->accept(&v);
|
e->accept(&v);
|
||||||
unsigned char md[EVP_MAX_MD_SIZE];
|
unsigned char md[20];
|
||||||
int len = 0;
|
int len = 0;
|
||||||
v.getHash(md, len);
|
v.getHash(md, len);
|
||||||
string hashHex = hexHash(md, len);
|
string hashHex = hexHash(md, len);
|
||||||
|
|
|
@ -7,12 +7,14 @@ using namespace std;
|
||||||
class TorrentManTest:public CppUnit::TestFixture {
|
class TorrentManTest:public CppUnit::TestFixture {
|
||||||
|
|
||||||
CPPUNIT_TEST_SUITE(TorrentManTest);
|
CPPUNIT_TEST_SUITE(TorrentManTest);
|
||||||
|
/*
|
||||||
CPPUNIT_TEST(testUpdatePeers);
|
CPPUNIT_TEST(testUpdatePeers);
|
||||||
//CPPUNIT_TEST(testUpdatePeer);
|
//CPPUNIT_TEST(testUpdatePeer);
|
||||||
CPPUNIT_TEST(testGetPeer);
|
CPPUNIT_TEST(testGetPeer);
|
||||||
CPPUNIT_TEST(testGetMissingPiece);
|
CPPUNIT_TEST(testGetMissingPiece);
|
||||||
CPPUNIT_TEST(testCancelPiece);
|
CPPUNIT_TEST(testCancelPiece);
|
||||||
CPPUNIT_TEST(testAddPeer);
|
CPPUNIT_TEST(testAddPeer);
|
||||||
|
*/
|
||||||
CPPUNIT_TEST_SUITE_END();
|
CPPUNIT_TEST_SUITE_END();
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@ -44,7 +46,7 @@ Peers createPeers() {
|
||||||
peers.push_back(peer3);
|
peers.push_back(peer3);
|
||||||
return peers;
|
return peers;
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
void TorrentManTest::testUpdatePeers() {
|
void TorrentManTest::testUpdatePeers() {
|
||||||
TorrentMan tm;
|
TorrentMan tm;
|
||||||
Peers peers = createPeers();
|
Peers peers = createPeers();
|
||||||
|
@ -58,7 +60,7 @@ void TorrentManTest::testUpdatePeers() {
|
||||||
CPPUNIT_ASSERT_EQUAL(string("192.168.0.3"), (*itr)->ipaddr);
|
CPPUNIT_ASSERT_EQUAL(string("192.168.0.3"), (*itr)->ipaddr);
|
||||||
itr++;
|
itr++;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
/*
|
/*
|
||||||
void TorrentManTest::testUpdatePeer() {
|
void TorrentManTest::testUpdatePeer() {
|
||||||
TorrentMan tm;
|
TorrentMan tm;
|
||||||
|
@ -88,7 +90,7 @@ void TorrentManTest::testUpdatePeer() {
|
||||||
itr++;
|
itr++;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
/*
|
||||||
void TorrentManTest::testGetPeer() {
|
void TorrentManTest::testGetPeer() {
|
||||||
TorrentMan tm;
|
TorrentMan tm;
|
||||||
Peers peers = createPeers();
|
Peers peers = createPeers();
|
||||||
|
@ -186,3 +188,4 @@ void TorrentManTest::testAddPeer() {
|
||||||
CPPUNIT_ASSERT_EQUAL(5, (int)tm.getPeers().size());
|
CPPUNIT_ASSERT_EQUAL(5, (int)tm.getPeers().size());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
|
@ -70,13 +70,13 @@ void UtilTest::testSplit() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void UtilTest::testSlice() {
|
void UtilTest::testSlice() {
|
||||||
vector<string> v1;
|
Strings v1;
|
||||||
Util::slice(v1, "name1=value1; name2=value2; name3=value3;", ';');
|
Util::slice(v1, "name1=value1; name2=value2; name3=value3;", ';');
|
||||||
CPPUNIT_ASSERT_EQUAL(3, (int)v1.size());
|
CPPUNIT_ASSERT_EQUAL(3, (int)v1.size());
|
||||||
v1.clear();
|
v1.clear();
|
||||||
Util::slice(v1, "name1=value1; name2=value2; name3=value3", ';');
|
Util::slice(v1, "name1=value1; name2=value2; name3=value3", ';');
|
||||||
CPPUNIT_ASSERT_EQUAL(3, (int)v1.size());
|
CPPUNIT_ASSERT_EQUAL(3, (int)v1.size());
|
||||||
vector<string>::iterator itr = v1.begin();
|
Strings::iterator itr = v1.begin();
|
||||||
CPPUNIT_ASSERT_EQUAL(string("name1=value1"), *itr++);
|
CPPUNIT_ASSERT_EQUAL(string("name1=value1"), *itr++);
|
||||||
CPPUNIT_ASSERT_EQUAL(string("name2=value2"), *itr++);
|
CPPUNIT_ASSERT_EQUAL(string("name2=value2"), *itr++);
|
||||||
CPPUNIT_ASSERT_EQUAL(string("name3=value3"), *itr++);
|
CPPUNIT_ASSERT_EQUAL(string("name3=value3"), *itr++);
|
||||||
|
|
Loading…
Reference in New Issue