Ignore:
Timestamp:
2009-11-16T19:45:24+13:00 (14 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.

File:
1 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);
Note: See TracChangeset for help on using the changeset viewer.