From 8f2af33b6dd33e7937480e37f06d325e812dee8f Mon Sep 17 00:00:00 2001 From: Nils Maier Date: Tue, 15 Jul 2014 08:15:46 +0200 Subject: Delay auth failures instead of PBKDF2 Closes GH-256 --- src/DelayedCommand.h | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 src/DelayedCommand.h (limited to 'src/DelayedCommand.h') diff --git a/src/DelayedCommand.h b/src/DelayedCommand.h new file mode 100644 index 00000000..b02bffa0 --- /dev/null +++ b/src/DelayedCommand.h @@ -0,0 +1,75 @@ +/* */ + +#ifndef D_DELAYED_COMMAND_H +#define D_DELAYED_COMMAND_H + +#include "TimeBasedCommand.h" + +namespace aria2 +{ + +class DelayedCommand : public TimeBasedCommand +{ +private: + std::unique_ptr command_; + bool noWait_; + +public: + virtual void process() CXX11_OVERRIDE + { + auto e = getDownloadEngine(); + e->addCommand(std::move(command_)); + if (noWait_) { + e->setNoWait(true); + } + enableExit(); + } + +public: + DelayedCommand(cuid_t cuid, DownloadEngine* e, time_t delay, + std::unique_ptr command, bool noWait) + : TimeBasedCommand(cuid, e, delay), + command_{std::move(command)}, + noWait_{noWait} + { + } + + virtual ~DelayedCommand() {} +}; + +} // namespace aria2 + +#endif // D_DELAYED_COMMAND_H -- cgit