Fossil SCM
Make the '--th-trace' option work properly on Windows.
Commit
11d3d721252fbcd98117b5bec864aa954b1aaa1b
Parent
1c0b1a58c60328c…
2 files changed
+3
+4
-1
+3
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -2363,10 +2363,11 @@ | ||
| 2363 | 2363 | ** --nossl signal that no SSL connections are available |
| 2364 | 2364 | ** --notfound URL use URL as "HTTP 404, object not found" page. |
| 2365 | 2365 | ** --repolist If REPOSITORY is directory, URL "/" lists all repos |
| 2366 | 2366 | ** --scgi Interpret input as SCGI rather than HTTP |
| 2367 | 2367 | ** --skin LABEL Use override skin LABEL |
| 2368 | +** --th-trace trace TH1 execution (for debugging purposes) | |
| 2368 | 2369 | ** |
| 2369 | 2370 | ** See also: cgi, server, winsrv |
| 2370 | 2371 | */ |
| 2371 | 2372 | void cmd_http(void){ |
| 2372 | 2373 | const char *zIpAddr = 0; |
| @@ -2375,10 +2376,12 @@ | ||
| 2375 | 2376 | const char *zAltBase; |
| 2376 | 2377 | const char *zFileGlob; |
| 2377 | 2378 | int useSCGI; |
| 2378 | 2379 | int noJail; |
| 2379 | 2380 | int allowRepoList; |
| 2381 | + | |
| 2382 | + Th_InitTraceLog(); | |
| 2380 | 2383 | |
| 2381 | 2384 | /* The winhttp module passes the --files option as --files-urlenc with |
| 2382 | 2385 | ** the argument being URL encoded, to avoid wildcard expansion in the |
| 2383 | 2386 | ** shell. This option is for internal use and is undocumented. |
| 2384 | 2387 | */ |
| 2385 | 2388 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -2363,10 +2363,11 @@ | |
| 2363 | ** --nossl signal that no SSL connections are available |
| 2364 | ** --notfound URL use URL as "HTTP 404, object not found" page. |
| 2365 | ** --repolist If REPOSITORY is directory, URL "/" lists all repos |
| 2366 | ** --scgi Interpret input as SCGI rather than HTTP |
| 2367 | ** --skin LABEL Use override skin LABEL |
| 2368 | ** |
| 2369 | ** See also: cgi, server, winsrv |
| 2370 | */ |
| 2371 | void cmd_http(void){ |
| 2372 | const char *zIpAddr = 0; |
| @@ -2375,10 +2376,12 @@ | |
| 2375 | const char *zAltBase; |
| 2376 | const char *zFileGlob; |
| 2377 | int useSCGI; |
| 2378 | int noJail; |
| 2379 | int allowRepoList; |
| 2380 | |
| 2381 | /* The winhttp module passes the --files option as --files-urlenc with |
| 2382 | ** the argument being URL encoded, to avoid wildcard expansion in the |
| 2383 | ** shell. This option is for internal use and is undocumented. |
| 2384 | */ |
| 2385 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -2363,10 +2363,11 @@ | |
| 2363 | ** --nossl signal that no SSL connections are available |
| 2364 | ** --notfound URL use URL as "HTTP 404, object not found" page. |
| 2365 | ** --repolist If REPOSITORY is directory, URL "/" lists all repos |
| 2366 | ** --scgi Interpret input as SCGI rather than HTTP |
| 2367 | ** --skin LABEL Use override skin LABEL |
| 2368 | ** --th-trace trace TH1 execution (for debugging purposes) |
| 2369 | ** |
| 2370 | ** See also: cgi, server, winsrv |
| 2371 | */ |
| 2372 | void cmd_http(void){ |
| 2373 | const char *zIpAddr = 0; |
| @@ -2375,10 +2376,12 @@ | |
| 2376 | const char *zAltBase; |
| 2377 | const char *zFileGlob; |
| 2378 | int useSCGI; |
| 2379 | int noJail; |
| 2380 | int allowRepoList; |
| 2381 | |
| 2382 | Th_InitTraceLog(); |
| 2383 | |
| 2384 | /* The winhttp module passes the --files option as --files-urlenc with |
| 2385 | ** the argument being URL encoded, to avoid wildcard expansion in the |
| 2386 | ** shell. This option is for internal use and is undocumented. |
| 2387 | */ |
| 2388 |
+4
-1
| --- src/winhttp.c | ||
| +++ src/winhttp.c | ||
| @@ -34,11 +34,11 @@ | ||
| 34 | 34 | struct HttpRequest { |
| 35 | 35 | int id; /* ID counter */ |
| 36 | 36 | SOCKET s; /* Socket on which to receive data */ |
| 37 | 37 | SOCKADDR_IN addr; /* Address from which data is coming */ |
| 38 | 38 | int flags; /* Flags passed to win32_http_server() */ |
| 39 | - const char *zOptions; /* --baseurl, --notfound and/or --localauth options */ | |
| 39 | + const char *zOptions; /* --baseurl, --notfound, --localauth, --th-trace */ | |
| 40 | 40 | }; |
| 41 | 41 | |
| 42 | 42 | /* |
| 43 | 43 | ** Prefix for a temporary file. |
| 44 | 44 | */ |
| @@ -265,10 +265,13 @@ | ||
| 265 | 265 | blob_appendf(&options, " --files-urlenc %T", zFileGlob); |
| 266 | 266 | } |
| 267 | 267 | if( g.useLocalauth ){ |
| 268 | 268 | blob_appendf(&options, " --localauth"); |
| 269 | 269 | } |
| 270 | + if( g.thTrace ){ | |
| 271 | + blob_appendf(&options, " --th-trace"); | |
| 272 | + } | |
| 270 | 273 | if( flags & HTTP_SERVER_REPOLIST ){ |
| 271 | 274 | blob_appendf(&options, " --repolist"); |
| 272 | 275 | } |
| 273 | 276 | if( WSAStartup(MAKEWORD(1,1), &wd) ){ |
| 274 | 277 | fossil_fatal("unable to initialize winsock"); |
| 275 | 278 |
| --- src/winhttp.c | |
| +++ src/winhttp.c | |
| @@ -34,11 +34,11 @@ | |
| 34 | struct HttpRequest { |
| 35 | int id; /* ID counter */ |
| 36 | SOCKET s; /* Socket on which to receive data */ |
| 37 | SOCKADDR_IN addr; /* Address from which data is coming */ |
| 38 | int flags; /* Flags passed to win32_http_server() */ |
| 39 | const char *zOptions; /* --baseurl, --notfound and/or --localauth options */ |
| 40 | }; |
| 41 | |
| 42 | /* |
| 43 | ** Prefix for a temporary file. |
| 44 | */ |
| @@ -265,10 +265,13 @@ | |
| 265 | blob_appendf(&options, " --files-urlenc %T", zFileGlob); |
| 266 | } |
| 267 | if( g.useLocalauth ){ |
| 268 | blob_appendf(&options, " --localauth"); |
| 269 | } |
| 270 | if( flags & HTTP_SERVER_REPOLIST ){ |
| 271 | blob_appendf(&options, " --repolist"); |
| 272 | } |
| 273 | if( WSAStartup(MAKEWORD(1,1), &wd) ){ |
| 274 | fossil_fatal("unable to initialize winsock"); |
| 275 |
| --- src/winhttp.c | |
| +++ src/winhttp.c | |
| @@ -34,11 +34,11 @@ | |
| 34 | struct HttpRequest { |
| 35 | int id; /* ID counter */ |
| 36 | SOCKET s; /* Socket on which to receive data */ |
| 37 | SOCKADDR_IN addr; /* Address from which data is coming */ |
| 38 | int flags; /* Flags passed to win32_http_server() */ |
| 39 | const char *zOptions; /* --baseurl, --notfound, --localauth, --th-trace */ |
| 40 | }; |
| 41 | |
| 42 | /* |
| 43 | ** Prefix for a temporary file. |
| 44 | */ |
| @@ -265,10 +265,13 @@ | |
| 265 | blob_appendf(&options, " --files-urlenc %T", zFileGlob); |
| 266 | } |
| 267 | if( g.useLocalauth ){ |
| 268 | blob_appendf(&options, " --localauth"); |
| 269 | } |
| 270 | if( g.thTrace ){ |
| 271 | blob_appendf(&options, " --th-trace"); |
| 272 | } |
| 273 | if( flags & HTTP_SERVER_REPOLIST ){ |
| 274 | blob_appendf(&options, " --repolist"); |
| 275 | } |
| 276 | if( WSAStartup(MAKEWORD(1,1), &wd) ){ |
| 277 | fossil_fatal("unable to initialize winsock"); |
| 278 |