~ubuntu-branches/debian/sid/nordugrid-arc/sid

« back to all changes in this revision

Viewing changes to src/hed/dmc/gridftp/DataPointGridFTP.cpp

  • Committer: Package Import Robot
  • Author(s): Mattias Ellert
  • Date: 2012-12-13 16:41:31 UTC
  • mfrom: (1.1.5)
  • Revision ID: package-import@ubuntu.com-20121213164131-0fumka0jar8mxm07
Tags: 2.0.1-1
* 2.0.1 Release
* Drop patches accepted upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
824
824
    return;
825
825
  }
826
826
 
827
 
  DataStatus DataPointGridFTP::do_more_stat(FileInfo& f) {
 
827
  DataStatus DataPointGridFTP::do_more_stat(FileInfo& f, DataPointInfoType verb) {
828
828
    DataStatus result = DataStatus::Success;
829
829
    GlobusResult res;
830
830
    globus_off_t size = 0;
831
831
    globus_abstime_t gl_modify_time;
832
832
    time_t modify_time;
833
833
    std::string f_url = url.ConnectionURL() + f.GetName();
834
 
    if ((!f.CheckSize()) && (f.GetType() != FileInfo::file_type_dir)) {
 
834
    if (((verb & INFO_TYPE_CONTENT) == INFO_TYPE_CONTENT) && (!f.CheckSize()) && (f.GetType() != FileInfo::file_type_dir)) {
835
835
      logger.msg(DEBUG, "list_files_ftp: looking for size of %s", f_url);
836
836
      res = globus_ftp_client_size(&ftp_handle, f_url.c_str(), &ftp_opattr,
837
837
                                   &size, &ftp_complete_callback, cbarg);
860
860
        f.SetType(FileInfo::file_type_file);
861
861
      }
862
862
    }
863
 
    if (!f.CheckCreated()) {
 
863
    if ((verb & INFO_TYPE_TIMES) == INFO_TYPE_TIMES && !f.CheckCreated()) {
864
864
      logger.msg(DEBUG, "list_files_ftp: "
865
865
                        "looking for modification time of %s", f_url);
866
866
      res = globus_ftp_client_modification_time(&ftp_handle, f_url.c_str(),
891
891
        f.SetCreated(modify_time);
892
892
      }
893
893
    }
894
 
    if (!f.CheckCheckSum() && f.GetType() != FileInfo::file_type_dir) {
 
894
    if ((verb & INFO_TYPE_CONTENT) == INFO_TYPE_CONTENT && !f.CheckCheckSum() && f.GetType() != FileInfo::file_type_dir) {
895
895
      // not all implementations support checksum so failure is not an error
896
896
      logger.msg(DEBUG, "list_files_ftp: "
897
897
                        "looking for checksum of %s", f_url);
973
973
    file.SetName(lister_info.GetName());
974
974
    file.SetMetaData("path", lister_info.GetName());
975
975
    if (more_info) {
976
 
      DataStatus r = do_more_stat(lister_info);
 
976
      DataStatus r = do_more_stat(lister_info, verb);
977
977
      if(!r) result = r;
978
978
    }
979
979
    file.SetType(lister_info.GetType());
1022
1022
        files.insert(files.end(), FileInfo(i->GetLastName()));
1023
1023
      f->SetMetaData("path", i->GetLastName());
1024
1024
      if (more_info) {
1025
 
        DataStatus r = do_more_stat(*i);
 
1025
        DataStatus r = do_more_stat(*i, verb);
1026
1026
        if(!r) {
1027
1027
          if(r == DataStatus::StatError) r = DataStatus(DataStatus::ListError, r.GetDesc());
1028
1028
          result = r;
1190
1190
        logger.msg(VERBOSE, "globus_ftp_client_operationattr_set_authorization: error: %s", r.str());
1191
1191
      }
1192
1192
      if (force_secure || (url.Option("secure") == "yes")) {
1193
 
        globus_ftp_client_operationattr_set_mode(&ftp_opattr,
1194
 
                             GLOBUS_FTP_CONTROL_MODE_EXTENDED_BLOCK);
1195
1193
        globus_ftp_client_operationattr_set_data_protection(&ftp_opattr,
1196
1194
                                    GLOBUS_FTP_CONTROL_PROTECTION_PRIVATE);
1197
1195
        logger.msg(VERBOSE, "Using secure data transfer");
1198
1196
      }
1199
1197
      else {
1200
 
        if (force_passive)
1201
 
          globus_ftp_client_operationattr_set_mode(&ftp_opattr,
1202
 
                               GLOBUS_FTP_CONTROL_MODE_STREAM);
1203
 
        else
1204
 
          globus_ftp_client_operationattr_set_mode(&ftp_opattr,
1205
 
                               GLOBUS_FTP_CONTROL_MODE_EXTENDED_BLOCK);
1206
1198
        globus_ftp_client_operationattr_set_data_protection(&ftp_opattr,
1207
1199
                                    GLOBUS_FTP_CONTROL_PROTECTION_CLEAR);
1208
1200
        logger.msg(VERBOSE, "Using insecure data transfer");
1209
1201
      }
 
1202
      if (force_passive) {
 
1203
        globus_ftp_client_operationattr_set_mode(&ftp_opattr,
 
1204
                             GLOBUS_FTP_CONTROL_MODE_STREAM);
 
1205
      } else {
 
1206
        globus_ftp_client_operationattr_set_mode(&ftp_opattr,
 
1207
                             GLOBUS_FTP_CONTROL_MODE_EXTENDED_BLOCK);
 
1208
      }
1210
1209
      globus_ftp_client_operationattr_set_control_protection(&ftp_opattr,
1211
1210
                                     GLOBUS_FTP_CONTROL_PROTECTION_PRIVATE);
1212
1211
    }
1287
1286
    }
1288
1287
    // Globus FTP handle allows changing url completely
1289
1288
    this->url = url;
 
1289
    if(triesleft < 1) triesleft = 1;
1290
1290
    return true;
1291
1291
  }
1292
1292