mirror of https://github.com/aria2/aria2
Hygiene: Fix some clang warnings, mostly unused private members.
parent
62f842579d
commit
7f6a446750
|
@ -44,7 +44,7 @@
|
|||
|
||||
namespace aria2 {
|
||||
|
||||
class UDPTrackerRequest;
|
||||
struct UDPTrackerRequest;
|
||||
|
||||
class BtAnnounce {
|
||||
public:
|
||||
|
|
|
@ -76,8 +76,7 @@ HttpConnection::HttpConnection
|
|||
: cuid_(cuid),
|
||||
socket_(socket),
|
||||
socketRecvBuffer_(socketRecvBuffer),
|
||||
socketBuffer_(socket),
|
||||
option_(0)
|
||||
socketBuffer_(socket)
|
||||
{}
|
||||
|
||||
HttpConnection::~HttpConnection() {}
|
||||
|
|
|
@ -82,7 +82,6 @@ private:
|
|||
SharedHandle<SocketCore> socket_;
|
||||
SharedHandle<SocketRecvBuffer> socketRecvBuffer_;
|
||||
SocketBuffer socketBuffer_;
|
||||
const Option* option_;
|
||||
|
||||
HttpRequestEntries outstandingHttpRequests_;
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
|
||||
namespace aria2 {
|
||||
|
||||
class Range;
|
||||
struct Range;
|
||||
|
||||
class HttpHeader {
|
||||
private:
|
||||
|
|
|
@ -48,7 +48,7 @@ namespace aria2 {
|
|||
|
||||
class Request;
|
||||
class Segment;
|
||||
class Range;
|
||||
struct Range;
|
||||
class Option;
|
||||
class CookieStorage;
|
||||
class AuthConfigFactory;
|
||||
|
|
|
@ -57,13 +57,10 @@
|
|||
|
||||
namespace aria2 {
|
||||
|
||||
HttpServer::HttpServer
|
||||
(const SharedHandle<SocketCore>& socket,
|
||||
DownloadEngine* e)
|
||||
HttpServer::HttpServer(const SharedHandle<SocketCore>& socket)
|
||||
: socket_(socket),
|
||||
socketRecvBuffer_(new SocketRecvBuffer(socket_)),
|
||||
socketBuffer_(socket),
|
||||
e_(e),
|
||||
headerProcessor_(new HttpHeaderProcessor
|
||||
(HttpHeaderProcessor::SERVER_PARSER)),
|
||||
lastContentLength_(0),
|
||||
|
|
|
@ -67,7 +67,6 @@ private:
|
|||
SharedHandle<SocketCore> socket_;
|
||||
SharedHandle<SocketRecvBuffer> socketRecvBuffer_;
|
||||
SocketBuffer socketBuffer_;
|
||||
DownloadEngine* e_;
|
||||
SharedHandle<HttpHeaderProcessor> headerProcessor_;
|
||||
SharedHandle<HttpHeader> lastRequestHeader_;
|
||||
int64_t lastContentLength_;
|
||||
|
@ -84,7 +83,7 @@ private:
|
|||
std::string allowOrigin_;
|
||||
bool secure_;
|
||||
public:
|
||||
HttpServer(const SharedHandle<SocketCore>& socket, DownloadEngine* e);
|
||||
HttpServer(const SharedHandle<SocketCore>& socket);
|
||||
|
||||
~HttpServer();
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ HttpServerCommand::HttpServerCommand
|
|||
: Command(cuid),
|
||||
e_(e),
|
||||
socket_(socket),
|
||||
httpServer_(new HttpServer(socket, e)),
|
||||
httpServer_(new HttpServer(socket)),
|
||||
writeCheck_(false)
|
||||
{
|
||||
setStatus(Command::STATUS_ONESHOT_REALTIME);
|
||||
|
|
|
@ -48,8 +48,7 @@ MultiFileAllocationIterator::MultiFileAllocationIterator
|
|||
(MultiDiskAdaptor* diskAdaptor):
|
||||
diskAdaptor_(diskAdaptor),
|
||||
entries_(diskAdaptor_->diskWriterEntries_.begin(),
|
||||
diskAdaptor_->diskWriterEntries_.end()),
|
||||
offset_(0)
|
||||
diskAdaptor_->diskWriterEntries_.end())
|
||||
{}
|
||||
|
||||
MultiFileAllocationIterator::~MultiFileAllocationIterator() {}
|
||||
|
|
|
@ -49,7 +49,6 @@ private:
|
|||
MultiDiskAdaptor* diskAdaptor_;
|
||||
std::deque<SharedHandle<DiskWriterEntry> > entries_;
|
||||
SharedHandle<FileAllocationIterator> fileAllocationIterator_;
|
||||
int64_t offset_;
|
||||
public:
|
||||
MultiFileAllocationIterator(MultiDiskAdaptor* diskAdaptor);
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ class DownloadEngine;
|
|||
#ifdef ENABLE_ASYNC_DNS
|
||||
class AsyncNameResolver;
|
||||
#endif // ENABLE_ASYNC_DNS
|
||||
class UDPTrackerRequest;
|
||||
struct UDPTrackerRequest;
|
||||
|
||||
class NameResolveCommand:public Command {
|
||||
private:
|
||||
|
|
|
@ -631,7 +631,7 @@ void RequestGroup::initPieceStorage()
|
|||
tempPieceStorage.swap(psHolder);
|
||||
} else {
|
||||
UnknownLengthPieceStorage* ps =
|
||||
new UnknownLengthPieceStorage(downloadContext_, option_.get());
|
||||
new UnknownLengthPieceStorage(downloadContext_);
|
||||
SharedHandle<PieceStorage> psHolder(ps);
|
||||
if(diskWriterFactory_) {
|
||||
ps->setDiskWriterFactory(diskWriterFactory_);
|
||||
|
@ -639,8 +639,8 @@ void RequestGroup::initPieceStorage()
|
|||
tempPieceStorage.swap(psHolder);
|
||||
}
|
||||
tempPieceStorage->initStorage();
|
||||
SharedHandle<SegmentMan> tempSegmentMan
|
||||
(new SegmentMan(option_.get(), downloadContext_, tempPieceStorage));
|
||||
SharedHandle<SegmentMan> tempSegmentMan(new SegmentMan(downloadContext_,
|
||||
tempPieceStorage));
|
||||
|
||||
pieceStorage_.swap(tempPieceStorage);
|
||||
segmentMan_.swap(tempSegmentMan);
|
||||
|
|
|
@ -605,7 +605,7 @@ RequestGroupMan::DownloadStat RequestGroupMan::getDownloadStat() const
|
|||
lastError = dr->result;
|
||||
}
|
||||
}
|
||||
return DownloadStat(finished, error, inprogress, removed,
|
||||
return DownloadStat(error, inprogress,
|
||||
reservedGroups_.size(),
|
||||
lastError);
|
||||
}
|
||||
|
|
|
@ -191,24 +191,18 @@ public:
|
|||
|
||||
class DownloadStat {
|
||||
private:
|
||||
int completed_;
|
||||
int error_;
|
||||
int inProgress_;
|
||||
int removed_;
|
||||
int waiting_;
|
||||
error_code::Value lastErrorResult_;
|
||||
public:
|
||||
DownloadStat(int completed,
|
||||
int error,
|
||||
DownloadStat(int error,
|
||||
int inProgress,
|
||||
int removed,
|
||||
int waiting,
|
||||
error_code::Value lastErrorResult =
|
||||
error_code::FINISHED):
|
||||
completed_(completed),
|
||||
error_(error),
|
||||
inProgress_(inProgress),
|
||||
removed_(removed),
|
||||
waiting_(waiting),
|
||||
lastErrorResult_(lastErrorResult) {}
|
||||
|
||||
|
|
|
@ -65,11 +65,9 @@ SegmentEntry::SegmentEntry(cuid_t cuid, const SharedHandle<Segment>& segment)
|
|||
SegmentEntry::~SegmentEntry() {}
|
||||
|
||||
SegmentMan::SegmentMan
|
||||
(const Option* option,
|
||||
const SharedHandle<DownloadContext>& downloadContext,
|
||||
(const SharedHandle<DownloadContext>& downloadContext,
|
||||
const SharedHandle<PieceStorage>& pieceStorage)
|
||||
: option_(option),
|
||||
downloadContext_(downloadContext),
|
||||
: downloadContext_(downloadContext),
|
||||
pieceStorage_(pieceStorage),
|
||||
ignoreBitfield_(downloadContext->getPieceLength(),
|
||||
downloadContext->getTotalLength())
|
||||
|
|
|
@ -75,8 +75,6 @@ typedef std::deque<SharedHandle<SegmentEntry> > SegmentEntries;
|
|||
*/
|
||||
class SegmentMan {
|
||||
private:
|
||||
const Option* option_;
|
||||
|
||||
SharedHandle<DownloadContext> downloadContext_;
|
||||
|
||||
SharedHandle<PieceStorage> pieceStorage_;
|
||||
|
@ -100,8 +98,7 @@ private:
|
|||
|
||||
void cancelSegmentInternal(cuid_t cuid, const SharedHandle<Segment>& segment);
|
||||
public:
|
||||
SegmentMan(const Option* option,
|
||||
const SharedHandle<DownloadContext>& downloadContext,
|
||||
SegmentMan(const SharedHandle<DownloadContext>& downloadContext,
|
||||
const SharedHandle<PieceStorage>& pieceStorage);
|
||||
|
||||
~SegmentMan();
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
|
||||
namespace aria2 {
|
||||
|
||||
class ProgressUpdate;
|
||||
struct ProgressUpdate;
|
||||
|
||||
class SimpleBtMessage : public AbstractBtMessage {
|
||||
public:
|
||||
|
|
|
@ -50,7 +50,7 @@ class PieceStorage;
|
|||
class BtRuntime;
|
||||
class BtAnnounce;
|
||||
class Option;
|
||||
class UDPTrackerRequest;
|
||||
struct UDPTrackerRequest;
|
||||
class UDPTrackerClient;
|
||||
|
||||
class AnnRequest {
|
||||
|
|
|
@ -48,7 +48,7 @@ namespace aria2 {
|
|||
|
||||
#define UDPT_INITIAL_CONNECTION_ID 0x41727101980LL
|
||||
|
||||
class UDPTrackerRequest;
|
||||
struct UDPTrackerRequest;
|
||||
|
||||
enum UDPTrackerConnectionState {
|
||||
UDPT_CST_CONNECTING,
|
||||
|
|
|
@ -47,10 +47,8 @@
|
|||
namespace aria2 {
|
||||
|
||||
UnknownLengthPieceStorage::UnknownLengthPieceStorage
|
||||
(const SharedHandle<DownloadContext>& downloadContext,
|
||||
const Option* option):
|
||||
downloadContext_(downloadContext),
|
||||
option_(option),
|
||||
(const SharedHandle<DownloadContext>& downloadContext)
|
||||
: downloadContext_(downloadContext),
|
||||
diskWriterFactory_(new DefaultDiskWriterFactory()),
|
||||
totalLength_(0),
|
||||
downloadFinished_(false) {}
|
||||
|
|
|
@ -48,8 +48,6 @@ class UnknownLengthPieceStorage:public PieceStorage {
|
|||
private:
|
||||
SharedHandle<DownloadContext> downloadContext_;
|
||||
|
||||
const Option* option_;
|
||||
|
||||
SharedHandle<DirectDiskAdaptor> diskAdaptor_;
|
||||
|
||||
SharedHandle<DiskWriterFactory> diskWriterFactory_;
|
||||
|
@ -60,8 +58,7 @@ private:
|
|||
|
||||
SharedHandle<Piece> piece_;
|
||||
public:
|
||||
UnknownLengthPieceStorage(const SharedHandle<DownloadContext>& downloadContext,
|
||||
const Option* option);
|
||||
UnknownLengthPieceStorage(const SharedHandle<DownloadContext>& downloadContext);
|
||||
|
||||
virtual ~UnknownLengthPieceStorage();
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ public:
|
|||
dctx_.reset
|
||||
(new DownloadContext(pieceLength, totalLength, "aria2.tar.bz2"));
|
||||
pieceStorage_.reset(new DefaultPieceStorage(dctx_, option_.get()));
|
||||
segmentMan_.reset(new SegmentMan(option_.get(), dctx_, pieceStorage_));
|
||||
segmentMan_.reset(new SegmentMan(dctx_, pieceStorage_));
|
||||
}
|
||||
|
||||
void testNullBitfield();
|
||||
|
@ -59,8 +59,8 @@ void SegmentManTest::testNullBitfield()
|
|||
SharedHandle<DownloadContext> dctx
|
||||
(new DownloadContext(0, 0, "aria2.tar.bz2"));
|
||||
SharedHandle<UnknownLengthPieceStorage> ps
|
||||
(new UnknownLengthPieceStorage(dctx, &op));
|
||||
SegmentMan segmentMan(&op, dctx, ps);
|
||||
(new UnknownLengthPieceStorage(dctx));
|
||||
SegmentMan segmentMan(dctx, ps);
|
||||
size_t minSplitSize = dctx->getPieceLength();
|
||||
|
||||
SharedHandle<Segment> segment = segmentMan.getSegment(1, minSplitSize);
|
||||
|
@ -86,7 +86,7 @@ void SegmentManTest::testCompleteSegment()
|
|||
(new DownloadContext(pieceLength, totalLength, "aria2.tar.bz2"));
|
||||
SharedHandle<DefaultPieceStorage> ps(new DefaultPieceStorage(dctx, &op));
|
||||
|
||||
SegmentMan segmentMan(&op, dctx, ps);
|
||||
SegmentMan segmentMan(dctx, ps);
|
||||
|
||||
CPPUNIT_ASSERT(segmentMan.getSegmentWithIndex(1, 0));
|
||||
SharedHandle<Segment> seg = segmentMan.getSegmentWithIndex(1, 1);
|
||||
|
@ -115,7 +115,7 @@ void SegmentManTest::testGetSegment_sameFileEntry()
|
|||
};
|
||||
dctx->setFileEntries(&fileEntries[0], &fileEntries[3]);
|
||||
SharedHandle<DefaultPieceStorage> ps(new DefaultPieceStorage(dctx, &op));
|
||||
SegmentMan segman(&op, dctx, ps);
|
||||
SegmentMan segman(dctx, ps);
|
||||
size_t minSplitSize =dctx->getPieceLength();
|
||||
std::vector<SharedHandle<Segment> > segments;
|
||||
segman.getSegment(segments, 1, minSplitSize, fileEntries[1], 4);
|
||||
|
@ -150,7 +150,7 @@ void SegmentManTest::testRegisterPeerStat()
|
|||
Option op;
|
||||
SharedHandle<DownloadContext> dctx(new DownloadContext());
|
||||
SharedHandle<DefaultPieceStorage> ps(new DefaultPieceStorage(dctx, &op));
|
||||
SegmentMan segman(&op, dctx, ps);
|
||||
SegmentMan segman(dctx, ps);
|
||||
|
||||
SharedHandle<PeerStat> p1(new PeerStat(0, "host1", "http"));
|
||||
segman.registerPeerStat(p1);
|
||||
|
|
|
@ -13,7 +13,7 @@ class MessageDigest;
|
|||
class RequestGroupMan;
|
||||
class RequestGroup;
|
||||
class Option;
|
||||
class DownloadResult;
|
||||
struct DownloadResult;
|
||||
|
||||
void createFile(const std::string& filename, size_t length);
|
||||
|
||||
|
|
Loading…
Reference in New Issue