diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2014-05-31 16:14:33 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2014-05-31 16:19:57 +0900 |
| commit | 631f37433a8fda03eb057e9f01e2811111c60d5e (patch) | |
| tree | 5423c539ab253a6249b0bce5e42ba6fe69b0c45d /src/RequestGroupMan.cc | |
| parent | 998fba3264c1e896a249f140cb6060cc35c7d6bc (diff) | |
Save session only when there is change since the last serialization
This is a slight optimization not to cause useless disk access. This
only applies to saving session automatically (see
--save-session-interval). aria2.saveSession and serialization at the
end of the session are always performed as before.
When serialization, we first check that whether there is any change
since the last serialization. To do this, we first calculate hash
value of serialized content without writing into file. Then compare
this value to the value of last serialization. If they do not match,
perform serialization.
Diffstat (limited to 'src/RequestGroupMan.cc')
| -rw-r--r-- | src/RequestGroupMan.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/RequestGroupMan.cc b/src/RequestGroupMan.cc index ac2eba8f..92c3b8c6 100644 --- a/src/RequestGroupMan.cc +++ b/src/RequestGroupMan.cc @@ -81,6 +81,7 @@ #include "PieceStorage.h" #include "DiskAdaptor.h" #include "SimpleRandomizer.h" +#include "array_fun.h" #ifdef ENABLE_BITTORRENT # include "bittorrent_helper.h" #endif // ENABLE_BITTORRENT |
