Changeset 14876 for trunk/FACT++


Ignore:
Timestamp:
02/06/13 12:56:17 (12 years ago)
Author:
tbretz
Message:
Added a fix for the +services. No easy way to test that... needs testing in real conditions.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/DimState.cc

    r14234 r14876  
    6969    for (auto it=tok.begin(); it!=tok.end(); it++)
    7070    {
    71         if (it->at(0)=='-')
     71        string str = *it;
     72
     73        if (str[0]=='-')
    7274            continue;
    7375
     76        if (str[0]=='+')
     77            str = str.substr(1);
     78
     79        const size_t last_pipe = str.find_last_of('|');
     80
    7481        // Get the type and compare it with fType
    75         const string type = it->substr(it->find_last_of('|')+1);
     82        const string type = str.substr(last_pipe+1);
    7683        if (type=="RPC")
    7784            continue;
     
    8188        //    continue;
    8289
    83         const size_t first_pipe  = it->find_first_of('|');
    84         const size_t first_slash = it->find_first_of('/');
    85         const size_t last_pipe   = it->find_last_of('|');
     90        const size_t first_pipe  = str.find_first_of('|');
     91        const size_t first_slash = str.find_first_of('/');
    8692
    8793        // Get format, name and command name
    8894        Service service;
    89         service.server  = it->substr(0, first_slash);
    90         service.name    = it->substr(0, first_pipe);
    91         service.service = it->substr(first_slash+1, first_pipe-first_slash-1);
    92         service.format  = it->substr(first_pipe +1, last_pipe -first_pipe -1);
     95        service.server  = str.substr(0, first_slash);
     96        service.name    = str.substr(0, first_pipe);
     97        service.service = str.substr(first_slash+1, first_pipe-first_slash-1);
     98        service.format  = str.substr(first_pipe +1, last_pipe -first_pipe -1);
    9399        service.iscmd   = type=="CMD";
    94 
    95         //if (it->at(0)=='+')
    96         //{
    97         //    // Check if this server is not found in the list.
    98         //    // This should never happen if Dim works reliable
    99         //    const TypeList::iterator v = list.find(name);
    100         //    if (v!=list.end())
    101         //    {
    102         //        stringstream err;
    103         //        err << "DimServiceInfoList: Service '" << server << "/" << name << "' already in list not as it ought to be.";
    104         //        throw runtime_error(err.str());
    105         //    }
    106         //
    107         //    list[name] = make_pair(fmt, iscmd);
    108         //    fList->AddService(server, name, fmt, iscmd);
    109         //}
    110100
    111101        const auto v = find(fServiceList.begin(), fServiceList.end(), service.name);
Note: See TracChangeset for help on using the changeset viewer.