Fossil

Check-in [f4143c5b59]
Login

Check-in [f4143c5b59]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Get support for IP address on the --port option working on windows.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | bind-to-ip
Files: files | file ages | folders
SHA1: f4143c5b594fc836ffad4adf2b2d3411329c9ad0
User & Date: drh 2013-02-20 16:19:32.703
Context
2013-02-20
20:57
All the --port option on the "ui" and "server" commands to begin with an IP address, then bind to just that one IP address. ... (check-in: 5dfbf7e5b6 user: drh tags: trunk)
16:19
Get support for IP address on the --port option working on windows. ... (Closed-Leaf check-in: f4143c5b59 user: drh tags: bind-to-ip)
16:11
Changes that allow the --port option on "fossil ui" and "fossil server" to include an IP address to which to bind. ... (check-in: abf56881b6 user: drh tags: bind-to-ip)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/main.c.
1971
1972
1973
1974
1975
1976
1977



1978
1979

1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
  g.zRepositoryName = enter_chroot_jail(g.zRepositoryName);
  cgi_handle_http_request(0);
  process_one_web_page(zNotFound, glob_create(zFileGlob));
#else
  /* Win32 implementation */
  if( isUiCmd ){
    zBrowser = db_get("web-browser", "start");



    zBrowserCmd = mprintf("%s http://127.0.0.1:%%d/", zBrowser);
  }

  db_close(1);
  if( win32_http_service(iPort, zNotFound, zFileGlob, zIpAddr, flags) ){
    win32_http_server(iPort, mxPort, zBrowserCmd,
                      zStopperFile, zNotFound, zFileGlob, flags);
  }
#endif
}

/*
** COMMAND:  test-echo
**







>
>
>
|
|
>

|

|







1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
  g.zRepositoryName = enter_chroot_jail(g.zRepositoryName);
  cgi_handle_http_request(0);
  process_one_web_page(zNotFound, glob_create(zFileGlob));
#else
  /* Win32 implementation */
  if( isUiCmd ){
    zBrowser = db_get("web-browser", "start");
    if( zIpAddr ){
      zBrowserCmd = mprintf("%s http://%s:%%d/ &", zBrowser, zIpAddr);
    }else{
      zBrowserCmd = mprintf("%s http://localhost:%%d/ &", zBrowser);
    }
  }
  db_close(1);
  if( win32_http_service(iPort, zNotFound, zFileGlob, flags) ){
    win32_http_server(iPort, mxPort, zBrowserCmd,
                      zStopperFile, zNotFound, zFileGlob, zIpAddr, flags);
  }
#endif
}

/*
** COMMAND:  test-echo
**
Changes to src/winhttp.c.
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
  /* Set service specific data and report that the service is starting. */
  ssStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS;
  ssStatus.dwServiceSpecificExitCode = 0;
  win32_report_service_status(SERVICE_START_PENDING, NO_ERROR, 3000);

   /* Execute the http server */
  win32_http_server(hsData.port, hsData.port,
                    NULL, NULL, hsData.zNotFound, hsData.zFileGlob,
                    hsData.flags);

  /* Service has stopped now. */
  win32_report_service_status(SERVICE_STOPPED, NO_ERROR, 0);
  return;
}








|







407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
  /* Set service specific data and report that the service is starting. */
  ssStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS;
  ssStatus.dwServiceSpecificExitCode = 0;
  win32_report_service_status(SERVICE_START_PENDING, NO_ERROR, 3000);

   /* Execute the http server */
  win32_http_server(hsData.port, hsData.port,
                    NULL, NULL, hsData.zNotFound, hsData.zFileGlob, 0,
                    hsData.flags);

  /* Service has stopped now. */
  win32_report_service_status(SERVICE_STOPPED, NO_ERROR, 0);
  return;
}