summaryrefslogtreecommitdiff
path: root/src/DownloadCommand.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/DownloadCommand.cc')
-rw-r--r--src/DownloadCommand.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/DownloadCommand.cc b/src/DownloadCommand.cc
index 59b6cff1..bdc514a3 100644
--- a/src/DownloadCommand.cc
+++ b/src/DownloadCommand.cc
@@ -44,6 +44,7 @@
# include "ChecksumCommand.h"
#endif // ENABLE_MESSAGE_DIGEST
#include <sys/time.h>
+#include <stdlib.h>
DownloadCommand::DownloadCommand(int cuid,
const RequestHandle req,
@@ -71,7 +72,11 @@ bool DownloadCommand::executeInternal() {
// TODO we need to specify the sum of all segmentMan's download speed here.
if(maxDownloadSpeedLimit > 0 &&
maxDownloadSpeedLimit < _requestGroup->getSegmentMan()->calculateDownloadSpeed()) {
+#ifdef HAVE_USLEEP
usleep(1);
+#else
+ _sleep(1);
+#endif // HAVE_USLEEP
e->commands.push_back(this);
return false;
}