Fossil SCM
Make server on Windows aware of current checkout if run interavtivly from open checkout. Allows using special names prev/next/current in ui
Commit
aead49f36a78dd76b883437106178eac434afd97
Parent
3fc62dde2cc5683…
2 files changed
+22
-21
+7
-3
+22
-21
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -1840,52 +1840,52 @@ | ||
| 1840 | 1840 | process_one_web_page(zNotFound, pFileGlob); |
| 1841 | 1841 | } |
| 1842 | 1842 | } |
| 1843 | 1843 | |
| 1844 | 1844 | /* |
| 1845 | -** If g.argv[2] exists then it is either the name of a repository | |
| 1845 | +** If g.argv[arg] exists then it is either the name of a repository | |
| 1846 | 1846 | ** that will be used by a server, or else it is a directory that |
| 1847 | -** contains multiple repositories that can be served. If g.argv[2] | |
| 1847 | +** contains multiple repositories that can be served. If g.argv[arg] | |
| 1848 | 1848 | ** is a directory, the repositories it contains must be named |
| 1849 | -** "*.fossil". If g.argv[2] does not exists, then we must be within | |
| 1849 | +** "*.fossil". If g.argv[arg] does not exists, then we must be within | |
| 1850 | 1850 | ** a check-out and the repository to be served is the repository of |
| 1851 | 1851 | ** that check-out. |
| 1852 | 1852 | ** |
| 1853 | -** Open the repository to be served if it is known. If g.argv[2] is | |
| 1853 | +** Open the repository to be served if it is known. If g.argv[arg] is | |
| 1854 | 1854 | ** a directory full of repositories, then set g.zRepositoryName to |
| 1855 | 1855 | ** the name of that directory and the specific repository will be |
| 1856 | 1856 | ** opened later by process_one_web_page() based on the content of |
| 1857 | 1857 | ** the PATH_INFO variable. |
| 1858 | 1858 | ** |
| 1859 | 1859 | ** If disallowDir is set, then the directory full of repositories method |
| 1860 | 1860 | ** is disallowed. |
| 1861 | 1861 | */ |
| 1862 | -static void find_server_repository(int disallowDir){ | |
| 1863 | - if( g.argc<3 ){ | |
| 1862 | +static void find_server_repository(int disallowDir, int arg){ | |
| 1863 | + if( g.argc<=arg ){ | |
| 1864 | 1864 | db_must_be_within_tree(); |
| 1865 | - }else if( file_isdir(g.argv[2])==1 ){ | |
| 1865 | + }else if( file_isdir(g.argv[arg])==1 ){ | |
| 1866 | 1866 | if( disallowDir ){ |
| 1867 | - fossil_fatal("\"%s\" is a directory, not a repository file", g.argv[2]); | |
| 1867 | + fossil_fatal("\"%s\" is a directory, not a repository file", g.argv[arg]); | |
| 1868 | 1868 | }else{ |
| 1869 | - g.zRepositoryName = mprintf("%s", g.argv[2]); | |
| 1869 | + g.zRepositoryName = mprintf("%s", g.argv[arg]); | |
| 1870 | 1870 | file_simplify_name(g.zRepositoryName, -1, 0); |
| 1871 | 1871 | } |
| 1872 | 1872 | }else{ |
| 1873 | - db_open_repository(g.argv[2]); | |
| 1873 | + db_open_repository(g.argv[arg]); | |
| 1874 | 1874 | } |
| 1875 | 1875 | } |
| 1876 | 1876 | |
| 1877 | 1877 | /* |
| 1878 | 1878 | ** undocumented format: |
| 1879 | 1879 | ** |
| 1880 | -** fossil http REPOSITORY INFILE OUTFILE IPADDR | |
| 1880 | +** fossil http INFILE OUTFILE IPADDR ?REPOSITORY? | |
| 1881 | 1881 | ** |
| 1882 | 1882 | ** The argv==6 form is used by the win32 server only. |
| 1883 | 1883 | ** |
| 1884 | 1884 | ** COMMAND: http* |
| 1885 | 1885 | ** |
| 1886 | -** Usage: %fossil http REPOSITORY ?OPTIONS? | |
| 1886 | +** Usage: %fossil http ?REPOSITORY? ?OPTIONS? | |
| 1887 | 1887 | ** |
| 1888 | 1888 | ** Handle a single HTTP request appearing on stdin. The resulting webpage |
| 1889 | 1889 | ** is delivered on stdout. This method is used to launch an HTTP request |
| 1890 | 1890 | ** handler from inetd, for example. The argument is the name of the |
| 1891 | 1891 | ** repository. |
| @@ -1956,30 +1956,31 @@ | ||
| 1956 | 1956 | g.cgiOutput = 1; |
| 1957 | 1957 | |
| 1958 | 1958 | /* We should be done with options.. */ |
| 1959 | 1959 | verify_all_options(); |
| 1960 | 1960 | |
| 1961 | - if( g.argc!=2 && g.argc!=3 && g.argc!=6 ){ | |
| 1961 | + if( g.argc!=2 && g.argc!=3 && g.argc!=5 && g.argc!=6 ){ | |
| 1962 | 1962 | fossil_fatal("no repository specified"); |
| 1963 | 1963 | } |
| 1964 | 1964 | g.fullHttpReply = 1; |
| 1965 | - if( g.argc==6 ){ | |
| 1966 | - g.httpIn = fossil_fopen(g.argv[3], "rb"); | |
| 1967 | - g.httpOut = fossil_fopen(g.argv[4], "wb"); | |
| 1968 | - zIpAddr = g.argv[5]; | |
| 1965 | + if( g.argc>=5 ){ | |
| 1966 | + g.httpIn = fossil_fopen(g.argv[2], "rb"); | |
| 1967 | + g.httpOut = fossil_fopen(g.argv[3], "wb"); | |
| 1968 | + zIpAddr = g.argv[4]; | |
| 1969 | + find_server_repository(0, 5); | |
| 1969 | 1970 | }else{ |
| 1970 | 1971 | g.httpIn = stdin; |
| 1971 | 1972 | g.httpOut = stdout; |
| 1972 | 1973 | zIpAddr = 0; |
| 1974 | + find_server_repository(0, 2); | |
| 1973 | 1975 | } |
| 1974 | 1976 | if( zIpAddr==0 ){ |
| 1975 | 1977 | zIpAddr = cgi_ssh_remote_addr(0); |
| 1976 | 1978 | if( zIpAddr && zIpAddr[0] ){ |
| 1977 | 1979 | g.fSshClient |= CGI_SSH_CLIENT; |
| 1978 | 1980 | } |
| 1979 | 1981 | } |
| 1980 | - find_server_repository(0); | |
| 1981 | 1982 | g.zRepositoryName = enter_chroot_jail(g.zRepositoryName); |
| 1982 | 1983 | if( useSCGI ){ |
| 1983 | 1984 | cgi_handle_scgi_request(); |
| 1984 | 1985 | }else if( g.fSshClient & CGI_SSH_CLIENT ){ |
| 1985 | 1986 | ssh_request_loop(zIpAddr, glob_create(zFileGlob)); |
| @@ -2015,11 +2016,11 @@ | ||
| 2015 | 2016 | Th_InitTraceLog(); |
| 2016 | 2017 | login_set_capabilities("sx", 0); |
| 2017 | 2018 | g.useLocalauth = 1; |
| 2018 | 2019 | g.httpIn = stdin; |
| 2019 | 2020 | g.httpOut = stdout; |
| 2020 | - find_server_repository(0); | |
| 2021 | + find_server_repository(0, 2); | |
| 2021 | 2022 | g.cgiOutput = 1; |
| 2022 | 2023 | g.fullHttpReply = 1; |
| 2023 | 2024 | zIpAddr = cgi_ssh_remote_addr(0); |
| 2024 | 2025 | if( zIpAddr && zIpAddr[0] ){ |
| 2025 | 2026 | g.fSshClient |= CGI_SSH_CLIENT; |
| @@ -2152,11 +2153,11 @@ | ||
| 2152 | 2153 | isUiCmd = g.argv[1][0]=='u'; |
| 2153 | 2154 | if( isUiCmd ){ |
| 2154 | 2155 | flags |= HTTP_SERVER_LOCALHOST; |
| 2155 | 2156 | g.useLocalauth = 1; |
| 2156 | 2157 | } |
| 2157 | - find_server_repository(isUiCmd && zNotFound==0); | |
| 2158 | + find_server_repository(isUiCmd && zNotFound==0, 2); | |
| 2158 | 2159 | if( zPort ){ |
| 2159 | 2160 | int i; |
| 2160 | 2161 | for(i=strlen(zPort)-1; i>=0 && zPort[i]!=':'; i--){} |
| 2161 | 2162 | if( i>0 ){ |
| 2162 | 2163 | zIpAddr = mprintf("%.*s", i, zPort); |
| @@ -2202,11 +2203,11 @@ | ||
| 2202 | 2203 | g.httpOut = stdout; |
| 2203 | 2204 | if( g.fHttpTrace || g.fSqlTrace ){ |
| 2204 | 2205 | fprintf(stderr, "====== SERVER pid %d =======\n", getpid()); |
| 2205 | 2206 | } |
| 2206 | 2207 | g.cgiOutput = 1; |
| 2207 | - find_server_repository(isUiCmd && zNotFound==0); | |
| 2208 | + find_server_repository(isUiCmd && zNotFound==0, 2); | |
| 2208 | 2209 | g.zRepositoryName = enter_chroot_jail(g.zRepositoryName); |
| 2209 | 2210 | if( flags & HTTP_SERVER_SCGI ){ |
| 2210 | 2211 | cgi_handle_scgi_request(); |
| 2211 | 2212 | }else{ |
| 2212 | 2213 | cgi_handle_http_request(0); |
| 2213 | 2214 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -1840,52 +1840,52 @@ | |
| 1840 | process_one_web_page(zNotFound, pFileGlob); |
| 1841 | } |
| 1842 | } |
| 1843 | |
| 1844 | /* |
| 1845 | ** If g.argv[2] exists then it is either the name of a repository |
| 1846 | ** that will be used by a server, or else it is a directory that |
| 1847 | ** contains multiple repositories that can be served. If g.argv[2] |
| 1848 | ** is a directory, the repositories it contains must be named |
| 1849 | ** "*.fossil". If g.argv[2] does not exists, then we must be within |
| 1850 | ** a check-out and the repository to be served is the repository of |
| 1851 | ** that check-out. |
| 1852 | ** |
| 1853 | ** Open the repository to be served if it is known. If g.argv[2] is |
| 1854 | ** a directory full of repositories, then set g.zRepositoryName to |
| 1855 | ** the name of that directory and the specific repository will be |
| 1856 | ** opened later by process_one_web_page() based on the content of |
| 1857 | ** the PATH_INFO variable. |
| 1858 | ** |
| 1859 | ** If disallowDir is set, then the directory full of repositories method |
| 1860 | ** is disallowed. |
| 1861 | */ |
| 1862 | static void find_server_repository(int disallowDir){ |
| 1863 | if( g.argc<3 ){ |
| 1864 | db_must_be_within_tree(); |
| 1865 | }else if( file_isdir(g.argv[2])==1 ){ |
| 1866 | if( disallowDir ){ |
| 1867 | fossil_fatal("\"%s\" is a directory, not a repository file", g.argv[2]); |
| 1868 | }else{ |
| 1869 | g.zRepositoryName = mprintf("%s", g.argv[2]); |
| 1870 | file_simplify_name(g.zRepositoryName, -1, 0); |
| 1871 | } |
| 1872 | }else{ |
| 1873 | db_open_repository(g.argv[2]); |
| 1874 | } |
| 1875 | } |
| 1876 | |
| 1877 | /* |
| 1878 | ** undocumented format: |
| 1879 | ** |
| 1880 | ** fossil http REPOSITORY INFILE OUTFILE IPADDR |
| 1881 | ** |
| 1882 | ** The argv==6 form is used by the win32 server only. |
| 1883 | ** |
| 1884 | ** COMMAND: http* |
| 1885 | ** |
| 1886 | ** Usage: %fossil http REPOSITORY ?OPTIONS? |
| 1887 | ** |
| 1888 | ** Handle a single HTTP request appearing on stdin. The resulting webpage |
| 1889 | ** is delivered on stdout. This method is used to launch an HTTP request |
| 1890 | ** handler from inetd, for example. The argument is the name of the |
| 1891 | ** repository. |
| @@ -1956,30 +1956,31 @@ | |
| 1956 | g.cgiOutput = 1; |
| 1957 | |
| 1958 | /* We should be done with options.. */ |
| 1959 | verify_all_options(); |
| 1960 | |
| 1961 | if( g.argc!=2 && g.argc!=3 && g.argc!=6 ){ |
| 1962 | fossil_fatal("no repository specified"); |
| 1963 | } |
| 1964 | g.fullHttpReply = 1; |
| 1965 | if( g.argc==6 ){ |
| 1966 | g.httpIn = fossil_fopen(g.argv[3], "rb"); |
| 1967 | g.httpOut = fossil_fopen(g.argv[4], "wb"); |
| 1968 | zIpAddr = g.argv[5]; |
| 1969 | }else{ |
| 1970 | g.httpIn = stdin; |
| 1971 | g.httpOut = stdout; |
| 1972 | zIpAddr = 0; |
| 1973 | } |
| 1974 | if( zIpAddr==0 ){ |
| 1975 | zIpAddr = cgi_ssh_remote_addr(0); |
| 1976 | if( zIpAddr && zIpAddr[0] ){ |
| 1977 | g.fSshClient |= CGI_SSH_CLIENT; |
| 1978 | } |
| 1979 | } |
| 1980 | find_server_repository(0); |
| 1981 | g.zRepositoryName = enter_chroot_jail(g.zRepositoryName); |
| 1982 | if( useSCGI ){ |
| 1983 | cgi_handle_scgi_request(); |
| 1984 | }else if( g.fSshClient & CGI_SSH_CLIENT ){ |
| 1985 | ssh_request_loop(zIpAddr, glob_create(zFileGlob)); |
| @@ -2015,11 +2016,11 @@ | |
| 2015 | Th_InitTraceLog(); |
| 2016 | login_set_capabilities("sx", 0); |
| 2017 | g.useLocalauth = 1; |
| 2018 | g.httpIn = stdin; |
| 2019 | g.httpOut = stdout; |
| 2020 | find_server_repository(0); |
| 2021 | g.cgiOutput = 1; |
| 2022 | g.fullHttpReply = 1; |
| 2023 | zIpAddr = cgi_ssh_remote_addr(0); |
| 2024 | if( zIpAddr && zIpAddr[0] ){ |
| 2025 | g.fSshClient |= CGI_SSH_CLIENT; |
| @@ -2152,11 +2153,11 @@ | |
| 2152 | isUiCmd = g.argv[1][0]=='u'; |
| 2153 | if( isUiCmd ){ |
| 2154 | flags |= HTTP_SERVER_LOCALHOST; |
| 2155 | g.useLocalauth = 1; |
| 2156 | } |
| 2157 | find_server_repository(isUiCmd && zNotFound==0); |
| 2158 | if( zPort ){ |
| 2159 | int i; |
| 2160 | for(i=strlen(zPort)-1; i>=0 && zPort[i]!=':'; i--){} |
| 2161 | if( i>0 ){ |
| 2162 | zIpAddr = mprintf("%.*s", i, zPort); |
| @@ -2202,11 +2203,11 @@ | |
| 2202 | g.httpOut = stdout; |
| 2203 | if( g.fHttpTrace || g.fSqlTrace ){ |
| 2204 | fprintf(stderr, "====== SERVER pid %d =======\n", getpid()); |
| 2205 | } |
| 2206 | g.cgiOutput = 1; |
| 2207 | find_server_repository(isUiCmd && zNotFound==0); |
| 2208 | g.zRepositoryName = enter_chroot_jail(g.zRepositoryName); |
| 2209 | if( flags & HTTP_SERVER_SCGI ){ |
| 2210 | cgi_handle_scgi_request(); |
| 2211 | }else{ |
| 2212 | cgi_handle_http_request(0); |
| 2213 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -1840,52 +1840,52 @@ | |
| 1840 | process_one_web_page(zNotFound, pFileGlob); |
| 1841 | } |
| 1842 | } |
| 1843 | |
| 1844 | /* |
| 1845 | ** If g.argv[arg] exists then it is either the name of a repository |
| 1846 | ** that will be used by a server, or else it is a directory that |
| 1847 | ** contains multiple repositories that can be served. If g.argv[arg] |
| 1848 | ** is a directory, the repositories it contains must be named |
| 1849 | ** "*.fossil". If g.argv[arg] does not exists, then we must be within |
| 1850 | ** a check-out and the repository to be served is the repository of |
| 1851 | ** that check-out. |
| 1852 | ** |
| 1853 | ** Open the repository to be served if it is known. If g.argv[arg] is |
| 1854 | ** a directory full of repositories, then set g.zRepositoryName to |
| 1855 | ** the name of that directory and the specific repository will be |
| 1856 | ** opened later by process_one_web_page() based on the content of |
| 1857 | ** the PATH_INFO variable. |
| 1858 | ** |
| 1859 | ** If disallowDir is set, then the directory full of repositories method |
| 1860 | ** is disallowed. |
| 1861 | */ |
| 1862 | static void find_server_repository(int disallowDir, int arg){ |
| 1863 | if( g.argc<=arg ){ |
| 1864 | db_must_be_within_tree(); |
| 1865 | }else if( file_isdir(g.argv[arg])==1 ){ |
| 1866 | if( disallowDir ){ |
| 1867 | fossil_fatal("\"%s\" is a directory, not a repository file", g.argv[arg]); |
| 1868 | }else{ |
| 1869 | g.zRepositoryName = mprintf("%s", g.argv[arg]); |
| 1870 | file_simplify_name(g.zRepositoryName, -1, 0); |
| 1871 | } |
| 1872 | }else{ |
| 1873 | db_open_repository(g.argv[arg]); |
| 1874 | } |
| 1875 | } |
| 1876 | |
| 1877 | /* |
| 1878 | ** undocumented format: |
| 1879 | ** |
| 1880 | ** fossil http INFILE OUTFILE IPADDR ?REPOSITORY? |
| 1881 | ** |
| 1882 | ** The argv==6 form is used by the win32 server only. |
| 1883 | ** |
| 1884 | ** COMMAND: http* |
| 1885 | ** |
| 1886 | ** Usage: %fossil http ?REPOSITORY? ?OPTIONS? |
| 1887 | ** |
| 1888 | ** Handle a single HTTP request appearing on stdin. The resulting webpage |
| 1889 | ** is delivered on stdout. This method is used to launch an HTTP request |
| 1890 | ** handler from inetd, for example. The argument is the name of the |
| 1891 | ** repository. |
| @@ -1956,30 +1956,31 @@ | |
| 1956 | g.cgiOutput = 1; |
| 1957 | |
| 1958 | /* We should be done with options.. */ |
| 1959 | verify_all_options(); |
| 1960 | |
| 1961 | if( g.argc!=2 && g.argc!=3 && g.argc!=5 && g.argc!=6 ){ |
| 1962 | fossil_fatal("no repository specified"); |
| 1963 | } |
| 1964 | g.fullHttpReply = 1; |
| 1965 | if( g.argc>=5 ){ |
| 1966 | g.httpIn = fossil_fopen(g.argv[2], "rb"); |
| 1967 | g.httpOut = fossil_fopen(g.argv[3], "wb"); |
| 1968 | zIpAddr = g.argv[4]; |
| 1969 | find_server_repository(0, 5); |
| 1970 | }else{ |
| 1971 | g.httpIn = stdin; |
| 1972 | g.httpOut = stdout; |
| 1973 | zIpAddr = 0; |
| 1974 | find_server_repository(0, 2); |
| 1975 | } |
| 1976 | if( zIpAddr==0 ){ |
| 1977 | zIpAddr = cgi_ssh_remote_addr(0); |
| 1978 | if( zIpAddr && zIpAddr[0] ){ |
| 1979 | g.fSshClient |= CGI_SSH_CLIENT; |
| 1980 | } |
| 1981 | } |
| 1982 | g.zRepositoryName = enter_chroot_jail(g.zRepositoryName); |
| 1983 | if( useSCGI ){ |
| 1984 | cgi_handle_scgi_request(); |
| 1985 | }else if( g.fSshClient & CGI_SSH_CLIENT ){ |
| 1986 | ssh_request_loop(zIpAddr, glob_create(zFileGlob)); |
| @@ -2015,11 +2016,11 @@ | |
| 2016 | Th_InitTraceLog(); |
| 2017 | login_set_capabilities("sx", 0); |
| 2018 | g.useLocalauth = 1; |
| 2019 | g.httpIn = stdin; |
| 2020 | g.httpOut = stdout; |
| 2021 | find_server_repository(0, 2); |
| 2022 | g.cgiOutput = 1; |
| 2023 | g.fullHttpReply = 1; |
| 2024 | zIpAddr = cgi_ssh_remote_addr(0); |
| 2025 | if( zIpAddr && zIpAddr[0] ){ |
| 2026 | g.fSshClient |= CGI_SSH_CLIENT; |
| @@ -2152,11 +2153,11 @@ | |
| 2153 | isUiCmd = g.argv[1][0]=='u'; |
| 2154 | if( isUiCmd ){ |
| 2155 | flags |= HTTP_SERVER_LOCALHOST; |
| 2156 | g.useLocalauth = 1; |
| 2157 | } |
| 2158 | find_server_repository(isUiCmd && zNotFound==0, 2); |
| 2159 | if( zPort ){ |
| 2160 | int i; |
| 2161 | for(i=strlen(zPort)-1; i>=0 && zPort[i]!=':'; i--){} |
| 2162 | if( i>0 ){ |
| 2163 | zIpAddr = mprintf("%.*s", i, zPort); |
| @@ -2202,11 +2203,11 @@ | |
| 2203 | g.httpOut = stdout; |
| 2204 | if( g.fHttpTrace || g.fSqlTrace ){ |
| 2205 | fprintf(stderr, "====== SERVER pid %d =======\n", getpid()); |
| 2206 | } |
| 2207 | g.cgiOutput = 1; |
| 2208 | find_server_repository(isUiCmd && zNotFound==0, 2); |
| 2209 | g.zRepositoryName = enter_chroot_jail(g.zRepositoryName); |
| 2210 | if( flags & HTTP_SERVER_SCGI ){ |
| 2211 | cgi_handle_scgi_request(); |
| 2212 | }else{ |
| 2213 | cgi_handle_http_request(0); |
| 2214 |
+7
-3
| --- src/winhttp.c | ||
| +++ src/winhttp.c | ||
| @@ -111,14 +111,18 @@ | ||
| 111 | 111 | } |
| 112 | 112 | wanted -= got; |
| 113 | 113 | } |
| 114 | 114 | fclose(out); |
| 115 | 115 | out = 0; |
| 116 | - sqlite3_snprintf(sizeof(zCmd), zCmd, "%s%s\n%s\n%s\n%s", | |
| 117 | - get_utf8_bom(0), g.zRepositoryName, zRequestFName, zReplyFName, | |
| 118 | - inet_ntoa(p->addr.sin_addr) | |
| 116 | + sqlite3_snprintf(sizeof(zCmd), zCmd, "%s%s\n%s\n%s", | |
| 117 | + get_utf8_bom(0), zRequestFName, zReplyFName, inet_ntoa(p->addr.sin_addr) | |
| 119 | 118 | ); |
| 119 | + /* if g.zLocalRoot is set, then we are in a checkout directory, | |
| 120 | + ** even if the db handle is now closed */ | |
| 121 | + if( !g.zLocalRoot || !g.zLocalRoot[0] ){ | |
| 122 | + sqlite3_snprintf(sizeof(zCmd), zCmd, "%s\n%s", zCmd, g.zRepositoryName); | |
| 123 | + } | |
| 120 | 124 | out = fossil_fopen(zCmdFName, "wb"); |
| 121 | 125 | if( out==0 ) goto end_request; |
| 122 | 126 | fwrite(zCmd, 1, strlen(zCmd), out); |
| 123 | 127 | fclose(out); |
| 124 | 128 | |
| 125 | 129 |
| --- src/winhttp.c | |
| +++ src/winhttp.c | |
| @@ -111,14 +111,18 @@ | |
| 111 | } |
| 112 | wanted -= got; |
| 113 | } |
| 114 | fclose(out); |
| 115 | out = 0; |
| 116 | sqlite3_snprintf(sizeof(zCmd), zCmd, "%s%s\n%s\n%s\n%s", |
| 117 | get_utf8_bom(0), g.zRepositoryName, zRequestFName, zReplyFName, |
| 118 | inet_ntoa(p->addr.sin_addr) |
| 119 | ); |
| 120 | out = fossil_fopen(zCmdFName, "wb"); |
| 121 | if( out==0 ) goto end_request; |
| 122 | fwrite(zCmd, 1, strlen(zCmd), out); |
| 123 | fclose(out); |
| 124 | |
| 125 |
| --- src/winhttp.c | |
| +++ src/winhttp.c | |
| @@ -111,14 +111,18 @@ | |
| 111 | } |
| 112 | wanted -= got; |
| 113 | } |
| 114 | fclose(out); |
| 115 | out = 0; |
| 116 | sqlite3_snprintf(sizeof(zCmd), zCmd, "%s%s\n%s\n%s", |
| 117 | get_utf8_bom(0), zRequestFName, zReplyFName, inet_ntoa(p->addr.sin_addr) |
| 118 | ); |
| 119 | /* if g.zLocalRoot is set, then we are in a checkout directory, |
| 120 | ** even if the db handle is now closed */ |
| 121 | if( !g.zLocalRoot || !g.zLocalRoot[0] ){ |
| 122 | sqlite3_snprintf(sizeof(zCmd), zCmd, "%s\n%s", zCmd, g.zRepositoryName); |
| 123 | } |
| 124 | out = fossil_fopen(zCmdFName, "wb"); |
| 125 | if( out==0 ) goto end_request; |
| 126 | fwrite(zCmd, 1, strlen(zCmd), out); |
| 127 | fclose(out); |
| 128 | |
| 129 |