Fossil SCM
Merge enhancements from trunk.
Commit
fd7a2f4c43ef76828ee4a40728beca8c490452345e42e114f227a2187ac222ab
Parent
ffe8db5758ddaa2…
13 files changed
+3
+2
-2
+2
+2
-2
+23
+2
-1
+25
-20
+3
-3
+5
-5
+8
+6
-4
+2
-2
+2
-2
+3
| --- Makefile.classic | ||
| +++ Makefile.classic | ||
| @@ -19,10 +19,11 @@ | ||
| 19 | 19 | # will run on the platform that is doing the build. This is used |
| 20 | 20 | # to compile code-generator programs as part of the build process. |
| 21 | 21 | # See TCC below for the C compiler for building the finished binary. |
| 22 | 22 | # |
| 23 | 23 | BCC = gcc |
| 24 | +BCCFLAGS = $(CFLAGS) | |
| 24 | 25 | |
| 25 | 26 | #### The suffix to add to final executable file. When cross-compiling |
| 26 | 27 | # to windows, make this ".exe". Otherwise leave it blank. |
| 27 | 28 | # |
| 28 | 29 | E = |
| @@ -49,10 +50,12 @@ | ||
| 49 | 50 | |
| 50 | 51 | #### We sometimes add the -static option here so that we can build a |
| 51 | 52 | # static executable that will run in a chroot jail. |
| 52 | 53 | #LIB = -static |
| 53 | 54 | TCC += -DFOSSIL_DYNAMIC_BUILD=1 |
| 55 | + | |
| 56 | +TCCFLAGS = $(CFLAGS) | |
| 54 | 57 | |
| 55 | 58 | #### Extra arguments for linking the finished binary. Fossil needs |
| 56 | 59 | # to link against the Z-Lib compression library unless the miniz |
| 57 | 60 | # library in the source tree is being used. There are no other |
| 58 | 61 | # required dependencies. |
| 59 | 62 |
| --- Makefile.classic | |
| +++ Makefile.classic | |
| @@ -19,10 +19,11 @@ | |
| 19 | # will run on the platform that is doing the build. This is used |
| 20 | # to compile code-generator programs as part of the build process. |
| 21 | # See TCC below for the C compiler for building the finished binary. |
| 22 | # |
| 23 | BCC = gcc |
| 24 | |
| 25 | #### The suffix to add to final executable file. When cross-compiling |
| 26 | # to windows, make this ".exe". Otherwise leave it blank. |
| 27 | # |
| 28 | E = |
| @@ -49,10 +50,12 @@ | |
| 49 | |
| 50 | #### We sometimes add the -static option here so that we can build a |
| 51 | # static executable that will run in a chroot jail. |
| 52 | #LIB = -static |
| 53 | TCC += -DFOSSIL_DYNAMIC_BUILD=1 |
| 54 | |
| 55 | #### Extra arguments for linking the finished binary. Fossil needs |
| 56 | # to link against the Z-Lib compression library unless the miniz |
| 57 | # library in the source tree is being used. There are no other |
| 58 | # required dependencies. |
| 59 |
| --- Makefile.classic | |
| +++ Makefile.classic | |
| @@ -19,10 +19,11 @@ | |
| 19 | # will run on the platform that is doing the build. This is used |
| 20 | # to compile code-generator programs as part of the build process. |
| 21 | # See TCC below for the C compiler for building the finished binary. |
| 22 | # |
| 23 | BCC = gcc |
| 24 | BCCFLAGS = $(CFLAGS) |
| 25 | |
| 26 | #### The suffix to add to final executable file. When cross-compiling |
| 27 | # to windows, make this ".exe". Otherwise leave it blank. |
| 28 | # |
| 29 | E = |
| @@ -49,10 +50,12 @@ | |
| 50 | |
| 51 | #### We sometimes add the -static option here so that we can build a |
| 52 | # static executable that will run in a chroot jail. |
| 53 | #LIB = -static |
| 54 | TCC += -DFOSSIL_DYNAMIC_BUILD=1 |
| 55 | |
| 56 | TCCFLAGS = $(CFLAGS) |
| 57 | |
| 58 | #### Extra arguments for linking the finished binary. Fossil needs |
| 59 | # to link against the Z-Lib compression library unless the miniz |
| 60 | # library in the source tree is being used. There are no other |
| 61 | # required dependencies. |
| 62 |
+2
-2
| --- Makefile.in | ||
| +++ Makefile.in | ||
| @@ -38,12 +38,12 @@ | ||
| 38 | 38 | # |
| 39 | 39 | TCLSH = tclsh |
| 40 | 40 | |
| 41 | 41 | CFLAGS = @CFLAGS@ |
| 42 | 42 | LIB = @LDFLAGS@ @EXTRA_LDFLAGS@ @LIBS@ |
| 43 | -BCCFLAGS = @CPPFLAGS@ @CFLAGS@ | |
| 44 | -TCCFLAGS = @EXTRA_CFLAGS@ @CPPFLAGS@ @CFLAGS@ -DHAVE_AUTOCONFIG_H -D_HAVE_SQLITE_CONFIG_H -DFOSSIL_ENABLE_LEGACY_MV_RM=1 | |
| 43 | +BCCFLAGS = @CPPFLAGS@ $(CFLAGS) | |
| 44 | +TCCFLAGS = @EXTRA_CFLAGS@ @CPPFLAGS@ $(CFLAGS) -DHAVE_AUTOCONFIG_H -D_HAVE_SQLITE_CONFIG_H | |
| 45 | 45 | INSTALLDIR = $(DESTDIR)@prefix@/bin |
| 46 | 46 | USE_SYSTEM_SQLITE = @USE_SYSTEM_SQLITE@ |
| 47 | 47 | USE_LINENOISE = @USE_LINENOISE@ |
| 48 | 48 | USE_MMAN_H = @USE_MMAN_H@ |
| 49 | 49 | USE_SEE = @USE_SEE@ |
| 50 | 50 |
| --- Makefile.in | |
| +++ Makefile.in | |
| @@ -38,12 +38,12 @@ | |
| 38 | # |
| 39 | TCLSH = tclsh |
| 40 | |
| 41 | CFLAGS = @CFLAGS@ |
| 42 | LIB = @LDFLAGS@ @EXTRA_LDFLAGS@ @LIBS@ |
| 43 | BCCFLAGS = @CPPFLAGS@ @CFLAGS@ |
| 44 | TCCFLAGS = @EXTRA_CFLAGS@ @CPPFLAGS@ @CFLAGS@ -DHAVE_AUTOCONFIG_H -D_HAVE_SQLITE_CONFIG_H -DFOSSIL_ENABLE_LEGACY_MV_RM=1 |
| 45 | INSTALLDIR = $(DESTDIR)@prefix@/bin |
| 46 | USE_SYSTEM_SQLITE = @USE_SYSTEM_SQLITE@ |
| 47 | USE_LINENOISE = @USE_LINENOISE@ |
| 48 | USE_MMAN_H = @USE_MMAN_H@ |
| 49 | USE_SEE = @USE_SEE@ |
| 50 |
| --- Makefile.in | |
| +++ Makefile.in | |
| @@ -38,12 +38,12 @@ | |
| 38 | # |
| 39 | TCLSH = tclsh |
| 40 | |
| 41 | CFLAGS = @CFLAGS@ |
| 42 | LIB = @LDFLAGS@ @EXTRA_LDFLAGS@ @LIBS@ |
| 43 | BCCFLAGS = @CPPFLAGS@ $(CFLAGS) |
| 44 | TCCFLAGS = @EXTRA_CFLAGS@ @CPPFLAGS@ $(CFLAGS) -DHAVE_AUTOCONFIG_H -D_HAVE_SQLITE_CONFIG_H |
| 45 | INSTALLDIR = $(DESTDIR)@prefix@/bin |
| 46 | USE_SYSTEM_SQLITE = @USE_SYSTEM_SQLITE@ |
| 47 | USE_LINENOISE = @USE_LINENOISE@ |
| 48 | USE_MMAN_H = @USE_MMAN_H@ |
| 49 | USE_SEE = @USE_SEE@ |
| 50 |
+2
| --- Makefile.osx-jaguar | ||
| +++ Makefile.osx-jaguar | ||
| @@ -33,17 +33,19 @@ | ||
| 33 | 33 | # will run on the platform that is doing the build. This is used |
| 34 | 34 | # to compile code-generator programs as part of the build process. |
| 35 | 35 | # See TCC below for the C compiler for building the finished binary. |
| 36 | 36 | # |
| 37 | 37 | BCC = cc |
| 38 | +BCCFLAGS = $(CFLAGS) | |
| 38 | 39 | |
| 39 | 40 | #### The suffix to add to final executable file. When cross-compiling |
| 40 | 41 | # to windows, make this ".exe". Otherwise leave it blank. |
| 41 | 42 | # |
| 42 | 43 | E = |
| 43 | 44 | |
| 44 | 45 | TCC = cc |
| 46 | +TCCFLAGS = $(CFLAGS) | |
| 45 | 47 | |
| 46 | 48 | #### Tcl shell for use in running the fossil testsuite. If you do not |
| 47 | 49 | # care about testing the end result, this can be blank. |
| 48 | 50 | # |
| 49 | 51 | TCLSH = tclsh |
| 50 | 52 |
| --- Makefile.osx-jaguar | |
| +++ Makefile.osx-jaguar | |
| @@ -33,17 +33,19 @@ | |
| 33 | # will run on the platform that is doing the build. This is used |
| 34 | # to compile code-generator programs as part of the build process. |
| 35 | # See TCC below for the C compiler for building the finished binary. |
| 36 | # |
| 37 | BCC = cc |
| 38 | |
| 39 | #### The suffix to add to final executable file. When cross-compiling |
| 40 | # to windows, make this ".exe". Otherwise leave it blank. |
| 41 | # |
| 42 | E = |
| 43 | |
| 44 | TCC = cc |
| 45 | |
| 46 | #### Tcl shell for use in running the fossil testsuite. If you do not |
| 47 | # care about testing the end result, this can be blank. |
| 48 | # |
| 49 | TCLSH = tclsh |
| 50 |
| --- Makefile.osx-jaguar | |
| +++ Makefile.osx-jaguar | |
| @@ -33,17 +33,19 @@ | |
| 33 | # will run on the platform that is doing the build. This is used |
| 34 | # to compile code-generator programs as part of the build process. |
| 35 | # See TCC below for the C compiler for building the finished binary. |
| 36 | # |
| 37 | BCC = cc |
| 38 | BCCFLAGS = $(CFLAGS) |
| 39 | |
| 40 | #### The suffix to add to final executable file. When cross-compiling |
| 41 | # to windows, make this ".exe". Otherwise leave it blank. |
| 42 | # |
| 43 | E = |
| 44 | |
| 45 | TCC = cc |
| 46 | TCCFLAGS = $(CFLAGS) |
| 47 | |
| 48 | #### Tcl shell for use in running the fossil testsuite. If you do not |
| 49 | # care about testing the end result, this can be blank. |
| 50 | # |
| 51 | TCLSH = tclsh |
| 52 |
M
auto.def
+2
-2
| --- auto.def | ||
| +++ auto.def | ||
| @@ -134,12 +134,12 @@ | ||
| 134 | 134 | if {[string match *-solaris* [get-define host]]} { |
| 135 | 135 | define-append EXTRA_CFLAGS {-D_XOPEN_SOURCE=500 -D__EXTENSIONS__} |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | if {[opt-bool fossil-debug]} { |
| 139 | - define-append EXTRA_CFLAGS -DFOSSIL_DEBUG | |
| 140 | 139 | define CFLAGS {-g -O0 -Wall} |
| 140 | + define-append CFLAGS -DFOSSIL_DEBUG | |
| 141 | 141 | msg-result "Debugging support enabled" |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | if {[opt-bool no-opt]} { |
| 145 | 145 | define CFLAGS {-g -O0 -Wall} |
| @@ -167,11 +167,11 @@ | ||
| 167 | 167 | define FOSSIL_ENABLE_JSON |
| 168 | 168 | msg-result "JSON support enabled" |
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | if {[opt-bool with-legacy-mv-rm]} { |
| 172 | - define-append EXTRA_CFLAGS -DFOSSIL_ENABLE_LEGACY_MV_RM | |
| 172 | + define-append EXTRA_CFLAGS -DFOSSIL_ENABLE_LEGACY_MV_RM=1 | |
| 173 | 173 | define FOSSIL_ENABLE_LEGACY_MV_RM |
| 174 | 174 | msg-result "Legacy mv/rm support enabled" |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | if {[opt-bool with-exec-rel-paths]} { |
| 178 | 178 |
| --- auto.def | |
| +++ auto.def | |
| @@ -134,12 +134,12 @@ | |
| 134 | if {[string match *-solaris* [get-define host]]} { |
| 135 | define-append EXTRA_CFLAGS {-D_XOPEN_SOURCE=500 -D__EXTENSIONS__} |
| 136 | } |
| 137 | |
| 138 | if {[opt-bool fossil-debug]} { |
| 139 | define-append EXTRA_CFLAGS -DFOSSIL_DEBUG |
| 140 | define CFLAGS {-g -O0 -Wall} |
| 141 | msg-result "Debugging support enabled" |
| 142 | } |
| 143 | |
| 144 | if {[opt-bool no-opt]} { |
| 145 | define CFLAGS {-g -O0 -Wall} |
| @@ -167,11 +167,11 @@ | |
| 167 | define FOSSIL_ENABLE_JSON |
| 168 | msg-result "JSON support enabled" |
| 169 | } |
| 170 | |
| 171 | if {[opt-bool with-legacy-mv-rm]} { |
| 172 | define-append EXTRA_CFLAGS -DFOSSIL_ENABLE_LEGACY_MV_RM |
| 173 | define FOSSIL_ENABLE_LEGACY_MV_RM |
| 174 | msg-result "Legacy mv/rm support enabled" |
| 175 | } |
| 176 | |
| 177 | if {[opt-bool with-exec-rel-paths]} { |
| 178 |
| --- auto.def | |
| +++ auto.def | |
| @@ -134,12 +134,12 @@ | |
| 134 | if {[string match *-solaris* [get-define host]]} { |
| 135 | define-append EXTRA_CFLAGS {-D_XOPEN_SOURCE=500 -D__EXTENSIONS__} |
| 136 | } |
| 137 | |
| 138 | if {[opt-bool fossil-debug]} { |
| 139 | define CFLAGS {-g -O0 -Wall} |
| 140 | define-append CFLAGS -DFOSSIL_DEBUG |
| 141 | msg-result "Debugging support enabled" |
| 142 | } |
| 143 | |
| 144 | if {[opt-bool no-opt]} { |
| 145 | define CFLAGS {-g -O0 -Wall} |
| @@ -167,11 +167,11 @@ | |
| 167 | define FOSSIL_ENABLE_JSON |
| 168 | msg-result "JSON support enabled" |
| 169 | } |
| 170 | |
| 171 | if {[opt-bool with-legacy-mv-rm]} { |
| 172 | define-append EXTRA_CFLAGS -DFOSSIL_ENABLE_LEGACY_MV_RM=1 |
| 173 | define FOSSIL_ENABLE_LEGACY_MV_RM |
| 174 | msg-result "Legacy mv/rm support enabled" |
| 175 | } |
| 176 | |
| 177 | if {[opt-bool with-exec-rel-paths]} { |
| 178 |
+23
| --- src/backoffice.c | ||
| +++ src/backoffice.c | ||
| @@ -69,10 +69,26 @@ | ||
| 69 | 69 | sqlite3_uint64 tmCurrent; /* Expiration of the current lease */ |
| 70 | 70 | sqlite3_uint64 idNext; /* ID for the next lease holder on queue */ |
| 71 | 71 | sqlite3_uint64 tmNext; /* Expiration of the next lease */ |
| 72 | 72 | }; |
| 73 | 73 | #endif |
| 74 | + | |
| 75 | +/* | |
| 76 | +** Set to prevent backoffice processing from every entering sleep or | |
| 77 | +** otherwise taking a long time to complete. Set this when a user-visible | |
| 78 | +** process might need to wait for backoffice to complete. | |
| 79 | +*/ | |
| 80 | +static int backofficeNoDelay = 0; | |
| 81 | + | |
| 82 | + | |
| 83 | +/* | |
| 84 | +** Disable the backoffice | |
| 85 | +*/ | |
| 86 | +void backoffice_no_delay(void){ | |
| 87 | + backofficeNoDelay = 1; | |
| 88 | +} | |
| 89 | + | |
| 74 | 90 | |
| 75 | 91 | /* |
| 76 | 92 | ** Parse a unsigned 64-bit integer from a string. Return a pointer |
| 77 | 93 | ** to the character of z[] that occurs after the integer. |
| 78 | 94 | */ |
| @@ -227,10 +243,17 @@ | ||
| 227 | 243 | fprintf(stderr, "/***** Begin Backoffice Processing %d *****/\n", |
| 228 | 244 | getpid()); |
| 229 | 245 | } |
| 230 | 246 | backoffice_work(); |
| 231 | 247 | break; |
| 248 | + } | |
| 249 | + if( backofficeNoDelay ){ | |
| 250 | + /* If the no-delay flag is set, exit immediately rather than queuing | |
| 251 | + ** up. Assume that some future request will come along and handle any | |
| 252 | + ** necessary backoffice work. */ | |
| 253 | + db_end_transaction(0); | |
| 254 | + break; | |
| 232 | 255 | } |
| 233 | 256 | /* This process needs to queue up and wait for the current lease |
| 234 | 257 | ** to expire before continuing. */ |
| 235 | 258 | x.idNext = idSelf; |
| 236 | 259 | x.tmNext = (tmNow>x.tmCurrent ? tmNow : x.tmCurrent) + BKOFCE_LEASE_TIME; |
| 237 | 260 |
| --- src/backoffice.c | |
| +++ src/backoffice.c | |
| @@ -69,10 +69,26 @@ | |
| 69 | sqlite3_uint64 tmCurrent; /* Expiration of the current lease */ |
| 70 | sqlite3_uint64 idNext; /* ID for the next lease holder on queue */ |
| 71 | sqlite3_uint64 tmNext; /* Expiration of the next lease */ |
| 72 | }; |
| 73 | #endif |
| 74 | |
| 75 | /* |
| 76 | ** Parse a unsigned 64-bit integer from a string. Return a pointer |
| 77 | ** to the character of z[] that occurs after the integer. |
| 78 | */ |
| @@ -227,10 +243,17 @@ | |
| 227 | fprintf(stderr, "/***** Begin Backoffice Processing %d *****/\n", |
| 228 | getpid()); |
| 229 | } |
| 230 | backoffice_work(); |
| 231 | break; |
| 232 | } |
| 233 | /* This process needs to queue up and wait for the current lease |
| 234 | ** to expire before continuing. */ |
| 235 | x.idNext = idSelf; |
| 236 | x.tmNext = (tmNow>x.tmCurrent ? tmNow : x.tmCurrent) + BKOFCE_LEASE_TIME; |
| 237 |
| --- src/backoffice.c | |
| +++ src/backoffice.c | |
| @@ -69,10 +69,26 @@ | |
| 69 | sqlite3_uint64 tmCurrent; /* Expiration of the current lease */ |
| 70 | sqlite3_uint64 idNext; /* ID for the next lease holder on queue */ |
| 71 | sqlite3_uint64 tmNext; /* Expiration of the next lease */ |
| 72 | }; |
| 73 | #endif |
| 74 | |
| 75 | /* |
| 76 | ** Set to prevent backoffice processing from every entering sleep or |
| 77 | ** otherwise taking a long time to complete. Set this when a user-visible |
| 78 | ** process might need to wait for backoffice to complete. |
| 79 | */ |
| 80 | static int backofficeNoDelay = 0; |
| 81 | |
| 82 | |
| 83 | /* |
| 84 | ** Disable the backoffice |
| 85 | */ |
| 86 | void backoffice_no_delay(void){ |
| 87 | backofficeNoDelay = 1; |
| 88 | } |
| 89 | |
| 90 | |
| 91 | /* |
| 92 | ** Parse a unsigned 64-bit integer from a string. Return a pointer |
| 93 | ** to the character of z[] that occurs after the integer. |
| 94 | */ |
| @@ -227,10 +243,17 @@ | |
| 243 | fprintf(stderr, "/***** Begin Backoffice Processing %d *****/\n", |
| 244 | getpid()); |
| 245 | } |
| 246 | backoffice_work(); |
| 247 | break; |
| 248 | } |
| 249 | if( backofficeNoDelay ){ |
| 250 | /* If the no-delay flag is set, exit immediately rather than queuing |
| 251 | ** up. Assume that some future request will come along and handle any |
| 252 | ** necessary backoffice work. */ |
| 253 | db_end_transaction(0); |
| 254 | break; |
| 255 | } |
| 256 | /* This process needs to queue up and wait for the current lease |
| 257 | ** to expire before continuing. */ |
| 258 | x.idNext = idSelf; |
| 259 | x.tmNext = (tmNow>x.tmCurrent ? tmNow : x.tmCurrent) + BKOFCE_LEASE_TIME; |
| 260 |
+2
-1
| --- src/http_transport.c | ||
| +++ src/http_transport.c | ||
| @@ -269,11 +269,12 @@ | ||
| 269 | 269 | */ |
| 270 | 270 | void transport_flip(UrlData *pUrlData){ |
| 271 | 271 | if( pUrlData->isFile ){ |
| 272 | 272 | char *zCmd; |
| 273 | 273 | fclose(transport.pFile); |
| 274 | - zCmd = mprintf("\"%s\" http \"%s\" \"%s\" 127.0.0.1 \"%s\" --localauth", | |
| 274 | + zCmd = mprintf("\"%s\" http --in \"%s\" --out \"%s\" --ipaddr 127.0.0.1" | |
| 275 | + " \"%s\" --localauth --nodelay", | |
| 275 | 276 | g.nameOfExe, transport.zOutFile, transport.zInFile, pUrlData->name |
| 276 | 277 | ); |
| 277 | 278 | fossil_system(zCmd); |
| 278 | 279 | free(zCmd); |
| 279 | 280 | transport.pFile = fossil_fopen(transport.zInFile, "rb"); |
| 280 | 281 |
| --- src/http_transport.c | |
| +++ src/http_transport.c | |
| @@ -269,11 +269,12 @@ | |
| 269 | */ |
| 270 | void transport_flip(UrlData *pUrlData){ |
| 271 | if( pUrlData->isFile ){ |
| 272 | char *zCmd; |
| 273 | fclose(transport.pFile); |
| 274 | zCmd = mprintf("\"%s\" http \"%s\" \"%s\" 127.0.0.1 \"%s\" --localauth", |
| 275 | g.nameOfExe, transport.zOutFile, transport.zInFile, pUrlData->name |
| 276 | ); |
| 277 | fossil_system(zCmd); |
| 278 | free(zCmd); |
| 279 | transport.pFile = fossil_fopen(transport.zInFile, "rb"); |
| 280 |
| --- src/http_transport.c | |
| +++ src/http_transport.c | |
| @@ -269,11 +269,12 @@ | |
| 269 | */ |
| 270 | void transport_flip(UrlData *pUrlData){ |
| 271 | if( pUrlData->isFile ){ |
| 272 | char *zCmd; |
| 273 | fclose(transport.pFile); |
| 274 | zCmd = mprintf("\"%s\" http --in \"%s\" --out \"%s\" --ipaddr 127.0.0.1" |
| 275 | " \"%s\" --localauth --nodelay", |
| 276 | g.nameOfExe, transport.zOutFile, transport.zInFile, pUrlData->name |
| 277 | ); |
| 278 | fossil_system(zCmd); |
| 279 | free(zCmd); |
| 280 | transport.pFile = fossil_fopen(transport.zInFile, "rb"); |
| 281 |
+25
-20
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -2254,16 +2254,10 @@ | ||
| 2254 | 2254 | } |
| 2255 | 2255 | } |
| 2256 | 2256 | #endif |
| 2257 | 2257 | |
| 2258 | 2258 | /* |
| 2259 | -** undocumented format: | |
| 2260 | -** | |
| 2261 | -** fossil http INFILE OUTFILE IPADDR ?REPOSITORY? | |
| 2262 | -** | |
| 2263 | -** The argv==6 form (with no options) is used by the win32 server only. | |
| 2264 | -** | |
| 2265 | 2259 | ** COMMAND: http* |
| 2266 | 2260 | ** |
| 2267 | 2261 | ** Usage: %fossil http ?REPOSITORY? ?OPTIONS? |
| 2268 | 2262 | ** |
| 2269 | 2263 | ** Handle a single HTTP request appearing on stdin. The resulting webpage |
| @@ -2297,14 +2291,18 @@ | ||
| 2297 | 2291 | ** --baseurl URL base URL (useful with reverse proxies) |
| 2298 | 2292 | ** --files GLOB comma-separate glob patterns for static file to serve |
| 2299 | 2293 | ** --localauth enable automatic login for local connections |
| 2300 | 2294 | ** --host NAME specify hostname of the server |
| 2301 | 2295 | ** --https signal a request coming in via https |
| 2302 | -** --nocompress Do not compress HTTP replies | |
| 2296 | +** --in FILE Take input from FILE instead of standard input | |
| 2297 | +** --ipaddr ADDR Assume the request comes from the given IP address | |
| 2298 | +** --nocompress do not compress HTTP replies | |
| 2299 | +** --nodelay omit backoffice processing if it would delay process exit | |
| 2303 | 2300 | ** --nojail drop root privilege but do not enter the chroot jail |
| 2304 | 2301 | ** --nossl signal that no SSL connections are available |
| 2305 | 2302 | ** --notfound URL use URL as "HTTP 404, object not found" page. |
| 2303 | +** --out FILE write results to FILE instead of to standard output | |
| 2306 | 2304 | ** --repolist If REPOSITORY is directory, URL "/" lists all repos |
| 2307 | 2305 | ** --scgi Interpret input as SCGI rather than HTTP |
| 2308 | 2306 | ** --skin LABEL Use override skin LABEL |
| 2309 | 2307 | ** --th-trace trace TH1 execution (for debugging purposes) |
| 2310 | 2308 | ** --usepidkey Use saved encryption key from parent process. This is |
| @@ -2316,10 +2314,12 @@ | ||
| 2316 | 2314 | const char *zIpAddr = 0; |
| 2317 | 2315 | const char *zNotFound; |
| 2318 | 2316 | const char *zHost; |
| 2319 | 2317 | const char *zAltBase; |
| 2320 | 2318 | const char *zFileGlob; |
| 2319 | + const char *zInFile; | |
| 2320 | + const char *zOutFile; | |
| 2321 | 2321 | int useSCGI; |
| 2322 | 2322 | int noJail; |
| 2323 | 2323 | int allowRepoList; |
| 2324 | 2324 | #if defined(_WIN32) && USE_SEE |
| 2325 | 2325 | const char *zPidKey; |
| @@ -2344,12 +2344,28 @@ | ||
| 2344 | 2344 | noJail = find_option("nojail",0,0)!=0; |
| 2345 | 2345 | allowRepoList = find_option("repolist",0,0)!=0; |
| 2346 | 2346 | g.useLocalauth = find_option("localauth", 0, 0)!=0; |
| 2347 | 2347 | g.sslNotAvailable = find_option("nossl", 0, 0)!=0; |
| 2348 | 2348 | g.fNoHttpCompress = find_option("nocompress",0,0)!=0; |
| 2349 | + zInFile = find_option("in",0,1); | |
| 2350 | + if( zInFile ){ | |
| 2351 | + g.httpIn = fossil_fopen(zInFile, "rb"); | |
| 2352 | + if( g.httpIn==0 ) fossil_fatal("cannot open \"%s\" for reading", zInFile); | |
| 2353 | + }else{ | |
| 2354 | + g.httpIn = stdin; | |
| 2355 | + } | |
| 2356 | + zOutFile = find_option("out",0,1); | |
| 2357 | + if( zOutFile ){ | |
| 2358 | + g.httpOut = fossil_fopen(zOutFile, "wb"); | |
| 2359 | + if( g.httpOut==0 ) fossil_fatal("cannot open \"%s\" for writing", zOutFile); | |
| 2360 | + }else{ | |
| 2361 | + g.httpOut = stdout; | |
| 2362 | + } | |
| 2363 | + zIpAddr = find_option("ipaddr",0,1); | |
| 2349 | 2364 | useSCGI = find_option("scgi", 0, 0)!=0; |
| 2350 | 2365 | zAltBase = find_option("baseurl", 0, 1); |
| 2366 | + if( find_option("nodelay",0,0)!=0 ) backoffice_no_delay(); | |
| 2351 | 2367 | if( zAltBase ) set_base_url(zAltBase); |
| 2352 | 2368 | if( find_option("https",0,0)!=0 ){ |
| 2353 | 2369 | zIpAddr = fossil_getenv("REMOTE_HOST"); /* From stunnel */ |
| 2354 | 2370 | cgi_replace_parameter("HTTPS","on"); |
| 2355 | 2371 | } |
| @@ -2368,25 +2384,14 @@ | ||
| 2368 | 2384 | #endif |
| 2369 | 2385 | |
| 2370 | 2386 | /* We should be done with options.. */ |
| 2371 | 2387 | verify_all_options(); |
| 2372 | 2388 | |
| 2373 | - if( g.argc!=2 && g.argc!=3 && g.argc!=5 && g.argc!=6 ){ | |
| 2374 | - fossil_panic("no repository specified"); | |
| 2375 | - } | |
| 2389 | + if( g.argc!=2 && g.argc!=3 ) usage("?REPOSITORY?"); | |
| 2376 | 2390 | g.cgiOutput = 1; |
| 2377 | 2391 | g.fullHttpReply = 1; |
| 2378 | - if( g.argc>=5 ){ | |
| 2379 | - g.httpIn = fossil_fopen(g.argv[2], "rb"); | |
| 2380 | - g.httpOut = fossil_fopen(g.argv[3], "wb"); | |
| 2381 | - zIpAddr = g.argv[4]; | |
| 2382 | - find_server_repository(5, 0); | |
| 2383 | - }else{ | |
| 2384 | - g.httpIn = stdin; | |
| 2385 | - g.httpOut = stdout; | |
| 2386 | - find_server_repository(2, 0); | |
| 2387 | - } | |
| 2392 | + find_server_repository(2, 0); | |
| 2388 | 2393 | if( zIpAddr==0 ){ |
| 2389 | 2394 | zIpAddr = cgi_ssh_remote_addr(0); |
| 2390 | 2395 | if( zIpAddr && zIpAddr[0] ){ |
| 2391 | 2396 | g.fSshClient |= CGI_SSH_CLIENT; |
| 2392 | 2397 | } |
| 2393 | 2398 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -2254,16 +2254,10 @@ | |
| 2254 | } |
| 2255 | } |
| 2256 | #endif |
| 2257 | |
| 2258 | /* |
| 2259 | ** undocumented format: |
| 2260 | ** |
| 2261 | ** fossil http INFILE OUTFILE IPADDR ?REPOSITORY? |
| 2262 | ** |
| 2263 | ** The argv==6 form (with no options) is used by the win32 server only. |
| 2264 | ** |
| 2265 | ** COMMAND: http* |
| 2266 | ** |
| 2267 | ** Usage: %fossil http ?REPOSITORY? ?OPTIONS? |
| 2268 | ** |
| 2269 | ** Handle a single HTTP request appearing on stdin. The resulting webpage |
| @@ -2297,14 +2291,18 @@ | |
| 2297 | ** --baseurl URL base URL (useful with reverse proxies) |
| 2298 | ** --files GLOB comma-separate glob patterns for static file to serve |
| 2299 | ** --localauth enable automatic login for local connections |
| 2300 | ** --host NAME specify hostname of the server |
| 2301 | ** --https signal a request coming in via https |
| 2302 | ** --nocompress Do not compress HTTP replies |
| 2303 | ** --nojail drop root privilege but do not enter the chroot jail |
| 2304 | ** --nossl signal that no SSL connections are available |
| 2305 | ** --notfound URL use URL as "HTTP 404, object not found" page. |
| 2306 | ** --repolist If REPOSITORY is directory, URL "/" lists all repos |
| 2307 | ** --scgi Interpret input as SCGI rather than HTTP |
| 2308 | ** --skin LABEL Use override skin LABEL |
| 2309 | ** --th-trace trace TH1 execution (for debugging purposes) |
| 2310 | ** --usepidkey Use saved encryption key from parent process. This is |
| @@ -2316,10 +2314,12 @@ | |
| 2316 | const char *zIpAddr = 0; |
| 2317 | const char *zNotFound; |
| 2318 | const char *zHost; |
| 2319 | const char *zAltBase; |
| 2320 | const char *zFileGlob; |
| 2321 | int useSCGI; |
| 2322 | int noJail; |
| 2323 | int allowRepoList; |
| 2324 | #if defined(_WIN32) && USE_SEE |
| 2325 | const char *zPidKey; |
| @@ -2344,12 +2344,28 @@ | |
| 2344 | noJail = find_option("nojail",0,0)!=0; |
| 2345 | allowRepoList = find_option("repolist",0,0)!=0; |
| 2346 | g.useLocalauth = find_option("localauth", 0, 0)!=0; |
| 2347 | g.sslNotAvailable = find_option("nossl", 0, 0)!=0; |
| 2348 | g.fNoHttpCompress = find_option("nocompress",0,0)!=0; |
| 2349 | useSCGI = find_option("scgi", 0, 0)!=0; |
| 2350 | zAltBase = find_option("baseurl", 0, 1); |
| 2351 | if( zAltBase ) set_base_url(zAltBase); |
| 2352 | if( find_option("https",0,0)!=0 ){ |
| 2353 | zIpAddr = fossil_getenv("REMOTE_HOST"); /* From stunnel */ |
| 2354 | cgi_replace_parameter("HTTPS","on"); |
| 2355 | } |
| @@ -2368,25 +2384,14 @@ | |
| 2368 | #endif |
| 2369 | |
| 2370 | /* We should be done with options.. */ |
| 2371 | verify_all_options(); |
| 2372 | |
| 2373 | if( g.argc!=2 && g.argc!=3 && g.argc!=5 && g.argc!=6 ){ |
| 2374 | fossil_panic("no repository specified"); |
| 2375 | } |
| 2376 | g.cgiOutput = 1; |
| 2377 | g.fullHttpReply = 1; |
| 2378 | if( g.argc>=5 ){ |
| 2379 | g.httpIn = fossil_fopen(g.argv[2], "rb"); |
| 2380 | g.httpOut = fossil_fopen(g.argv[3], "wb"); |
| 2381 | zIpAddr = g.argv[4]; |
| 2382 | find_server_repository(5, 0); |
| 2383 | }else{ |
| 2384 | g.httpIn = stdin; |
| 2385 | g.httpOut = stdout; |
| 2386 | find_server_repository(2, 0); |
| 2387 | } |
| 2388 | if( zIpAddr==0 ){ |
| 2389 | zIpAddr = cgi_ssh_remote_addr(0); |
| 2390 | if( zIpAddr && zIpAddr[0] ){ |
| 2391 | g.fSshClient |= CGI_SSH_CLIENT; |
| 2392 | } |
| 2393 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -2254,16 +2254,10 @@ | |
| 2254 | } |
| 2255 | } |
| 2256 | #endif |
| 2257 | |
| 2258 | /* |
| 2259 | ** COMMAND: http* |
| 2260 | ** |
| 2261 | ** Usage: %fossil http ?REPOSITORY? ?OPTIONS? |
| 2262 | ** |
| 2263 | ** Handle a single HTTP request appearing on stdin. The resulting webpage |
| @@ -2297,14 +2291,18 @@ | |
| 2291 | ** --baseurl URL base URL (useful with reverse proxies) |
| 2292 | ** --files GLOB comma-separate glob patterns for static file to serve |
| 2293 | ** --localauth enable automatic login for local connections |
| 2294 | ** --host NAME specify hostname of the server |
| 2295 | ** --https signal a request coming in via https |
| 2296 | ** --in FILE Take input from FILE instead of standard input |
| 2297 | ** --ipaddr ADDR Assume the request comes from the given IP address |
| 2298 | ** --nocompress do not compress HTTP replies |
| 2299 | ** --nodelay omit backoffice processing if it would delay process exit |
| 2300 | ** --nojail drop root privilege but do not enter the chroot jail |
| 2301 | ** --nossl signal that no SSL connections are available |
| 2302 | ** --notfound URL use URL as "HTTP 404, object not found" page. |
| 2303 | ** --out FILE write results to FILE instead of to standard output |
| 2304 | ** --repolist If REPOSITORY is directory, URL "/" lists all repos |
| 2305 | ** --scgi Interpret input as SCGI rather than HTTP |
| 2306 | ** --skin LABEL Use override skin LABEL |
| 2307 | ** --th-trace trace TH1 execution (for debugging purposes) |
| 2308 | ** --usepidkey Use saved encryption key from parent process. This is |
| @@ -2316,10 +2314,12 @@ | |
| 2314 | const char *zIpAddr = 0; |
| 2315 | const char *zNotFound; |
| 2316 | const char *zHost; |
| 2317 | const char *zAltBase; |
| 2318 | const char *zFileGlob; |
| 2319 | const char *zInFile; |
| 2320 | const char *zOutFile; |
| 2321 | int useSCGI; |
| 2322 | int noJail; |
| 2323 | int allowRepoList; |
| 2324 | #if defined(_WIN32) && USE_SEE |
| 2325 | const char *zPidKey; |
| @@ -2344,12 +2344,28 @@ | |
| 2344 | noJail = find_option("nojail",0,0)!=0; |
| 2345 | allowRepoList = find_option("repolist",0,0)!=0; |
| 2346 | g.useLocalauth = find_option("localauth", 0, 0)!=0; |
| 2347 | g.sslNotAvailable = find_option("nossl", 0, 0)!=0; |
| 2348 | g.fNoHttpCompress = find_option("nocompress",0,0)!=0; |
| 2349 | zInFile = find_option("in",0,1); |
| 2350 | if( zInFile ){ |
| 2351 | g.httpIn = fossil_fopen(zInFile, "rb"); |
| 2352 | if( g.httpIn==0 ) fossil_fatal("cannot open \"%s\" for reading", zInFile); |
| 2353 | }else{ |
| 2354 | g.httpIn = stdin; |
| 2355 | } |
| 2356 | zOutFile = find_option("out",0,1); |
| 2357 | if( zOutFile ){ |
| 2358 | g.httpOut = fossil_fopen(zOutFile, "wb"); |
| 2359 | if( g.httpOut==0 ) fossil_fatal("cannot open \"%s\" for writing", zOutFile); |
| 2360 | }else{ |
| 2361 | g.httpOut = stdout; |
| 2362 | } |
| 2363 | zIpAddr = find_option("ipaddr",0,1); |
| 2364 | useSCGI = find_option("scgi", 0, 0)!=0; |
| 2365 | zAltBase = find_option("baseurl", 0, 1); |
| 2366 | if( find_option("nodelay",0,0)!=0 ) backoffice_no_delay(); |
| 2367 | if( zAltBase ) set_base_url(zAltBase); |
| 2368 | if( find_option("https",0,0)!=0 ){ |
| 2369 | zIpAddr = fossil_getenv("REMOTE_HOST"); /* From stunnel */ |
| 2370 | cgi_replace_parameter("HTTPS","on"); |
| 2371 | } |
| @@ -2368,25 +2384,14 @@ | |
| 2384 | #endif |
| 2385 | |
| 2386 | /* We should be done with options.. */ |
| 2387 | verify_all_options(); |
| 2388 | |
| 2389 | if( g.argc!=2 && g.argc!=3 ) usage("?REPOSITORY?"); |
| 2390 | g.cgiOutput = 1; |
| 2391 | g.fullHttpReply = 1; |
| 2392 | find_server_repository(2, 0); |
| 2393 | if( zIpAddr==0 ){ |
| 2394 | zIpAddr = cgi_ssh_remote_addr(0); |
| 2395 | if( zIpAddr && zIpAddr[0] ){ |
| 2396 | g.fSshClient |= CGI_SSH_CLIENT; |
| 2397 | } |
| 2398 |
+3
-3
| --- src/main.mk | ||
| +++ src/main.mk | ||
| @@ -8,12 +8,12 @@ | ||
| 8 | 8 | # to regenerate this file. |
| 9 | 9 | # |
| 10 | 10 | # This file is included by primary Makefile. |
| 11 | 11 | # |
| 12 | 12 | |
| 13 | -XBCC = $(BCC) $(BCCFLAGS) $(CFLAGS) | |
| 14 | -XTCC = $(TCC) -I. -I$(SRCDIR) -I$(OBJDIR) $(TCCFLAGS) $(CFLAGS) | |
| 13 | +XBCC = $(BCC) $(BCCFLAGS) | |
| 14 | +XTCC = $(TCC) -I. -I$(SRCDIR) -I$(OBJDIR) $(TCCFLAGS) | |
| 15 | 15 | |
| 16 | 16 | |
| 17 | 17 | SRC = \ |
| 18 | 18 | $(SRCDIR)/add.c \ |
| 19 | 19 | $(SRCDIR)/allrepo.c \ |
| @@ -496,11 +496,11 @@ | ||
| 496 | 496 | |
| 497 | 497 | all: $(OBJDIR) $(APPNAME) |
| 498 | 498 | |
| 499 | 499 | install: $(APPNAME) |
| 500 | 500 | mkdir -p $(INSTALLDIR) |
| 501 | - mv $(APPNAME) $(INSTALLDIR) | |
| 501 | + cp $(APPNAME) $(INSTALLDIR) | |
| 502 | 502 | |
| 503 | 503 | codecheck: $(TRANS_SRC) $(OBJDIR)/codecheck1 |
| 504 | 504 | $(OBJDIR)/codecheck1 $(TRANS_SRC) |
| 505 | 505 | |
| 506 | 506 | $(OBJDIR): |
| 507 | 507 |
| --- src/main.mk | |
| +++ src/main.mk | |
| @@ -8,12 +8,12 @@ | |
| 8 | # to regenerate this file. |
| 9 | # |
| 10 | # This file is included by primary Makefile. |
| 11 | # |
| 12 | |
| 13 | XBCC = $(BCC) $(BCCFLAGS) $(CFLAGS) |
| 14 | XTCC = $(TCC) -I. -I$(SRCDIR) -I$(OBJDIR) $(TCCFLAGS) $(CFLAGS) |
| 15 | |
| 16 | |
| 17 | SRC = \ |
| 18 | $(SRCDIR)/add.c \ |
| 19 | $(SRCDIR)/allrepo.c \ |
| @@ -496,11 +496,11 @@ | |
| 496 | |
| 497 | all: $(OBJDIR) $(APPNAME) |
| 498 | |
| 499 | install: $(APPNAME) |
| 500 | mkdir -p $(INSTALLDIR) |
| 501 | mv $(APPNAME) $(INSTALLDIR) |
| 502 | |
| 503 | codecheck: $(TRANS_SRC) $(OBJDIR)/codecheck1 |
| 504 | $(OBJDIR)/codecheck1 $(TRANS_SRC) |
| 505 | |
| 506 | $(OBJDIR): |
| 507 |
| --- src/main.mk | |
| +++ src/main.mk | |
| @@ -8,12 +8,12 @@ | |
| 8 | # to regenerate this file. |
| 9 | # |
| 10 | # This file is included by primary Makefile. |
| 11 | # |
| 12 | |
| 13 | XBCC = $(BCC) $(BCCFLAGS) |
| 14 | XTCC = $(TCC) -I. -I$(SRCDIR) -I$(OBJDIR) $(TCCFLAGS) |
| 15 | |
| 16 | |
| 17 | SRC = \ |
| 18 | $(SRCDIR)/add.c \ |
| 19 | $(SRCDIR)/allrepo.c \ |
| @@ -496,11 +496,11 @@ | |
| 496 | |
| 497 | all: $(OBJDIR) $(APPNAME) |
| 498 | |
| 499 | install: $(APPNAME) |
| 500 | mkdir -p $(INSTALLDIR) |
| 501 | cp $(APPNAME) $(INSTALLDIR) |
| 502 | |
| 503 | codecheck: $(TRANS_SRC) $(OBJDIR)/codecheck1 |
| 504 | $(OBJDIR)/codecheck1 $(TRANS_SRC) |
| 505 | |
| 506 | $(OBJDIR): |
| 507 |
+5
-5
| --- src/makemake.tcl | ||
| +++ src/makemake.tcl | ||
| @@ -281,12 +281,12 @@ | ||
| 281 | 281 | # to regenerate this file. |
| 282 | 282 | # |
| 283 | 283 | # This file is included by primary Makefile. |
| 284 | 284 | # |
| 285 | 285 | |
| 286 | -XBCC = $(BCC) $(BCCFLAGS) $(CFLAGS) | |
| 287 | -XTCC = $(TCC) -I. -I$(SRCDIR) -I$(OBJDIR) $(TCCFLAGS) $(CFLAGS) | |
| 286 | +XBCC = $(BCC) $(BCCFLAGS) | |
| 287 | +XTCC = $(TCC) -I. -I$(SRCDIR) -I$(OBJDIR) $(TCCFLAGS) | |
| 288 | 288 | |
| 289 | 289 | } |
| 290 | 290 | writeln -nonewline "SRC =" |
| 291 | 291 | foreach s [lsort $src] { |
| 292 | 292 | writeln -nonewline " \\\n \$(SRCDIR)/$s.c" |
| @@ -316,11 +316,11 @@ | ||
| 316 | 316 | <<<MINIZ_OPTIONS>>> [join $MINIZ_OPTIONS " \\\n "]] { |
| 317 | 317 | all: $(OBJDIR) $(APPNAME) |
| 318 | 318 | |
| 319 | 319 | install: $(APPNAME) |
| 320 | 320 | mkdir -p $(INSTALLDIR) |
| 321 | - mv $(APPNAME) $(INSTALLDIR) | |
| 321 | + cp $(APPNAME) $(INSTALLDIR) | |
| 322 | 322 | |
| 323 | 323 | codecheck: $(TRANS_SRC) $(OBJDIR)/codecheck1 |
| 324 | 324 | $(OBJDIR)/codecheck1 $(TRANS_SRC) |
| 325 | 325 | |
| 326 | 326 | $(OBJDIR): |
| @@ -1050,14 +1050,14 @@ | ||
| 1050 | 1050 | $(RCC) $(OBJDIR)/fossil.rc -o $(OBJDIR)/fossil.o |
| 1051 | 1051 | |
| 1052 | 1052 | install: $(OBJDIR) $(APPNAME) |
| 1053 | 1053 | ifdef USE_WINDOWS |
| 1054 | 1054 | $(MKDIR) $(subst /,\,$(INSTALLDIR)) |
| 1055 | - $(MV) $(subst /,\,$(APPNAME)) $(subst /,\,$(INSTALLDIR)) | |
| 1055 | + $(CP) $(subst /,\,$(APPNAME)) $(subst /,\,$(INSTALLDIR)) | |
| 1056 | 1056 | else |
| 1057 | 1057 | $(MKDIR) $(INSTALLDIR) |
| 1058 | - $(MV) $(APPNAME) $(INSTALLDIR) | |
| 1058 | + $(CP) $(APPNAME) $(INSTALLDIR) | |
| 1059 | 1059 | endif |
| 1060 | 1060 | |
| 1061 | 1061 | $(OBJDIR): |
| 1062 | 1062 | ifdef USE_WINDOWS |
| 1063 | 1063 | $(MKDIR) $(subst /,\,$(OBJDIR)) |
| 1064 | 1064 |
| --- src/makemake.tcl | |
| +++ src/makemake.tcl | |
| @@ -281,12 +281,12 @@ | |
| 281 | # to regenerate this file. |
| 282 | # |
| 283 | # This file is included by primary Makefile. |
| 284 | # |
| 285 | |
| 286 | XBCC = $(BCC) $(BCCFLAGS) $(CFLAGS) |
| 287 | XTCC = $(TCC) -I. -I$(SRCDIR) -I$(OBJDIR) $(TCCFLAGS) $(CFLAGS) |
| 288 | |
| 289 | } |
| 290 | writeln -nonewline "SRC =" |
| 291 | foreach s [lsort $src] { |
| 292 | writeln -nonewline " \\\n \$(SRCDIR)/$s.c" |
| @@ -316,11 +316,11 @@ | |
| 316 | <<<MINIZ_OPTIONS>>> [join $MINIZ_OPTIONS " \\\n "]] { |
| 317 | all: $(OBJDIR) $(APPNAME) |
| 318 | |
| 319 | install: $(APPNAME) |
| 320 | mkdir -p $(INSTALLDIR) |
| 321 | mv $(APPNAME) $(INSTALLDIR) |
| 322 | |
| 323 | codecheck: $(TRANS_SRC) $(OBJDIR)/codecheck1 |
| 324 | $(OBJDIR)/codecheck1 $(TRANS_SRC) |
| 325 | |
| 326 | $(OBJDIR): |
| @@ -1050,14 +1050,14 @@ | |
| 1050 | $(RCC) $(OBJDIR)/fossil.rc -o $(OBJDIR)/fossil.o |
| 1051 | |
| 1052 | install: $(OBJDIR) $(APPNAME) |
| 1053 | ifdef USE_WINDOWS |
| 1054 | $(MKDIR) $(subst /,\,$(INSTALLDIR)) |
| 1055 | $(MV) $(subst /,\,$(APPNAME)) $(subst /,\,$(INSTALLDIR)) |
| 1056 | else |
| 1057 | $(MKDIR) $(INSTALLDIR) |
| 1058 | $(MV) $(APPNAME) $(INSTALLDIR) |
| 1059 | endif |
| 1060 | |
| 1061 | $(OBJDIR): |
| 1062 | ifdef USE_WINDOWS |
| 1063 | $(MKDIR) $(subst /,\,$(OBJDIR)) |
| 1064 |
| --- src/makemake.tcl | |
| +++ src/makemake.tcl | |
| @@ -281,12 +281,12 @@ | |
| 281 | # to regenerate this file. |
| 282 | # |
| 283 | # This file is included by primary Makefile. |
| 284 | # |
| 285 | |
| 286 | XBCC = $(BCC) $(BCCFLAGS) |
| 287 | XTCC = $(TCC) -I. -I$(SRCDIR) -I$(OBJDIR) $(TCCFLAGS) |
| 288 | |
| 289 | } |
| 290 | writeln -nonewline "SRC =" |
| 291 | foreach s [lsort $src] { |
| 292 | writeln -nonewline " \\\n \$(SRCDIR)/$s.c" |
| @@ -316,11 +316,11 @@ | |
| 316 | <<<MINIZ_OPTIONS>>> [join $MINIZ_OPTIONS " \\\n "]] { |
| 317 | all: $(OBJDIR) $(APPNAME) |
| 318 | |
| 319 | install: $(APPNAME) |
| 320 | mkdir -p $(INSTALLDIR) |
| 321 | cp $(APPNAME) $(INSTALLDIR) |
| 322 | |
| 323 | codecheck: $(TRANS_SRC) $(OBJDIR)/codecheck1 |
| 324 | $(OBJDIR)/codecheck1 $(TRANS_SRC) |
| 325 | |
| 326 | $(OBJDIR): |
| @@ -1050,14 +1050,14 @@ | |
| 1050 | $(RCC) $(OBJDIR)/fossil.rc -o $(OBJDIR)/fossil.o |
| 1051 | |
| 1052 | install: $(OBJDIR) $(APPNAME) |
| 1053 | ifdef USE_WINDOWS |
| 1054 | $(MKDIR) $(subst /,\,$(INSTALLDIR)) |
| 1055 | $(CP) $(subst /,\,$(APPNAME)) $(subst /,\,$(INSTALLDIR)) |
| 1056 | else |
| 1057 | $(MKDIR) $(INSTALLDIR) |
| 1058 | $(CP) $(APPNAME) $(INSTALLDIR) |
| 1059 | endif |
| 1060 | |
| 1061 | $(OBJDIR): |
| 1062 | ifdef USE_WINDOWS |
| 1063 | $(MKDIR) $(subst /,\,$(OBJDIR)) |
| 1064 |
+8
| --- src/translate.c | ||
| +++ src/translate.c | ||
| @@ -213,19 +213,27 @@ | ||
| 213 | 213 | if( in==0 ){ |
| 214 | 214 | fprintf(stderr,"can not open %s\n", argv[1]); |
| 215 | 215 | exit(1); |
| 216 | 216 | } |
| 217 | 217 | zInFile = argv[1]; |
| 218 | +#ifndef FOSSIL_DEBUG | |
| 219 | + /* Set source line reference to the original source file. | |
| 220 | + * This makes compiler show the original file name in the compile error | |
| 221 | + * messages, instead of referring to the translated file. | |
| 222 | + * NOTE: This somewhat complicates stepping in debugger, as the resuling | |
| 223 | + * code would not match the referenced sources. | |
| 224 | + */ | |
| 218 | 225 | printf("#line 1 \""); |
| 219 | 226 | for(arg=argv[1]; *arg; arg++){ |
| 220 | 227 | if( *arg!='\\' ){ |
| 221 | 228 | printf("%c", *arg); |
| 222 | 229 | }else{ |
| 223 | 230 | printf("\\\\"); |
| 224 | 231 | } |
| 225 | 232 | } |
| 226 | 233 | printf("\"\n"); |
| 234 | +#endif | |
| 227 | 235 | trans(in, stdout); |
| 228 | 236 | fclose(in); |
| 229 | 237 | }else{ |
| 230 | 238 | trans(stdin, stdout); |
| 231 | 239 | } |
| 232 | 240 |
| --- src/translate.c | |
| +++ src/translate.c | |
| @@ -213,19 +213,27 @@ | |
| 213 | if( in==0 ){ |
| 214 | fprintf(stderr,"can not open %s\n", argv[1]); |
| 215 | exit(1); |
| 216 | } |
| 217 | zInFile = argv[1]; |
| 218 | printf("#line 1 \""); |
| 219 | for(arg=argv[1]; *arg; arg++){ |
| 220 | if( *arg!='\\' ){ |
| 221 | printf("%c", *arg); |
| 222 | }else{ |
| 223 | printf("\\\\"); |
| 224 | } |
| 225 | } |
| 226 | printf("\"\n"); |
| 227 | trans(in, stdout); |
| 228 | fclose(in); |
| 229 | }else{ |
| 230 | trans(stdin, stdout); |
| 231 | } |
| 232 |
| --- src/translate.c | |
| +++ src/translate.c | |
| @@ -213,19 +213,27 @@ | |
| 213 | if( in==0 ){ |
| 214 | fprintf(stderr,"can not open %s\n", argv[1]); |
| 215 | exit(1); |
| 216 | } |
| 217 | zInFile = argv[1]; |
| 218 | #ifndef FOSSIL_DEBUG |
| 219 | /* Set source line reference to the original source file. |
| 220 | * This makes compiler show the original file name in the compile error |
| 221 | * messages, instead of referring to the translated file. |
| 222 | * NOTE: This somewhat complicates stepping in debugger, as the resuling |
| 223 | * code would not match the referenced sources. |
| 224 | */ |
| 225 | printf("#line 1 \""); |
| 226 | for(arg=argv[1]; *arg; arg++){ |
| 227 | if( *arg!='\\' ){ |
| 228 | printf("%c", *arg); |
| 229 | }else{ |
| 230 | printf("\\\\"); |
| 231 | } |
| 232 | } |
| 233 | printf("\"\n"); |
| 234 | #endif |
| 235 | trans(in, stdout); |
| 236 | fclose(in); |
| 237 | }else{ |
| 238 | trans(stdin, stdout); |
| 239 | } |
| 240 |
+6
-4
| --- src/winhttp.c | ||
| +++ src/winhttp.c | ||
| @@ -387,24 +387,25 @@ | ||
| 387 | 387 | ** with the local Fossil server started via the "ui" command. |
| 388 | 388 | */ |
| 389 | 389 | zIp = SocketAddr_toString(&p->addr); |
| 390 | 390 | if( (p->flags & HTTP_SERVER_HAD_CHECKOUT)==0 ){ |
| 391 | 391 | assert( g.zRepositoryName && g.zRepositoryName[0] ); |
| 392 | - sqlite3_snprintf(sizeof(zCmd), zCmd, "%s%s\n%s\n%s\n%s", | |
| 392 | + sqlite3_snprintf(sizeof(zCmd), zCmd, "%s--in %s\n--out %s\n--ipaddr %s\n%s", | |
| 393 | 393 | get_utf8_bom(0), zRequestFName, zReplyFName, zIp, g.zRepositoryName |
| 394 | 394 | ); |
| 395 | 395 | }else{ |
| 396 | - sqlite3_snprintf(sizeof(zCmd), zCmd, "%s%s\n%s\n%s", | |
| 396 | + sqlite3_snprintf(sizeof(zCmd), zCmd, "%s--in %s\n--out %s\n--ipaddr %s", | |
| 397 | 397 | get_utf8_bom(0), zRequestFName, zReplyFName, zIp |
| 398 | 398 | ); |
| 399 | 399 | } |
| 400 | 400 | fossil_free(zIp); |
| 401 | 401 | aux = fossil_fopen(zCmdFName, "wb"); |
| 402 | 402 | if( aux==0 ) goto end_request; |
| 403 | 403 | fwrite(zCmd, 1, strlen(zCmd), aux); |
| 404 | 404 | |
| 405 | - sqlite3_snprintf(sizeof(zCmd), zCmd, "\"%s\" http -args \"%s\" --nossl%s", | |
| 405 | + sqlite3_snprintf(sizeof(zCmd), zCmd, | |
| 406 | + "\"%s\" http -args \"%s\" --nossl --nodelay%s", | |
| 406 | 407 | g.nameOfExe, zCmdFName, p->zOptions |
| 407 | 408 | ); |
| 408 | 409 | in = fossil_fopen(zReplyFName, "w+b"); |
| 409 | 410 | fflush(out); |
| 410 | 411 | fflush(aux); |
| @@ -470,11 +471,12 @@ | ||
| 470 | 471 | wanted += got; |
| 471 | 472 | } |
| 472 | 473 | assert( g.zRepositoryName && g.zRepositoryName[0] ); |
| 473 | 474 | zIp = SocketAddr_toString(&p->addr); |
| 474 | 475 | sqlite3_snprintf(sizeof(zCmd), zCmd, |
| 475 | - "\"%s\" http \"%s\" \"%s\" %s \"%s\" --scgi --nossl%s", | |
| 476 | + "\"%s\" http --in \"%s\" --out \"%s\" --ipaddr %s \"%s\"" | |
| 477 | + " --scgi --nossl --nodelay%s", | |
| 476 | 478 | g.nameOfExe, zRequestFName, zReplyFName, zIp, |
| 477 | 479 | g.zRepositoryName, p->zOptions |
| 478 | 480 | ); |
| 479 | 481 | fossil_free(zIp); |
| 480 | 482 | in = fossil_fopen(zReplyFName, "w+b"); |
| 481 | 483 |
| --- src/winhttp.c | |
| +++ src/winhttp.c | |
| @@ -387,24 +387,25 @@ | |
| 387 | ** with the local Fossil server started via the "ui" command. |
| 388 | */ |
| 389 | zIp = SocketAddr_toString(&p->addr); |
| 390 | if( (p->flags & HTTP_SERVER_HAD_CHECKOUT)==0 ){ |
| 391 | assert( g.zRepositoryName && g.zRepositoryName[0] ); |
| 392 | sqlite3_snprintf(sizeof(zCmd), zCmd, "%s%s\n%s\n%s\n%s", |
| 393 | get_utf8_bom(0), zRequestFName, zReplyFName, zIp, g.zRepositoryName |
| 394 | ); |
| 395 | }else{ |
| 396 | sqlite3_snprintf(sizeof(zCmd), zCmd, "%s%s\n%s\n%s", |
| 397 | get_utf8_bom(0), zRequestFName, zReplyFName, zIp |
| 398 | ); |
| 399 | } |
| 400 | fossil_free(zIp); |
| 401 | aux = fossil_fopen(zCmdFName, "wb"); |
| 402 | if( aux==0 ) goto end_request; |
| 403 | fwrite(zCmd, 1, strlen(zCmd), aux); |
| 404 | |
| 405 | sqlite3_snprintf(sizeof(zCmd), zCmd, "\"%s\" http -args \"%s\" --nossl%s", |
| 406 | g.nameOfExe, zCmdFName, p->zOptions |
| 407 | ); |
| 408 | in = fossil_fopen(zReplyFName, "w+b"); |
| 409 | fflush(out); |
| 410 | fflush(aux); |
| @@ -470,11 +471,12 @@ | |
| 470 | wanted += got; |
| 471 | } |
| 472 | assert( g.zRepositoryName && g.zRepositoryName[0] ); |
| 473 | zIp = SocketAddr_toString(&p->addr); |
| 474 | sqlite3_snprintf(sizeof(zCmd), zCmd, |
| 475 | "\"%s\" http \"%s\" \"%s\" %s \"%s\" --scgi --nossl%s", |
| 476 | g.nameOfExe, zRequestFName, zReplyFName, zIp, |
| 477 | g.zRepositoryName, p->zOptions |
| 478 | ); |
| 479 | fossil_free(zIp); |
| 480 | in = fossil_fopen(zReplyFName, "w+b"); |
| 481 |
| --- src/winhttp.c | |
| +++ src/winhttp.c | |
| @@ -387,24 +387,25 @@ | |
| 387 | ** with the local Fossil server started via the "ui" command. |
| 388 | */ |
| 389 | zIp = SocketAddr_toString(&p->addr); |
| 390 | if( (p->flags & HTTP_SERVER_HAD_CHECKOUT)==0 ){ |
| 391 | assert( g.zRepositoryName && g.zRepositoryName[0] ); |
| 392 | sqlite3_snprintf(sizeof(zCmd), zCmd, "%s--in %s\n--out %s\n--ipaddr %s\n%s", |
| 393 | get_utf8_bom(0), zRequestFName, zReplyFName, zIp, g.zRepositoryName |
| 394 | ); |
| 395 | }else{ |
| 396 | sqlite3_snprintf(sizeof(zCmd), zCmd, "%s--in %s\n--out %s\n--ipaddr %s", |
| 397 | get_utf8_bom(0), zRequestFName, zReplyFName, zIp |
| 398 | ); |
| 399 | } |
| 400 | fossil_free(zIp); |
| 401 | aux = fossil_fopen(zCmdFName, "wb"); |
| 402 | if( aux==0 ) goto end_request; |
| 403 | fwrite(zCmd, 1, strlen(zCmd), aux); |
| 404 | |
| 405 | sqlite3_snprintf(sizeof(zCmd), zCmd, |
| 406 | "\"%s\" http -args \"%s\" --nossl --nodelay%s", |
| 407 | g.nameOfExe, zCmdFName, p->zOptions |
| 408 | ); |
| 409 | in = fossil_fopen(zReplyFName, "w+b"); |
| 410 | fflush(out); |
| 411 | fflush(aux); |
| @@ -470,11 +471,12 @@ | |
| 471 | wanted += got; |
| 472 | } |
| 473 | assert( g.zRepositoryName && g.zRepositoryName[0] ); |
| 474 | zIp = SocketAddr_toString(&p->addr); |
| 475 | sqlite3_snprintf(sizeof(zCmd), zCmd, |
| 476 | "\"%s\" http --in \"%s\" --out \"%s\" --ipaddr %s \"%s\"" |
| 477 | " --scgi --nossl --nodelay%s", |
| 478 | g.nameOfExe, zRequestFName, zReplyFName, zIp, |
| 479 | g.zRepositoryName, p->zOptions |
| 480 | ); |
| 481 | fossil_free(zIp); |
| 482 | in = fossil_fopen(zReplyFName, "w+b"); |
| 483 |
+2
-2
| --- win/Makefile.mingw | ||
| +++ win/Makefile.mingw | ||
| @@ -972,14 +972,14 @@ | ||
| 972 | 972 | $(RCC) $(OBJDIR)/fossil.rc -o $(OBJDIR)/fossil.o |
| 973 | 973 | |
| 974 | 974 | install: $(OBJDIR) $(APPNAME) |
| 975 | 975 | ifdef USE_WINDOWS |
| 976 | 976 | $(MKDIR) $(subst /,\,$(INSTALLDIR)) |
| 977 | - $(MV) $(subst /,\,$(APPNAME)) $(subst /,\,$(INSTALLDIR)) | |
| 977 | + $(CP) $(subst /,\,$(APPNAME)) $(subst /,\,$(INSTALLDIR)) | |
| 978 | 978 | else |
| 979 | 979 | $(MKDIR) $(INSTALLDIR) |
| 980 | - $(MV) $(APPNAME) $(INSTALLDIR) | |
| 980 | + $(CP) $(APPNAME) $(INSTALLDIR) | |
| 981 | 981 | endif |
| 982 | 982 | |
| 983 | 983 | $(OBJDIR): |
| 984 | 984 | ifdef USE_WINDOWS |
| 985 | 985 | $(MKDIR) $(subst /,\,$(OBJDIR)) |
| 986 | 986 |
| --- win/Makefile.mingw | |
| +++ win/Makefile.mingw | |
| @@ -972,14 +972,14 @@ | |
| 972 | $(RCC) $(OBJDIR)/fossil.rc -o $(OBJDIR)/fossil.o |
| 973 | |
| 974 | install: $(OBJDIR) $(APPNAME) |
| 975 | ifdef USE_WINDOWS |
| 976 | $(MKDIR) $(subst /,\,$(INSTALLDIR)) |
| 977 | $(MV) $(subst /,\,$(APPNAME)) $(subst /,\,$(INSTALLDIR)) |
| 978 | else |
| 979 | $(MKDIR) $(INSTALLDIR) |
| 980 | $(MV) $(APPNAME) $(INSTALLDIR) |
| 981 | endif |
| 982 | |
| 983 | $(OBJDIR): |
| 984 | ifdef USE_WINDOWS |
| 985 | $(MKDIR) $(subst /,\,$(OBJDIR)) |
| 986 |
| --- win/Makefile.mingw | |
| +++ win/Makefile.mingw | |
| @@ -972,14 +972,14 @@ | |
| 972 | $(RCC) $(OBJDIR)/fossil.rc -o $(OBJDIR)/fossil.o |
| 973 | |
| 974 | install: $(OBJDIR) $(APPNAME) |
| 975 | ifdef USE_WINDOWS |
| 976 | $(MKDIR) $(subst /,\,$(INSTALLDIR)) |
| 977 | $(CP) $(subst /,\,$(APPNAME)) $(subst /,\,$(INSTALLDIR)) |
| 978 | else |
| 979 | $(MKDIR) $(INSTALLDIR) |
| 980 | $(CP) $(APPNAME) $(INSTALLDIR) |
| 981 | endif |
| 982 | |
| 983 | $(OBJDIR): |
| 984 | ifdef USE_WINDOWS |
| 985 | $(MKDIR) $(subst /,\,$(OBJDIR)) |
| 986 |
+2
-2
| --- win/Makefile.mingw.mistachkin | ||
| +++ win/Makefile.mingw.mistachkin | ||
| @@ -953,14 +953,14 @@ | ||
| 953 | 953 | $(RCC) $(OBJDIR)/fossil.rc -o $(OBJDIR)/fossil.o |
| 954 | 954 | |
| 955 | 955 | install: $(OBJDIR) $(APPNAME) |
| 956 | 956 | ifdef USE_WINDOWS |
| 957 | 957 | $(MKDIR) $(subst /,\,$(INSTALLDIR)) |
| 958 | - $(MV) $(subst /,\,$(APPNAME)) $(subst /,\,$(INSTALLDIR)) | |
| 958 | + $(CP) $(subst /,\,$(APPNAME)) $(subst /,\,$(INSTALLDIR)) | |
| 959 | 959 | else |
| 960 | 960 | $(MKDIR) $(INSTALLDIR) |
| 961 | - $(MV) $(APPNAME) $(INSTALLDIR) | |
| 961 | + $(CP) $(APPNAME) $(INSTALLDIR) | |
| 962 | 962 | endif |
| 963 | 963 | |
| 964 | 964 | $(OBJDIR): |
| 965 | 965 | ifdef USE_WINDOWS |
| 966 | 966 | $(MKDIR) $(subst /,\,$(OBJDIR)) |
| 967 | 967 |
| --- win/Makefile.mingw.mistachkin | |
| +++ win/Makefile.mingw.mistachkin | |
| @@ -953,14 +953,14 @@ | |
| 953 | $(RCC) $(OBJDIR)/fossil.rc -o $(OBJDIR)/fossil.o |
| 954 | |
| 955 | install: $(OBJDIR) $(APPNAME) |
| 956 | ifdef USE_WINDOWS |
| 957 | $(MKDIR) $(subst /,\,$(INSTALLDIR)) |
| 958 | $(MV) $(subst /,\,$(APPNAME)) $(subst /,\,$(INSTALLDIR)) |
| 959 | else |
| 960 | $(MKDIR) $(INSTALLDIR) |
| 961 | $(MV) $(APPNAME) $(INSTALLDIR) |
| 962 | endif |
| 963 | |
| 964 | $(OBJDIR): |
| 965 | ifdef USE_WINDOWS |
| 966 | $(MKDIR) $(subst /,\,$(OBJDIR)) |
| 967 |
| --- win/Makefile.mingw.mistachkin | |
| +++ win/Makefile.mingw.mistachkin | |
| @@ -953,14 +953,14 @@ | |
| 953 | $(RCC) $(OBJDIR)/fossil.rc -o $(OBJDIR)/fossil.o |
| 954 | |
| 955 | install: $(OBJDIR) $(APPNAME) |
| 956 | ifdef USE_WINDOWS |
| 957 | $(MKDIR) $(subst /,\,$(INSTALLDIR)) |
| 958 | $(CP) $(subst /,\,$(APPNAME)) $(subst /,\,$(INSTALLDIR)) |
| 959 | else |
| 960 | $(MKDIR) $(INSTALLDIR) |
| 961 | $(CP) $(APPNAME) $(INSTALLDIR) |
| 962 | endif |
| 963 | |
| 964 | $(OBJDIR): |
| 965 | ifdef USE_WINDOWS |
| 966 | $(MKDIR) $(subst /,\,$(OBJDIR)) |
| 967 |