Fossil SCM
Change the backoffice-nodelay setting back to default off. Work around a bug in althttpd by making sure CGI runs with no file descriptors open other than 0, 1, and 2.
Commit
1073593e901e179137d9c332ac577dbff9fd1fdfc2f6912d03bd3b7189c2fca8
Parent
71260ba25e79f4a…
4 files changed
+1
-1
+1
-5
+1
-1
+5
+1
-1
| --- src/backoffice.c | ||
| +++ src/backoffice.c | ||
| @@ -262,11 +262,11 @@ | ||
| 262 | 262 | getpid()); |
| 263 | 263 | } |
| 264 | 264 | backoffice_work(); |
| 265 | 265 | break; |
| 266 | 266 | } |
| 267 | - if( backofficeNoDelay || db_get_boolean("backoffice-nodelay",1) ){ | |
| 267 | + if( backofficeNoDelay || db_get_boolean("backoffice-nodelay",0) ){ | |
| 268 | 268 | /* If the no-delay flag is set, exit immediately rather than queuing |
| 269 | 269 | ** up. Assume that some future request will come along and handle any |
| 270 | 270 | ** necessary backoffice work. */ |
| 271 | 271 | db_end_transaction(0); |
| 272 | 272 | break; |
| 273 | 273 |
| --- src/backoffice.c | |
| +++ src/backoffice.c | |
| @@ -262,11 +262,11 @@ | |
| 262 | getpid()); |
| 263 | } |
| 264 | backoffice_work(); |
| 265 | break; |
| 266 | } |
| 267 | if( backofficeNoDelay || db_get_boolean("backoffice-nodelay",1) ){ |
| 268 | /* If the no-delay flag is set, exit immediately rather than queuing |
| 269 | ** up. Assume that some future request will come along and handle any |
| 270 | ** necessary backoffice work. */ |
| 271 | db_end_transaction(0); |
| 272 | break; |
| 273 |
| --- src/backoffice.c | |
| +++ src/backoffice.c | |
| @@ -262,11 +262,11 @@ | |
| 262 | getpid()); |
| 263 | } |
| 264 | backoffice_work(); |
| 265 | break; |
| 266 | } |
| 267 | if( backofficeNoDelay || db_get_boolean("backoffice-nodelay",0) ){ |
| 268 | /* If the no-delay flag is set, exit immediately rather than queuing |
| 269 | ** up. Assume that some future request will come along and handle any |
| 270 | ** necessary backoffice work. */ |
| 271 | db_end_transaction(0); |
| 272 | break; |
| 273 |
+1
-5
| --- src/cgi.c | ||
| +++ src/cgi.c | ||
| @@ -1929,16 +1929,12 @@ | ||
| 1929 | 1929 | fd = dup(connection); |
| 1930 | 1930 | if( fd!=0 ) nErr++; |
| 1931 | 1931 | close(1); |
| 1932 | 1932 | fd = dup(connection); |
| 1933 | 1933 | if( fd!=1 ) nErr++; |
| 1934 | - if( 0 && !g.fAnyTrace ){ | |
| 1935 | - close(2); | |
| 1936 | - fd = dup(connection); | |
| 1937 | - if( fd!=2 ) nErr++; | |
| 1938 | - } | |
| 1939 | 1934 | close(connection); |
| 1935 | + for(fd=3; close(fd)==0; fd++){} | |
| 1940 | 1936 | g.nPendingRequest = nchildren+1; |
| 1941 | 1937 | g.nRequest = nRequest+1; |
| 1942 | 1938 | return nErr; |
| 1943 | 1939 | } |
| 1944 | 1940 | } |
| 1945 | 1941 |
| --- src/cgi.c | |
| +++ src/cgi.c | |
| @@ -1929,16 +1929,12 @@ | |
| 1929 | fd = dup(connection); |
| 1930 | if( fd!=0 ) nErr++; |
| 1931 | close(1); |
| 1932 | fd = dup(connection); |
| 1933 | if( fd!=1 ) nErr++; |
| 1934 | if( 0 && !g.fAnyTrace ){ |
| 1935 | close(2); |
| 1936 | fd = dup(connection); |
| 1937 | if( fd!=2 ) nErr++; |
| 1938 | } |
| 1939 | close(connection); |
| 1940 | g.nPendingRequest = nchildren+1; |
| 1941 | g.nRequest = nRequest+1; |
| 1942 | return nErr; |
| 1943 | } |
| 1944 | } |
| 1945 |
| --- src/cgi.c | |
| +++ src/cgi.c | |
| @@ -1929,16 +1929,12 @@ | |
| 1929 | fd = dup(connection); |
| 1930 | if( fd!=0 ) nErr++; |
| 1931 | close(1); |
| 1932 | fd = dup(connection); |
| 1933 | if( fd!=1 ) nErr++; |
| 1934 | close(connection); |
| 1935 | for(fd=3; close(fd)==0; fd++){} |
| 1936 | g.nPendingRequest = nchildren+1; |
| 1937 | g.nRequest = nRequest+1; |
| 1938 | return nErr; |
| 1939 | } |
| 1940 | } |
| 1941 |
M
src/db.c
+1
-1
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -3027,11 +3027,11 @@ | ||
| 3027 | 3027 | ** If autosync is enabled setting this to a value greater |
| 3028 | 3028 | ** than zero will cause autosync to try no more than this |
| 3029 | 3029 | ** number of attempts if there is a sync failure. |
| 3030 | 3030 | */ |
| 3031 | 3031 | /* |
| 3032 | -** SETTING: backoffice-nodelay boolean default=on | |
| 3032 | +** SETTING: backoffice-nodelay boolean default=off | |
| 3033 | 3033 | ** If backoffice-nodelay is true, then the backoffice processing |
| 3034 | 3034 | ** will never invoke sleep(). If it has nothing useful to do, |
| 3035 | 3035 | ** it simply exits. |
| 3036 | 3036 | */ |
| 3037 | 3037 | /* |
| 3038 | 3038 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -3027,11 +3027,11 @@ | |
| 3027 | ** If autosync is enabled setting this to a value greater |
| 3028 | ** than zero will cause autosync to try no more than this |
| 3029 | ** number of attempts if there is a sync failure. |
| 3030 | */ |
| 3031 | /* |
| 3032 | ** SETTING: backoffice-nodelay boolean default=on |
| 3033 | ** If backoffice-nodelay is true, then the backoffice processing |
| 3034 | ** will never invoke sleep(). If it has nothing useful to do, |
| 3035 | ** it simply exits. |
| 3036 | */ |
| 3037 | /* |
| 3038 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -3027,11 +3027,11 @@ | |
| 3027 | ** If autosync is enabled setting this to a value greater |
| 3028 | ** than zero will cause autosync to try no more than this |
| 3029 | ** number of attempts if there is a sync failure. |
| 3030 | */ |
| 3031 | /* |
| 3032 | ** SETTING: backoffice-nodelay boolean default=off |
| 3033 | ** If backoffice-nodelay is true, then the backoffice processing |
| 3034 | ** will never invoke sleep(). If it has nothing useful to do, |
| 3035 | ** it simply exits. |
| 3036 | */ |
| 3037 | /* |
| 3038 |
+5
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -2019,10 +2019,15 @@ | ||
| 2019 | 2019 | } |
| 2020 | 2020 | g.httpOut = stdout; |
| 2021 | 2021 | g.httpIn = stdin; |
| 2022 | 2022 | fossil_binary_mode(g.httpOut); |
| 2023 | 2023 | fossil_binary_mode(g.httpIn); |
| 2024 | +#if !defined(_WIN32) | |
| 2025 | + /* Work around a bug in older versions of althttpd by making sure no | |
| 2026 | + ** file descriptors other than 0, 1, and 2 are open. */ | |
| 2027 | + { int i; for(i=3; close(i)==0; i++){} } | |
| 2028 | +#endif | |
| 2024 | 2029 | g.cgiOutput = 1; |
| 2025 | 2030 | blob_read_from_file(&config, zFile, ExtFILE); |
| 2026 | 2031 | while( blob_line(&config, &line) ){ |
| 2027 | 2032 | if( !blob_token(&line, &key) ) continue; |
| 2028 | 2033 | if( blob_buffer(&key)[0]=='#' ) continue; |
| 2029 | 2034 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -2019,10 +2019,15 @@ | |
| 2019 | } |
| 2020 | g.httpOut = stdout; |
| 2021 | g.httpIn = stdin; |
| 2022 | fossil_binary_mode(g.httpOut); |
| 2023 | fossil_binary_mode(g.httpIn); |
| 2024 | g.cgiOutput = 1; |
| 2025 | blob_read_from_file(&config, zFile, ExtFILE); |
| 2026 | while( blob_line(&config, &line) ){ |
| 2027 | if( !blob_token(&line, &key) ) continue; |
| 2028 | if( blob_buffer(&key)[0]=='#' ) continue; |
| 2029 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -2019,10 +2019,15 @@ | |
| 2019 | } |
| 2020 | g.httpOut = stdout; |
| 2021 | g.httpIn = stdin; |
| 2022 | fossil_binary_mode(g.httpOut); |
| 2023 | fossil_binary_mode(g.httpIn); |
| 2024 | #if !defined(_WIN32) |
| 2025 | /* Work around a bug in older versions of althttpd by making sure no |
| 2026 | ** file descriptors other than 0, 1, and 2 are open. */ |
| 2027 | { int i; for(i=3; close(i)==0; i++){} } |
| 2028 | #endif |
| 2029 | g.cgiOutput = 1; |
| 2030 | blob_read_from_file(&config, zFile, ExtFILE); |
| 2031 | while( blob_line(&config, &line) ){ |
| 2032 | if( !blob_token(&line, &key) ) continue; |
| 2033 | if( blob_buffer(&key)[0]=='#' ) continue; |
| 2034 |