Ignore:
Timestamp:
2003-05-27T11:39:16+12:00 (21 years ago)
Author:
sjboddie
Message:

Tidied up configaction slightly. Running 'a=config&cmd=add-collection'
will now correctly reconfigure the collection if it already exists.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/colservr/collectset.cpp

    r2677 r4340  
    220220void collectset::add_collection (const text_t &collection, void *recpt,
    221221                 const text_t &gsdlhome, const text_t &gdbmhome) {
     222
     223  // if an old collection server exists for this collection we should
     224  // delete it first
     225  collectservermapclass::iterator here = cservers.begin();
     226  collectservermapclass::iterator end = cservers.end();
     227  while (here != end) {
     228    if ((*here).second.c != NULL && (*here).first == collection) {
     229      delete (*here).second.c;
     230      cservers.erase (here);
     231      break;
     232    }
     233    here ++;
     234  }
    222235     
    223236  // read config file to see if built with mg or mgpp
     
    314327void collectset::remove_collection (const text_t &collection, ostream &logout) {
    315328
     329  // do nothing if no collection server exists for this collection
     330  if (cservers.getcollectserver(collection) == NULL) return;
     331
    316332  // first unload any cached mg databases - we may need to do something
    317333  // similar to this for mgpp too
Note: See TracChangeset for help on using the changeset viewer.