summaryrefslogtreecommitdiff
path: root/src/AbstractCommand.h
diff options
context:
space:
mode:
authorNils Maier <maierman@web.de>2013-11-26 02:59:51 +0100
committerNils Maier <maierman@web.de>2013-12-09 15:41:43 +0100
commit2db0c81fc8067d73230fcbffc90bd7ad1f9c07b0 (patch)
treea6c37eaa4de5ef4c8b4e982cb7d87c1f6ac5bf3b /src/AbstractCommand.h
parent1323048ab1a254510e32d47f5549f4e30d273e5a (diff)
Stuff memory holes
Padding changes on x86_64: - RequestGroup: 29 -> 5 bytes - DownloadContext: 25 -> 1 bytes - Cookie: 20 -> 4 bytes - Command: 8 -> 0 bytes (affects many derived as well) - HttpRequest: 20 -> 4 bytes - DownloadCommand: 18 -> 2 bytes - TimeBasedCommand: 14 -> 6 bytes - AbstractCommand: 13 -> 5 bytes - HttpSkipResponseCommand: 12 -> 4 bytes - FileEntry: 10 -> 2 bytes - DownloadResult: 15 -> 7 bytes - UriStruct: 12 -> 4 bytes - Piece: 11 -> 3 bytes - BitfieldMan -> 11 -> 3 bytes
Diffstat (limited to 'src/AbstractCommand.h')
-rw-r--r--src/AbstractCommand.h34
1 files changed, 18 insertions, 16 deletions
diff --git a/src/AbstractCommand.h b/src/AbstractCommand.h
index 23fb4950..7f6c9429 100644
--- a/src/AbstractCommand.h
+++ b/src/AbstractCommand.h
@@ -64,31 +64,34 @@ class AsyncNameResolverMan;
class AbstractCommand : public Command {
private:
- Timer checkPoint_;
- time_t timeout_;
-
- RequestGroup* requestGroup_;
std::shared_ptr<Request> req_;
std::shared_ptr<FileEntry> fileEntry_;
- DownloadEngine* e_;
std::shared_ptr<SocketCore> socket_;
std::shared_ptr<SocketRecvBuffer> socketRecvBuffer_;
- std::vector<std::shared_ptr<Segment> > segments_;
+ std::shared_ptr<SocketCore> readCheckTarget_;
+ std::shared_ptr<SocketCore> writeCheckTarget_;
#ifdef ENABLE_ASYNC_DNS
std::unique_ptr<AsyncNameResolverMan> asyncNameResolverMan_;
#endif // ENABLE_ASYNC_DNS
+ RequestGroup* requestGroup_;
+ DownloadEngine* e_;
+
+ std::vector<std::shared_ptr<Segment> > segments_;
+
+ Timer checkPoint_;
+ Timer serverStatTimer_;
+ time_t timeout_;
+
bool checkSocketIsReadable_;
bool checkSocketIsWritable_;
- std::shared_ptr<SocketCore> readCheckTarget_;
- std::shared_ptr<SocketCore> writeCheckTarget_;
bool incNumConnection_;
- Timer serverStatTimer_;
int32_t calculateMinSplitSize() const;
void useFasterRequest(const std::shared_ptr<Request>& fasterRequest);
+
public:
RequestGroup* getRequestGroup() const
{
@@ -234,13 +237,12 @@ protected:
}
public:
- AbstractCommand
- (cuid_t cuid, const std::shared_ptr<Request>& req,
- const std::shared_ptr<FileEntry>& fileEntry,
- RequestGroup* requestGroup, DownloadEngine* e,
- const std::shared_ptr<SocketCore>& s = nullptr,
- const std::shared_ptr<SocketRecvBuffer>& socketRecvBuffer = nullptr,
- bool incNumConnection = true);
+ AbstractCommand(cuid_t cuid, const std::shared_ptr<Request>& req,
+ const std::shared_ptr<FileEntry>& fileEntry,
+ RequestGroup* requestGroup, DownloadEngine* e,
+ const std::shared_ptr<SocketCore>& s = nullptr,
+ const std::shared_ptr<SocketRecvBuffer>& socketRecvBuffer = nullptr,
+ bool incNumConnection = true);
virtual ~AbstractCommand();
virtual bool execute() CXX11_OVERRIDE;