Changeset 20949


Ignore:
Timestamp:
11/16/09 19:45:24 (11 years ago)
Author:
ak19
Message:

Need to write out hostIP in case we were using this address-resolution-method, and then next time started up the apache server instead of server.exe.

Location:
gsdl/trunk/runtime-src/src/w32server
Files:
3 edited

Legend:

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

    r19548 r20949  
    338338    //   3: 127.0.0.1 -- always use 127.0.0.1
    339339    char gsdl_address[100];
     340    char hostIP[25]; // 16 should be enough to represent an IP address + null byte
    340341
    341342    DWORD local_ip = GetLocalIP();
     343    // always work out the hostIP:
     344    sprintf(hostIP, "%d.%d.%d.%d", local_ip & 0xFF, (local_ip >> 8) & 0xFF, (local_ip >> 16) & 0xFF, (local_ip >> 24) & 0xFF);
     345
    342346    if (local_ip == INADDR_ANY || gsdl_address_resolution_method == 3) {
    343347      local_ip = 127 + (0 << 8) + (0 << 16) + (1 << 24);
     
    350354      sprintf(gsdl_address, "localhost");
    351355    }
    352     else {
     356    else { 
    353357      strcpy(gsdl_address, GetLocalName(NULL));
    354358    }
     
    356360    text_t url = "http://" + text_t(gsdl_address);
    357361
     362    gsdl_host_IP = text_t(hostIP);
    358363    gsdl_url = url;
    359364    write_settings(gsdl_url);
  • gsdl/trunk/runtime-src/src/w32server/settings.cpp

    r19210 r20949  
    6969int gsdl_start_browser = 1;
    7070int gsdl_address_resolution_method = 2;  // use localhost since users may switch between computers
     71text_t gsdl_host_IP;
    7172// The resolution method was previously on 1: Get an IP, but don't resolve to a name
    7273
     
    318319    write_ini_line(fout, "start_browser", text_t(gsdl_start_browser));
    319320    write_ini_line(fout, "address_resolution_method", text_t(gsdl_address_resolution_method));
     321    write_ini_line(fout, "hostIP", gsdl_host_IP);
    320322
    321323    // collection levels
  • gsdl/trunk/runtime-src/src/w32server/settings.h

    r19210 r20949  
    6767extern char gsdl_browser_exe[MAX_FILENAME_SIZE];
    6868extern text_t gsdl_url;
     69extern text_t gsdl_host_IP;
    6970extern text_t gsdl_conffile;
    7071extern int gsdl_start_browser;
Note: See TracChangeset for help on using the changeset viewer.