~ubuntu-branches/ubuntu/quantal/aria2/quantal

« back to all changes in this revision

Viewing changes to src/AbstractCommand.cc

  • Committer: Package Import Robot
  • Author(s): Kartik Mistry
  • Date: 2011-11-08 20:25:08 UTC
  • mfrom: (2.5.7 sid)
  • Revision ID: package-import@ubuntu.com-20111108202508-scfph8rj6tz0cckk
Tags: 1.13.0-1
* New upstream version:
  + Depends on libgcrypt11 (>= 1.5.0-3) (Closes: #642989)

Show diffs side-by-side

added added

removed removed

Lines of Context:
85
85
 const SocketHandle& s,
86
86
 const SharedHandle<SocketRecvBuffer>& socketRecvBuffer,
87
87
 bool incNumConnection)
88
 
  : Command(cuid), checkPoint_(global::wallclock),
 
88
  : Command(cuid), checkPoint_(global::wallclock()),
89
89
    timeout_(requestGroup->getTimeout()),
90
90
    requestGroup_(requestGroup),
91
91
    req_(req), fileEntry_(fileEntry), e_(e), socket_(s),
93
93
    checkSocketIsReadable_(false), checkSocketIsWritable_(false),
94
94
    nameResolverCheck_(false),
95
95
    incNumConnection_(incNumConnection),
96
 
    serverStatTimer_(global::wallclock)
 
96
    serverStatTimer_(global::wallclock())
97
97
{
98
98
  if(socket_ && socket_->isOpen()) {
99
99
    setReadCheckSocket(socket_);
184
184
      if(req_ && fileEntry_->getLength() > 0 &&
185
185
         e_->getRequestGroupMan()->getMaxOverallDownloadSpeedLimit() == 0 &&
186
186
         requestGroup_->getMaxDownloadSpeedLimit() == 0 &&
187
 
         serverStatTimer_.difference(global::wallclock) >= 10) {
188
 
        serverStatTimer_ = global::wallclock;
 
187
         serverStatTimer_.difference(global::wallclock()) >= 10) {
 
188
        serverStatTimer_ = global::wallclock();
189
189
        std::vector<std::pair<size_t, std::string> > usedHosts;
190
190
        if(getOption()->getAsBool(PREF_SELECT_LEAST_USED_HOST)) {
191
191
          getDownloadEngine()->getRequestGroupMan()->getUsedHosts(usedHosts);
209
209
#endif // ENABLE_ASYNC_DNS
210
210
       (!checkSocketIsReadable_ && !checkSocketIsWritable_ &&
211
211
        !nameResolverCheck_)) {
212
 
      checkPoint_ = global::wallclock;
 
212
      checkPoint_ = global::wallclock();
213
213
      if(getPieceStorage()) {
214
214
        if(!req_ || req_->getMaxPipelinedRequest() == 1 ||
215
215
           // Why the following condition is necessary? That's because
263
263
      throw DL_RETRY_EX(fmt(MSG_NETWORK_PROBLEM,
264
264
                            socket_->getSocketError().c_str()));
265
265
    } else {
266
 
      if(checkPoint_.difference(global::wallclock) >= timeout_) {
 
266
      if(checkPoint_.difference(global::wallclock()) >= timeout_) {
267
267
        // timeout triggers ServerStat error state.
268
268
        SharedHandle<ServerStat> ss =
269
269
          e_->getRequestGroupMan()->getOrCreateServerStat(req_->getHost(),
339
339
      tryReserved();
340
340
      return true;
341
341
    } else {
342
 
      Timer wakeTime(global::wallclock);
 
342
      Timer wakeTime(global::wallclock());
343
343
      wakeTime.advance(getOption()->getAsInt(PREF_RETRY_WAIT));
344
344
      req_->setWakeTime(wakeTime);
345
345
      return prepareForRetry(0);