Ignore:
Timestamp:
07/18/14 10:08:12 (10 years ago)
Author:
ogrimm
Message:
Removed erroneous static declaration in History.cc that made a variable grow in size indefinitely. The data collector has new a service indicating its subscriptions (as the history server)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • fact/Evidence/DColl.cc

    r12910 r17915  
    4545        float DataSizeMB, LogSizeMB;
    4646        int DataSizeLastUpdate, LogSizeLastUpdate;
    47     DimService *LogSizeService, *DataSizeService, *DataFilename;
     47    DimService *LogSizeService, *DataSizeService, *DataFilename, *SubscriptionService;
     48
    4849        int TimeForNextFile;
    4950
     
    113114  LogCommand = new DimCommand("DColl/Log", (char *) "C", this);
    114115
    115   // Subsribe to top-level server list (not via AddService() due to thread issue)
     116  // Create services for information about subscribed services
     117  SubscriptionService = new DimService(SERVER_NAME "/Subscriptions", "C", NULL, 0);
     118
     119  // Subscribe to top-level server list (not via AddService() due to thread issue)
    116120  ServerList = new DimInfo((char *) "DIS_DNS/SERVER_LIST", NO_LINK, this);
    117121}
     
    132136  delete LogSizeService;
    133137  delete DataSizeService;
     138  delete SubscriptionService;
    134139
    135140  // Close files
     
    151156// no mutex is needed to serialize writing to the file
    152157void DataHandler::infoHandler() {
     158
     159  static string SubscriptionList;
    153160
    154161  // Check if service available
     
    192199          Name = strtok(NULL, "|");
    193200        }
     201       
     202        // Update service subscription list
     203        stringstream Stream;
     204       
     205        for (unsigned int i=0; i<List.size(); i++) Stream << List[i].DataItem->getName() << '|';
     206
     207        SubscriptionList = Stream.str();
     208        SubscriptionService->updateService((void *) SubscriptionList.c_str(), SubscriptionList.size()+1); // Note that Subscription is a static variable
     209
    194210        return;
    195211  }
Note: See TracChangeset for help on using the changeset viewer.