diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2008-02-28 17:40:47 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2008-02-28 17:40:47 +0000 |
| commit | 3698b4680592accd47df25d904a5e240a2f43f5d (patch) | |
| tree | 090a1264805576e95077262acdaf5e2bdc1cdb7b /src/DownloadCommand.h | |
| parent | a1458a1642b6582c0b316e094e5008a10b4963a8 (diff) | |
2008-02-29 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Create MessageDigestHelper::staticSHA1DigestInit() which uses
statically declared sha1 MessageDigestContext.
* src/BtPieceMessage.cc: Use staticSHA1DigestInit() to avoid
initialization of short-lived MessageDigestContext.
* src/MessageDigestHelper.{h, cc}
* src/main.cc
Now DownloadCommand has a reference to MessageDigestContext to avoid
the initialization of MessageDigestContext every time in validating
chunk checksum.
* src/DownloadCommand.{h, cc}
Diffstat (limited to 'src/DownloadCommand.h')
| -rw-r--r-- | src/DownloadCommand.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/DownloadCommand.h b/src/DownloadCommand.h index 0b7c436b..a8ae9ad1 100644 --- a/src/DownloadCommand.h +++ b/src/DownloadCommand.h @@ -41,6 +41,9 @@ namespace aria2 { class TransferEncoding; class PeerStat; +#ifdef ENABLE_MESSAGE_DIGEST +class MessageDigestContext; +#endif // ENABLE_MESSAGE_DIGEST class DownloadCommand : public AbstractCommand { private: @@ -48,6 +51,9 @@ private: int32_t startupIdleTime; int32_t lowestDownloadSpeedLimit; SharedHandle<PeerStat> peerStat; +#ifdef ENABLE_MESSAGE_DIGEST + MessageDigestContext* _messageDigestContext; +#endif // ENABLE_MESSAGE_DIGEST void validatePieceHash(const SharedHandle<Segment>& segment); |
