Fossil SCM

Get support for IP address on the --port option working on windows.

drh 2013-02-20 16:19 UTC bind-to-ip
Commit f4143c5b594fc836ffad4adf2b2d3411329c9ad0
2 files changed +7 -3 +1 -1
+7 -3
--- src/main.c
+++ src/main.c
@@ -1973,16 +1973,20 @@
19731973
process_one_web_page(zNotFound, glob_create(zFileGlob));
19741974
#else
19751975
/* Win32 implementation */
19761976
if( isUiCmd ){
19771977
zBrowser = db_get("web-browser", "start");
1978
- zBrowserCmd = mprintf("%s http://127.0.0.1:%%d/", zBrowser);
1978
+ if( zIpAddr ){
1979
+ zBrowserCmd = mprintf("%s http://%s:%%d/ &", zBrowser, zIpAddr);
1980
+ }else{
1981
+ zBrowserCmd = mprintf("%s http://localhost:%%d/ &", zBrowser);
1982
+ }
19791983
}
19801984
db_close(1);
1981
- if( win32_http_service(iPort, zNotFound, zFileGlob, zIpAddr, flags) ){
1985
+ if( win32_http_service(iPort, zNotFound, zFileGlob, flags) ){
19821986
win32_http_server(iPort, mxPort, zBrowserCmd,
1983
- zStopperFile, zNotFound, zFileGlob, flags);
1987
+ zStopperFile, zNotFound, zFileGlob, zIpAddr, flags);
19841988
}
19851989
#endif
19861990
}
19871991
19881992
/*
19891993
--- src/main.c
+++ src/main.c
@@ -1973,16 +1973,20 @@
1973 process_one_web_page(zNotFound, glob_create(zFileGlob));
1974 #else
1975 /* Win32 implementation */
1976 if( isUiCmd ){
1977 zBrowser = db_get("web-browser", "start");
1978 zBrowserCmd = mprintf("%s http://127.0.0.1:%%d/", zBrowser);
 
 
 
 
1979 }
1980 db_close(1);
1981 if( win32_http_service(iPort, zNotFound, zFileGlob, zIpAddr, flags) ){
1982 win32_http_server(iPort, mxPort, zBrowserCmd,
1983 zStopperFile, zNotFound, zFileGlob, flags);
1984 }
1985 #endif
1986 }
1987
1988 /*
1989
--- src/main.c
+++ src/main.c
@@ -1973,16 +1973,20 @@
1973 process_one_web_page(zNotFound, glob_create(zFileGlob));
1974 #else
1975 /* Win32 implementation */
1976 if( isUiCmd ){
1977 zBrowser = db_get("web-browser", "start");
1978 if( zIpAddr ){
1979 zBrowserCmd = mprintf("%s http://%s:%%d/ &", zBrowser, zIpAddr);
1980 }else{
1981 zBrowserCmd = mprintf("%s http://localhost:%%d/ &", zBrowser);
1982 }
1983 }
1984 db_close(1);
1985 if( win32_http_service(iPort, zNotFound, zFileGlob, flags) ){
1986 win32_http_server(iPort, mxPort, zBrowserCmd,
1987 zStopperFile, zNotFound, zFileGlob, zIpAddr, flags);
1988 }
1989 #endif
1990 }
1991
1992 /*
1993
+1 -1
--- src/winhttp.c
+++ src/winhttp.c
@@ -409,11 +409,11 @@
409409
ssStatus.dwServiceSpecificExitCode = 0;
410410
win32_report_service_status(SERVICE_START_PENDING, NO_ERROR, 3000);
411411
412412
/* Execute the http server */
413413
win32_http_server(hsData.port, hsData.port,
414
- NULL, NULL, hsData.zNotFound, hsData.zFileGlob,
414
+ NULL, NULL, hsData.zNotFound, hsData.zFileGlob, 0,
415415
hsData.flags);
416416
417417
/* Service has stopped now. */
418418
win32_report_service_status(SERVICE_STOPPED, NO_ERROR, 0);
419419
return;
420420
--- src/winhttp.c
+++ src/winhttp.c
@@ -409,11 +409,11 @@
409 ssStatus.dwServiceSpecificExitCode = 0;
410 win32_report_service_status(SERVICE_START_PENDING, NO_ERROR, 3000);
411
412 /* Execute the http server */
413 win32_http_server(hsData.port, hsData.port,
414 NULL, NULL, hsData.zNotFound, hsData.zFileGlob,
415 hsData.flags);
416
417 /* Service has stopped now. */
418 win32_report_service_status(SERVICE_STOPPED, NO_ERROR, 0);
419 return;
420
--- src/winhttp.c
+++ src/winhttp.c
@@ -409,11 +409,11 @@
409 ssStatus.dwServiceSpecificExitCode = 0;
410 win32_report_service_status(SERVICE_START_PENDING, NO_ERROR, 3000);
411
412 /* Execute the http server */
413 win32_http_server(hsData.port, hsData.port,
414 NULL, NULL, hsData.zNotFound, hsData.zFileGlob, 0,
415 hsData.flags);
416
417 /* Service has stopped now. */
418 win32_report_service_status(SERVICE_STOPPED, NO_ERROR, 0);
419 return;
420

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button