Fossil SCM
Get support for IP address on the --port option working on windows.
Commit
f4143c5b594fc836ffad4adf2b2d3411329c9ad0
Parent
abf56881b696f60…
2 files changed
+7
-3
+1
-1
+7
-3
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -1973,16 +1973,20 @@ | ||
| 1973 | 1973 | process_one_web_page(zNotFound, glob_create(zFileGlob)); |
| 1974 | 1974 | #else |
| 1975 | 1975 | /* Win32 implementation */ |
| 1976 | 1976 | if( isUiCmd ){ |
| 1977 | 1977 | 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 | + } | |
| 1979 | 1983 | } |
| 1980 | 1984 | db_close(1); |
| 1981 | - if( win32_http_service(iPort, zNotFound, zFileGlob, zIpAddr, flags) ){ | |
| 1985 | + if( win32_http_service(iPort, zNotFound, zFileGlob, flags) ){ | |
| 1982 | 1986 | win32_http_server(iPort, mxPort, zBrowserCmd, |
| 1983 | - zStopperFile, zNotFound, zFileGlob, flags); | |
| 1987 | + zStopperFile, zNotFound, zFileGlob, zIpAddr, flags); | |
| 1984 | 1988 | } |
| 1985 | 1989 | #endif |
| 1986 | 1990 | } |
| 1987 | 1991 | |
| 1988 | 1992 | /* |
| 1989 | 1993 |
| --- 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 @@ | ||
| 409 | 409 | ssStatus.dwServiceSpecificExitCode = 0; |
| 410 | 410 | win32_report_service_status(SERVICE_START_PENDING, NO_ERROR, 3000); |
| 411 | 411 | |
| 412 | 412 | /* Execute the http server */ |
| 413 | 413 | win32_http_server(hsData.port, hsData.port, |
| 414 | - NULL, NULL, hsData.zNotFound, hsData.zFileGlob, | |
| 414 | + NULL, NULL, hsData.zNotFound, hsData.zFileGlob, 0, | |
| 415 | 415 | hsData.flags); |
| 416 | 416 | |
| 417 | 417 | /* Service has stopped now. */ |
| 418 | 418 | win32_report_service_status(SERVICE_STOPPED, NO_ERROR, 0); |
| 419 | 419 | return; |
| 420 | 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, |
| 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 |