~ubuntu-branches/ubuntu/precise/nordugrid-arc/precise

« back to all changes in this revision

Viewing changes to src/services/cache_service/CacheService.cpp

  • Committer: Package Import Robot
  • Author(s): Mattias Ellert
  • Date: 2012-03-01 19:48:16 UTC
  • mfrom: (3.1.5 sid)
  • Revision ID: package-import@ubuntu.com-20120301194816-m1ezrwnwt2qgnc2e
Tags: 1.1.1-1
* 1.1.1 Bugfix Release
* Fixes FTBFS (Closes: #661774) (LP: #935007)
* Fix typo in package description (Closes: #646979)
* Split binary rule in debian/rules for arch and indep

Show diffs side-by-side

added added

removed removed

Lines of Context:
497
497
      Arc::DataStatus res = d->Check();
498
498
      if (!res.Passed()) {
499
499
        logger.msg(Arc::ERROR, "Permission checking failed: %s", url);
500
 
        cache.Stop(url);
501
500
        resultelement.NewChild("ReturnCode") = Arc::tostring(CacheService::PermissionError);
502
501
        resultelement.NewChild("ReturnCodeExplanation") = "Permission denied";
503
502
        error_happened = true;
509
508
 
510
509
    // link file
511
510
    std::string session_file = session_dir + '/' + filename;
512
 
    if (!cache.Link(session_file, url, false, false)) { // TODO add executable flag to request
 
511
    bool try_again = false;
 
512
    if (!cache.Link(session_file, url, false, false, false, try_again)) { // TODO add executable flag to request
513
513
      // failed to link - report as if not there
514
 
      cache.Stop(url);
515
514
      resultelement.NewChild("ReturnCode") = Arc::tostring(CacheService::LinkError);
516
515
      resultelement.NewChild("ReturnCodeExplanation") = "Failed to link to session dir";
517
516
      error_happened = true;
518
517
      continue;
519
518
    }
520
 
    // everything went ok so stop cache and report success
521
 
    cache.Stop(url);
 
519
    // everything went ok so report success
522
520
    resultelement.NewChild("ReturnCode") = Arc::tostring(CacheService::Success);
523
521
    resultelement.NewChild("ReturnCodeExplanation") = "Success";
524
522
  }