Ignore:
Timestamp:
2003-05-21T14:00:33+12:00 (21 years ago)
Author:
sjboddie
Message:

server.exe now writes a "url" entry to its configuration file when it starts
up and removes it when it shuts down. This allows the gatherer (and
anything else that needs to) to detect if the server is running and to
know exactly what url it's using.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/w32server/settings.cpp

    r2577 r4292  
    6262int gsdl_browser = GS_IEXPLORE;
    6363char gsdl_browser_exe[MAX_FILENAME_SIZE] = "";
    64 
     64text_t gsdl_url;
    6565
    6666// private data
     
    267267}
    268268
    269 void write_settings () {
     269void write_settings (const text_t url) {
    270270  char conffile[MAX_FILENAME_SIZE];
    271271 
     
    281281    // top (gsdl) level stuff
    282282    fout << "[gsdl]\n";
     283   
     284    if (!url.empty()) {
     285      // url entry should only be written to gsdlsite.cfg when the
     286      // server is actually running, not when it's stopped (since we
     287      // can't be sure what the url is at that stage). That is,
     288      // write_settings() is called with the url argument set when the
     289      // server first starts up, it's then called without url set as
     290      // the server shuts down.
     291      write_ini_line(fout, "url", url);     
     292    }
     293
    283294    write_ini_line(fout, "enterlib", gsdl_enterlib);
    284295    write_ini_line(fout, "gsdlhome", gsdl_gsdlhome);
     
    814825  // save the settings if we exited via the ok button
    815826  if (res == 1) {
    816     write_settings();
     827    write_settings(gsdl_url);
    817828    // reset httpprefix in case port number was changed
    818829    //    configure_httpprefix ();
Note: See TracChangeset for help on using the changeset viewer.