Changeset 19728


Ignore:
Timestamp:
2009-06-03T13:40:12+12:00 (15 years ago)
Author:
ak19
Message:

Dr Bainbridge fixed a terrible bug that caused the server.exe to crash because the mgsearch object was being instantiated even when there were no mgcollections. The reason it was being instantiated was because collections were being added in in two different manners in cgiwrapper.cpp and in the second way, it did not test whether some of those collections were unbuilt (in which case the collection should not be added in). This meant that the code in collectset where the buildtype, which would default to mg when there was no buildtype specified for given collections, would remain at mg (since the collection is unbuilt and hence has no index/build.cfg file to specify a contrary buildtype). This then instantiated an mgsearch object where the members would not have valid values.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/runtime-src/src/w32server/cgiwrapper.cpp

    r19147 r19728  
    465465      colend = these_collections.end();
    466466      while (colhere != colend) {
    467     collections.insert (*colhere);
    468     collectioninfo_t tmp;
    469     tmp.gsdl_gsdlhome = gsdl_gsdlhome;
    470     tmp.gsdl_collecthome = gsdl_collecthome;
    471     tmp.gsdl_dbhome = gsdl_dbhome;
    472     translated_collectinfo[*colhere] = tmp;
     467   
     468    text_t build_cfg = filename_cat (gsdl_dbhome,"collect",
     469                     *colhere, "index", "build.cfg");
     470    if (file_exists (build_cfg)) {
     471      collections.insert (*colhere);
     472     
     473      collectioninfo_t tmp;
     474      tmp.gsdl_gsdlhome = gsdl_gsdlhome;
     475      tmp.gsdl_collecthome = gsdl_collecthome;
     476      tmp.gsdl_dbhome = gsdl_dbhome;
     477      translated_collectinfo[*colhere] = tmp;
     478    }
    473479    ++colhere;
    474480      }
Note: See TracChangeset for help on using the changeset viewer.