Fossil SCM
Merge trunk.. including use of the urlData object the global "g" variable which fix byte alignment problem..
Commit
7cb29889cae39d970ce740115fb71bd2454762d6
Parent
dc10f8d74cbdb15…
30 files changed
+2
-2
+12
-7
+4
-4
+6
-6
+6
-6
+1
-1
+1
-1
+1
-1
+6
-10
+6
-10
+31
-31
+7
-6
+8
-6
+4
-4
+28
-28
+14
-14
+4
-6
+4
-6
+2
-2
+3
-2
+3
+1
+4
-3
+2
-2
+10
-10
+6
-19
+61
-61
+1
-1
+6
-6
+3
-3
~
src/add.c
~
src/allrepo.c
~
src/attach.c
~
src/checkin.c
~
src/clone.c
~
src/configure.c
~
src/delta.c
~
src/diff.c
~
src/finfo.c
~
src/finfo.c
~
src/http.c
~
src/http_socket.c
~
src/http_ssl.c
~
src/http_transport.c
~
src/info.c
~
src/json.c
~
src/main.c
~
src/main.c
~
src/manifest.c
~
src/name.c
~
src/report.c
~
src/setup.c
~
src/sqlite3.c
~
src/sqlite3.h
~
src/sync.c
~
src/timeline.c
~
src/url.c
~
src/user.c
~
src/xfer.c
~
src/xfersetup.c
+2
-2
| --- src/add.c | ||
| +++ src/add.c | ||
| @@ -25,11 +25,11 @@ | ||
| 25 | 25 | #include "cygsup.h" |
| 26 | 26 | |
| 27 | 27 | /* |
| 28 | 28 | ** This routine returns the names of files in a working checkout that |
| 29 | 29 | ** are created by Fossil itself, and hence should not be added, deleted, |
| 30 | -** or merge, and should be omitted from "clean" and "extra" lists. | |
| 30 | +** or merge, and should be omitted from "clean" and "extras" lists. | |
| 31 | 31 | ** |
| 32 | 32 | ** Return the N-th name. The first name has N==0. When all names have |
| 33 | 33 | ** been used, return 0. |
| 34 | 34 | */ |
| 35 | 35 | const char *fossil_reserved_name(int N, int omitRepo){ |
| @@ -461,11 +461,11 @@ | ||
| 461 | 461 | ** |
| 462 | 462 | ** Do all necessary "add" and "rm" commands to synchronize the repository |
| 463 | 463 | ** with the content of the working checkout: |
| 464 | 464 | ** |
| 465 | 465 | ** * All files in the checkout but not in the repository (that is, |
| 466 | -** all files displayed using the "extra" command) are added as | |
| 466 | +** all files displayed using the "extras" command) are added as | |
| 467 | 467 | ** if by the "add" command. |
| 468 | 468 | ** |
| 469 | 469 | ** * All files in the repository but missing from the checkout (that is, |
| 470 | 470 | ** all files that show as MISSING with the "status" command) are |
| 471 | 471 | ** removed as if by the "rm" command. |
| 472 | 472 |
| --- src/add.c | |
| +++ src/add.c | |
| @@ -25,11 +25,11 @@ | |
| 25 | #include "cygsup.h" |
| 26 | |
| 27 | /* |
| 28 | ** This routine returns the names of files in a working checkout that |
| 29 | ** are created by Fossil itself, and hence should not be added, deleted, |
| 30 | ** or merge, and should be omitted from "clean" and "extra" lists. |
| 31 | ** |
| 32 | ** Return the N-th name. The first name has N==0. When all names have |
| 33 | ** been used, return 0. |
| 34 | */ |
| 35 | const char *fossil_reserved_name(int N, int omitRepo){ |
| @@ -461,11 +461,11 @@ | |
| 461 | ** |
| 462 | ** Do all necessary "add" and "rm" commands to synchronize the repository |
| 463 | ** with the content of the working checkout: |
| 464 | ** |
| 465 | ** * All files in the checkout but not in the repository (that is, |
| 466 | ** all files displayed using the "extra" command) are added as |
| 467 | ** if by the "add" command. |
| 468 | ** |
| 469 | ** * All files in the repository but missing from the checkout (that is, |
| 470 | ** all files that show as MISSING with the "status" command) are |
| 471 | ** removed as if by the "rm" command. |
| 472 |
| --- src/add.c | |
| +++ src/add.c | |
| @@ -25,11 +25,11 @@ | |
| 25 | #include "cygsup.h" |
| 26 | |
| 27 | /* |
| 28 | ** This routine returns the names of files in a working checkout that |
| 29 | ** are created by Fossil itself, and hence should not be added, deleted, |
| 30 | ** or merge, and should be omitted from "clean" and "extras" lists. |
| 31 | ** |
| 32 | ** Return the N-th name. The first name has N==0. When all names have |
| 33 | ** been used, return 0. |
| 34 | */ |
| 35 | const char *fossil_reserved_name(int N, int omitRepo){ |
| @@ -461,11 +461,11 @@ | |
| 461 | ** |
| 462 | ** Do all necessary "add" and "rm" commands to synchronize the repository |
| 463 | ** with the content of the working checkout: |
| 464 | ** |
| 465 | ** * All files in the checkout but not in the repository (that is, |
| 466 | ** all files displayed using the "extras" command) are added as |
| 467 | ** if by the "add" command. |
| 468 | ** |
| 469 | ** * All files in the repository but missing from the checkout (that is, |
| 470 | ** all files that show as MISSING with the "status" command) are |
| 471 | ** removed as if by the "rm" command. |
| 472 |
+12
-7
| --- src/allrepo.c | ||
| +++ src/allrepo.c | ||
| @@ -76,11 +76,11 @@ | ||
| 76 | 76 | |
| 77 | 77 | |
| 78 | 78 | /* |
| 79 | 79 | ** COMMAND: all |
| 80 | 80 | ** |
| 81 | -** Usage: %fossil all (changes|clean|extra|ignore|list|ls|pull|push|rebuild|sync) | |
| 81 | +** Usage: %fossil all (changes|clean|extras|ignore|list|ls|pull|push|rebuild|sync) | |
| 82 | 82 | ** |
| 83 | 83 | ** The ~/.fossil file records the location of all repositories for a |
| 84 | 84 | ** user. This command performs certain operations on all repositories |
| 85 | 85 | ** that can be useful before or after a period of disconnected operation. |
| 86 | 86 | ** |
| @@ -99,16 +99,16 @@ | ||
| 99 | 99 | ** and the --whatif option to carefully review the files to |
| 100 | 100 | ** be deleted beforehand is highly recommended. The command |
| 101 | 101 | ** line options supported by the clean command itself, if any |
| 102 | 102 | ** are present, are passed along verbatim. |
| 103 | 103 | ** |
| 104 | -** extra Shows extra files from all local checkouts. The command | |
| 104 | +** extras Shows "extra" files from all local checkouts. The command | |
| 105 | 105 | ** line options supported by the extra command itself, if any |
| 106 | 106 | ** are present, are passed along verbatim. |
| 107 | 107 | ** |
| 108 | 108 | ** ignore Arguments are repositories that should be ignored by |
| 109 | -** subsequent clean, extra, list, pull, push, rebuild, and | |
| 109 | +** subsequent clean, extras, list, pull, push, rebuild, and | |
| 110 | 110 | ** sync operations. The -c|--ckout option causes the listed |
| 111 | 111 | ** local checkouts to be ignored instead. |
| 112 | 112 | ** |
| 113 | 113 | ** list | ls Display the location of all repositories. The -c|--ckout |
| 114 | 114 | ** option causes all local checkouts to be listed instead. |
| @@ -136,10 +136,11 @@ | ||
| 136 | 136 | ** when one of the following commands are run against the repository: |
| 137 | 137 | ** clone, info, pull, push, or sync. Even previously ignored repositories |
| 138 | 138 | ** are added back to the list of repositories by these commands. |
| 139 | 139 | ** |
| 140 | 140 | ** Options: |
| 141 | +** --showfile Show the repository or checkout being operated upon. | |
| 141 | 142 | ** --dontstop Continue with other repositories even after an error. |
| 142 | 143 | ** --dry-run If given, display instead of run actions. |
| 143 | 144 | */ |
| 144 | 145 | void all_cmd(void){ |
| 145 | 146 | int n; |
| @@ -150,10 +151,11 @@ | ||
| 150 | 151 | char *zQFilename; |
| 151 | 152 | Blob extra; |
| 152 | 153 | int useCheckouts = 0; |
| 153 | 154 | int quiet = 0; |
| 154 | 155 | int dryRunFlag = 0; |
| 156 | + int showFile = find_option("showfile",0,0)!=0; | |
| 155 | 157 | int stopOnError = find_option("dontstop",0,0)==0; |
| 156 | 158 | int rc; |
| 157 | 159 | int nToDel = 0; |
| 158 | 160 | |
| 159 | 161 | dryRunFlag = find_option("dry-run","n",0)!=0; |
| @@ -160,11 +162,11 @@ | ||
| 160 | 162 | if( !dryRunFlag ){ |
| 161 | 163 | dryRunFlag = find_option("test",0,0)!=0; /* deprecated */ |
| 162 | 164 | } |
| 163 | 165 | |
| 164 | 166 | if( g.argc<3 ){ |
| 165 | - usage("changes|clean|extra|ignore|list|ls|pull|push|rebuild|sync"); | |
| 167 | + usage("changes|clean|extras|ignore|list|ls|pull|push|rebuild|sync"); | |
| 166 | 168 | } |
| 167 | 169 | n = strlen(g.argv[2]); |
| 168 | 170 | db_open_config(1); |
| 169 | 171 | blob_zero(&extra); |
| 170 | 172 | zCmd = g.argv[2]; |
| @@ -185,12 +187,12 @@ | ||
| 185 | 187 | collect_argument_value(&extra, "keep"); |
| 186 | 188 | collect_argument(&extra, "temp",0); |
| 187 | 189 | collect_argument(&extra, "verbose","v"); |
| 188 | 190 | collect_argument(&extra, "whatif",0); |
| 189 | 191 | useCheckouts = 1; |
| 190 | - }else if( strncmp(zCmd, "extra", n)==0 ){ | |
| 191 | - zCmd = "extra --chdir"; | |
| 192 | + }else if( strncmp(zCmd, "extras", n)==0 ){ | |
| 193 | + zCmd = "extras --chdir"; | |
| 192 | 194 | collect_argument(&extra, "abs-paths",0); |
| 193 | 195 | collect_argument_value(&extra, "case-sensitive"); |
| 194 | 196 | collect_argument(&extra, "dotfiles",0); |
| 195 | 197 | collect_argument_value(&extra, "ignore"); |
| 196 | 198 | collect_argument(&extra, "rel-paths",0); |
| @@ -254,11 +256,11 @@ | ||
| 254 | 256 | } |
| 255 | 257 | db_end_transaction(0); |
| 256 | 258 | return; |
| 257 | 259 | }else{ |
| 258 | 260 | fossil_fatal("\"all\" subcommand should be one of: " |
| 259 | - "changes clean extra ignore list ls push pull rebuild sync"); | |
| 261 | + "changes clean extras ignore list ls push pull rebuild sync"); | |
| 260 | 262 | } |
| 261 | 263 | verify_all_options(); |
| 262 | 264 | zFossil = quoteFilename(g.nameOfExe); |
| 263 | 265 | if( useCheckouts ){ |
| 264 | 266 | db_prepare(&q, |
| @@ -287,10 +289,13 @@ | ||
| 287 | 289 | continue; |
| 288 | 290 | } |
| 289 | 291 | if( zCmd[0]=='l' ){ |
| 290 | 292 | fossil_print("%s\n", zFilename); |
| 291 | 293 | continue; |
| 294 | + }else if( showFile ){ | |
| 295 | + fossil_print("%s: %s\n", useCheckouts ? "checkout" : "repository", | |
| 296 | + zFilename); | |
| 292 | 297 | } |
| 293 | 298 | zQFilename = quoteFilename(zFilename); |
| 294 | 299 | zSyscmd = mprintf("%s %s %s%s", |
| 295 | 300 | zFossil, zCmd, zQFilename, blob_str(&extra)); |
| 296 | 301 | if( !quiet || dryRunFlag ){ |
| 297 | 302 |
| --- src/allrepo.c | |
| +++ src/allrepo.c | |
| @@ -76,11 +76,11 @@ | |
| 76 | |
| 77 | |
| 78 | /* |
| 79 | ** COMMAND: all |
| 80 | ** |
| 81 | ** Usage: %fossil all (changes|clean|extra|ignore|list|ls|pull|push|rebuild|sync) |
| 82 | ** |
| 83 | ** The ~/.fossil file records the location of all repositories for a |
| 84 | ** user. This command performs certain operations on all repositories |
| 85 | ** that can be useful before or after a period of disconnected operation. |
| 86 | ** |
| @@ -99,16 +99,16 @@ | |
| 99 | ** and the --whatif option to carefully review the files to |
| 100 | ** be deleted beforehand is highly recommended. The command |
| 101 | ** line options supported by the clean command itself, if any |
| 102 | ** are present, are passed along verbatim. |
| 103 | ** |
| 104 | ** extra Shows extra files from all local checkouts. The command |
| 105 | ** line options supported by the extra command itself, if any |
| 106 | ** are present, are passed along verbatim. |
| 107 | ** |
| 108 | ** ignore Arguments are repositories that should be ignored by |
| 109 | ** subsequent clean, extra, list, pull, push, rebuild, and |
| 110 | ** sync operations. The -c|--ckout option causes the listed |
| 111 | ** local checkouts to be ignored instead. |
| 112 | ** |
| 113 | ** list | ls Display the location of all repositories. The -c|--ckout |
| 114 | ** option causes all local checkouts to be listed instead. |
| @@ -136,10 +136,11 @@ | |
| 136 | ** when one of the following commands are run against the repository: |
| 137 | ** clone, info, pull, push, or sync. Even previously ignored repositories |
| 138 | ** are added back to the list of repositories by these commands. |
| 139 | ** |
| 140 | ** Options: |
| 141 | ** --dontstop Continue with other repositories even after an error. |
| 142 | ** --dry-run If given, display instead of run actions. |
| 143 | */ |
| 144 | void all_cmd(void){ |
| 145 | int n; |
| @@ -150,10 +151,11 @@ | |
| 150 | char *zQFilename; |
| 151 | Blob extra; |
| 152 | int useCheckouts = 0; |
| 153 | int quiet = 0; |
| 154 | int dryRunFlag = 0; |
| 155 | int stopOnError = find_option("dontstop",0,0)==0; |
| 156 | int rc; |
| 157 | int nToDel = 0; |
| 158 | |
| 159 | dryRunFlag = find_option("dry-run","n",0)!=0; |
| @@ -160,11 +162,11 @@ | |
| 160 | if( !dryRunFlag ){ |
| 161 | dryRunFlag = find_option("test",0,0)!=0; /* deprecated */ |
| 162 | } |
| 163 | |
| 164 | if( g.argc<3 ){ |
| 165 | usage("changes|clean|extra|ignore|list|ls|pull|push|rebuild|sync"); |
| 166 | } |
| 167 | n = strlen(g.argv[2]); |
| 168 | db_open_config(1); |
| 169 | blob_zero(&extra); |
| 170 | zCmd = g.argv[2]; |
| @@ -185,12 +187,12 @@ | |
| 185 | collect_argument_value(&extra, "keep"); |
| 186 | collect_argument(&extra, "temp",0); |
| 187 | collect_argument(&extra, "verbose","v"); |
| 188 | collect_argument(&extra, "whatif",0); |
| 189 | useCheckouts = 1; |
| 190 | }else if( strncmp(zCmd, "extra", n)==0 ){ |
| 191 | zCmd = "extra --chdir"; |
| 192 | collect_argument(&extra, "abs-paths",0); |
| 193 | collect_argument_value(&extra, "case-sensitive"); |
| 194 | collect_argument(&extra, "dotfiles",0); |
| 195 | collect_argument_value(&extra, "ignore"); |
| 196 | collect_argument(&extra, "rel-paths",0); |
| @@ -254,11 +256,11 @@ | |
| 254 | } |
| 255 | db_end_transaction(0); |
| 256 | return; |
| 257 | }else{ |
| 258 | fossil_fatal("\"all\" subcommand should be one of: " |
| 259 | "changes clean extra ignore list ls push pull rebuild sync"); |
| 260 | } |
| 261 | verify_all_options(); |
| 262 | zFossil = quoteFilename(g.nameOfExe); |
| 263 | if( useCheckouts ){ |
| 264 | db_prepare(&q, |
| @@ -287,10 +289,13 @@ | |
| 287 | continue; |
| 288 | } |
| 289 | if( zCmd[0]=='l' ){ |
| 290 | fossil_print("%s\n", zFilename); |
| 291 | continue; |
| 292 | } |
| 293 | zQFilename = quoteFilename(zFilename); |
| 294 | zSyscmd = mprintf("%s %s %s%s", |
| 295 | zFossil, zCmd, zQFilename, blob_str(&extra)); |
| 296 | if( !quiet || dryRunFlag ){ |
| 297 |
| --- src/allrepo.c | |
| +++ src/allrepo.c | |
| @@ -76,11 +76,11 @@ | |
| 76 | |
| 77 | |
| 78 | /* |
| 79 | ** COMMAND: all |
| 80 | ** |
| 81 | ** Usage: %fossil all (changes|clean|extras|ignore|list|ls|pull|push|rebuild|sync) |
| 82 | ** |
| 83 | ** The ~/.fossil file records the location of all repositories for a |
| 84 | ** user. This command performs certain operations on all repositories |
| 85 | ** that can be useful before or after a period of disconnected operation. |
| 86 | ** |
| @@ -99,16 +99,16 @@ | |
| 99 | ** and the --whatif option to carefully review the files to |
| 100 | ** be deleted beforehand is highly recommended. The command |
| 101 | ** line options supported by the clean command itself, if any |
| 102 | ** are present, are passed along verbatim. |
| 103 | ** |
| 104 | ** extras Shows "extra" files from all local checkouts. The command |
| 105 | ** line options supported by the extra command itself, if any |
| 106 | ** are present, are passed along verbatim. |
| 107 | ** |
| 108 | ** ignore Arguments are repositories that should be ignored by |
| 109 | ** subsequent clean, extras, list, pull, push, rebuild, and |
| 110 | ** sync operations. The -c|--ckout option causes the listed |
| 111 | ** local checkouts to be ignored instead. |
| 112 | ** |
| 113 | ** list | ls Display the location of all repositories. The -c|--ckout |
| 114 | ** option causes all local checkouts to be listed instead. |
| @@ -136,10 +136,11 @@ | |
| 136 | ** when one of the following commands are run against the repository: |
| 137 | ** clone, info, pull, push, or sync. Even previously ignored repositories |
| 138 | ** are added back to the list of repositories by these commands. |
| 139 | ** |
| 140 | ** Options: |
| 141 | ** --showfile Show the repository or checkout being operated upon. |
| 142 | ** --dontstop Continue with other repositories even after an error. |
| 143 | ** --dry-run If given, display instead of run actions. |
| 144 | */ |
| 145 | void all_cmd(void){ |
| 146 | int n; |
| @@ -150,10 +151,11 @@ | |
| 151 | char *zQFilename; |
| 152 | Blob extra; |
| 153 | int useCheckouts = 0; |
| 154 | int quiet = 0; |
| 155 | int dryRunFlag = 0; |
| 156 | int showFile = find_option("showfile",0,0)!=0; |
| 157 | int stopOnError = find_option("dontstop",0,0)==0; |
| 158 | int rc; |
| 159 | int nToDel = 0; |
| 160 | |
| 161 | dryRunFlag = find_option("dry-run","n",0)!=0; |
| @@ -160,11 +162,11 @@ | |
| 162 | if( !dryRunFlag ){ |
| 163 | dryRunFlag = find_option("test",0,0)!=0; /* deprecated */ |
| 164 | } |
| 165 | |
| 166 | if( g.argc<3 ){ |
| 167 | usage("changes|clean|extras|ignore|list|ls|pull|push|rebuild|sync"); |
| 168 | } |
| 169 | n = strlen(g.argv[2]); |
| 170 | db_open_config(1); |
| 171 | blob_zero(&extra); |
| 172 | zCmd = g.argv[2]; |
| @@ -185,12 +187,12 @@ | |
| 187 | collect_argument_value(&extra, "keep"); |
| 188 | collect_argument(&extra, "temp",0); |
| 189 | collect_argument(&extra, "verbose","v"); |
| 190 | collect_argument(&extra, "whatif",0); |
| 191 | useCheckouts = 1; |
| 192 | }else if( strncmp(zCmd, "extras", n)==0 ){ |
| 193 | zCmd = "extras --chdir"; |
| 194 | collect_argument(&extra, "abs-paths",0); |
| 195 | collect_argument_value(&extra, "case-sensitive"); |
| 196 | collect_argument(&extra, "dotfiles",0); |
| 197 | collect_argument_value(&extra, "ignore"); |
| 198 | collect_argument(&extra, "rel-paths",0); |
| @@ -254,11 +256,11 @@ | |
| 256 | } |
| 257 | db_end_transaction(0); |
| 258 | return; |
| 259 | }else{ |
| 260 | fossil_fatal("\"all\" subcommand should be one of: " |
| 261 | "changes clean extras ignore list ls push pull rebuild sync"); |
| 262 | } |
| 263 | verify_all_options(); |
| 264 | zFossil = quoteFilename(g.nameOfExe); |
| 265 | if( useCheckouts ){ |
| 266 | db_prepare(&q, |
| @@ -287,10 +289,13 @@ | |
| 289 | continue; |
| 290 | } |
| 291 | if( zCmd[0]=='l' ){ |
| 292 | fossil_print("%s\n", zFilename); |
| 293 | continue; |
| 294 | }else if( showFile ){ |
| 295 | fossil_print("%s: %s\n", useCheckouts ? "checkout" : "repository", |
| 296 | zFilename); |
| 297 | } |
| 298 | zQFilename = quoteFilename(zFilename); |
| 299 | zSyscmd = mprintf("%s %s %s%s", |
| 300 | zFossil, zCmd, zQFilename, blob_str(&extra)); |
| 301 | if( !quiet || dryRunFlag ){ |
| 302 |
+4
-4
| --- src/attach.c | ||
| +++ src/attach.c | ||
| @@ -258,11 +258,11 @@ | ||
| 258 | 258 | zTkt = db_text(0, "SELECT substr(tagname,5) FROM tag" |
| 259 | 259 | " WHERE tagname GLOB 'tkt-%q*'", zTkt); |
| 260 | 260 | if( zTkt==0 ) fossil_redirect_home(); |
| 261 | 261 | } |
| 262 | 262 | zTarget = zTkt; |
| 263 | - zTargetType = mprintf("Ticket <a href=\"%s/tktview/%S\">%S</a>", | |
| 263 | + zTargetType = mprintf("Ticket <a href=\"%s/tktview/%s\">%S</a>", | |
| 264 | 264 | g.zTop, zTkt, zTkt); |
| 265 | 265 | } |
| 266 | 266 | if( zFrom==0 ) zFrom = mprintf("%s/home", g.zTop); |
| 267 | 267 | if( P("cancel") ){ |
| 268 | 268 | cgi_redirect(zFrom); |
| @@ -463,11 +463,11 @@ | ||
| 463 | 463 | if( strcmp(zModAction,"approve")==0 ){ |
| 464 | 464 | moderation_approve(rid); |
| 465 | 465 | } |
| 466 | 466 | } |
| 467 | 467 | style_header("Attachment Details"); |
| 468 | - style_submenu_element("Raw", "Raw", "%R/artifact/%S", zUuid); | |
| 468 | + style_submenu_element("Raw", "Raw", "%R/artifact/%s", zUuid); | |
| 469 | 469 | |
| 470 | 470 | @ <div class="section">Overview</div> |
| 471 | 471 | @ <p><table class="label-value"> |
| 472 | 472 | @ <tr><th>Artifact ID:</th> |
| 473 | 473 | @ <td>%z(href("%R/artifact/%s",zUuid))%s(zUuid)</a> |
| @@ -531,12 +531,12 @@ | ||
| 531 | 531 | @ <pre> |
| 532 | 532 | @ %h(z) |
| 533 | 533 | @ </pre> |
| 534 | 534 | } |
| 535 | 535 | }else if( strncmp(zMime, "image/", 6)==0 ){ |
| 536 | - @ <img src="%R/raw/%S(zSrc)?m=%s(zMime)"></img> | |
| 537 | - style_submenu_element("Image", "Image", "%R/raw/%S?m=%s", zSrc, zMime); | |
| 536 | + @ <img src="%R/raw/%s(zSrc)?m=%s(zMime)"></img> | |
| 537 | + style_submenu_element("Image", "Image", "%R/raw/%s?m=%s", zSrc, zMime); | |
| 538 | 538 | }else{ |
| 539 | 539 | int sz = db_int(0, "SELECT size FROM blob WHERE rid=%d", ridSrc); |
| 540 | 540 | @ <i>(file is %d(sz) bytes of binary data)</i> |
| 541 | 541 | } |
| 542 | 542 | @ </blockquote> |
| 543 | 543 |
| --- src/attach.c | |
| +++ src/attach.c | |
| @@ -258,11 +258,11 @@ | |
| 258 | zTkt = db_text(0, "SELECT substr(tagname,5) FROM tag" |
| 259 | " WHERE tagname GLOB 'tkt-%q*'", zTkt); |
| 260 | if( zTkt==0 ) fossil_redirect_home(); |
| 261 | } |
| 262 | zTarget = zTkt; |
| 263 | zTargetType = mprintf("Ticket <a href=\"%s/tktview/%S\">%S</a>", |
| 264 | g.zTop, zTkt, zTkt); |
| 265 | } |
| 266 | if( zFrom==0 ) zFrom = mprintf("%s/home", g.zTop); |
| 267 | if( P("cancel") ){ |
| 268 | cgi_redirect(zFrom); |
| @@ -463,11 +463,11 @@ | |
| 463 | if( strcmp(zModAction,"approve")==0 ){ |
| 464 | moderation_approve(rid); |
| 465 | } |
| 466 | } |
| 467 | style_header("Attachment Details"); |
| 468 | style_submenu_element("Raw", "Raw", "%R/artifact/%S", zUuid); |
| 469 | |
| 470 | @ <div class="section">Overview</div> |
| 471 | @ <p><table class="label-value"> |
| 472 | @ <tr><th>Artifact ID:</th> |
| 473 | @ <td>%z(href("%R/artifact/%s",zUuid))%s(zUuid)</a> |
| @@ -531,12 +531,12 @@ | |
| 531 | @ <pre> |
| 532 | @ %h(z) |
| 533 | @ </pre> |
| 534 | } |
| 535 | }else if( strncmp(zMime, "image/", 6)==0 ){ |
| 536 | @ <img src="%R/raw/%S(zSrc)?m=%s(zMime)"></img> |
| 537 | style_submenu_element("Image", "Image", "%R/raw/%S?m=%s", zSrc, zMime); |
| 538 | }else{ |
| 539 | int sz = db_int(0, "SELECT size FROM blob WHERE rid=%d", ridSrc); |
| 540 | @ <i>(file is %d(sz) bytes of binary data)</i> |
| 541 | } |
| 542 | @ </blockquote> |
| 543 |
| --- src/attach.c | |
| +++ src/attach.c | |
| @@ -258,11 +258,11 @@ | |
| 258 | zTkt = db_text(0, "SELECT substr(tagname,5) FROM tag" |
| 259 | " WHERE tagname GLOB 'tkt-%q*'", zTkt); |
| 260 | if( zTkt==0 ) fossil_redirect_home(); |
| 261 | } |
| 262 | zTarget = zTkt; |
| 263 | zTargetType = mprintf("Ticket <a href=\"%s/tktview/%s\">%S</a>", |
| 264 | g.zTop, zTkt, zTkt); |
| 265 | } |
| 266 | if( zFrom==0 ) zFrom = mprintf("%s/home", g.zTop); |
| 267 | if( P("cancel") ){ |
| 268 | cgi_redirect(zFrom); |
| @@ -463,11 +463,11 @@ | |
| 463 | if( strcmp(zModAction,"approve")==0 ){ |
| 464 | moderation_approve(rid); |
| 465 | } |
| 466 | } |
| 467 | style_header("Attachment Details"); |
| 468 | style_submenu_element("Raw", "Raw", "%R/artifact/%s", zUuid); |
| 469 | |
| 470 | @ <div class="section">Overview</div> |
| 471 | @ <p><table class="label-value"> |
| 472 | @ <tr><th>Artifact ID:</th> |
| 473 | @ <td>%z(href("%R/artifact/%s",zUuid))%s(zUuid)</a> |
| @@ -531,12 +531,12 @@ | |
| 531 | @ <pre> |
| 532 | @ %h(z) |
| 533 | @ </pre> |
| 534 | } |
| 535 | }else if( strncmp(zMime, "image/", 6)==0 ){ |
| 536 | @ <img src="%R/raw/%s(zSrc)?m=%s(zMime)"></img> |
| 537 | style_submenu_element("Image", "Image", "%R/raw/%s?m=%s", zSrc, zMime); |
| 538 | }else{ |
| 539 | int sz = db_int(0, "SELECT size FROM blob WHERE rid=%d", ridSrc); |
| 540 | @ <i>(file is %d(sz) bytes of binary data)</i> |
| 541 | } |
| 542 | @ </blockquote> |
| 543 |
+6
-6
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -179,11 +179,11 @@ | ||
| 179 | 179 | ** --sha1sum Verify file status using SHA1 hashing rather |
| 180 | 180 | ** than relying on file mtimes. |
| 181 | 181 | ** --header Identify the repository if there are changes |
| 182 | 182 | ** -v|--verbose Say "(none)" if there are no changes |
| 183 | 183 | ** |
| 184 | -** See also: extra, ls, status | |
| 184 | +** See also: extras, ls, status | |
| 185 | 185 | */ |
| 186 | 186 | void changes_cmd(void){ |
| 187 | 187 | Blob report; |
| 188 | 188 | int vid; |
| 189 | 189 | int useSha1sum = find_option("sha1sum", 0, 0)!=0; |
| @@ -223,11 +223,11 @@ | ||
| 223 | 223 | ** --rel-paths Display pathnames relative to the current working |
| 224 | 224 | ** directory. |
| 225 | 225 | ** --sha1sum Verify file status using SHA1 hashing rather |
| 226 | 226 | ** than relying on file mtimes. |
| 227 | 227 | ** |
| 228 | -** See also: changes, extra, ls | |
| 228 | +** See also: changes, extras, ls | |
| 229 | 229 | */ |
| 230 | 230 | void status_cmd(void){ |
| 231 | 231 | int vid; |
| 232 | 232 | db_must_be_within_tree(); |
| 233 | 233 | /* 012345678901234 */ |
| @@ -255,11 +255,11 @@ | ||
| 255 | 255 | ** |
| 256 | 256 | ** Options: |
| 257 | 257 | ** --age Show when each file was committed |
| 258 | 258 | ** -v|--verbose Provide extra information about each file. |
| 259 | 259 | ** |
| 260 | -** See also: changes, extra, status | |
| 260 | +** See also: changes, extras, status | |
| 261 | 261 | */ |
| 262 | 262 | void ls_cmd(void){ |
| 263 | 263 | int vid; |
| 264 | 264 | Stmt q; |
| 265 | 265 | int verboseFlag; |
| @@ -439,11 +439,11 @@ | ||
| 439 | 439 | ** --rel-paths Display pathnames relative to the current working |
| 440 | 440 | ** directory. |
| 441 | 441 | ** |
| 442 | 442 | ** See also: changes, clean, status |
| 443 | 443 | */ |
| 444 | -void extra_cmd(void){ | |
| 444 | +void extras_cmd(void){ | |
| 445 | 445 | Stmt q; |
| 446 | 446 | const char *zIgnoreFlag = find_option("ignore",0,1); |
| 447 | 447 | unsigned scanFlags = find_option("dotfiles",0,0)!=0 ? SCAN_ALL : 0; |
| 448 | 448 | int cwdRelative = 0; |
| 449 | 449 | Glob *pIgnore; |
| @@ -536,11 +536,11 @@ | ||
| 536 | 536 | ** list of glob patterns. |
| 537 | 537 | ** -n|--dry-run If given, display instead of run actions. |
| 538 | 538 | ** --temp Remove only Fossil-generated temporary files. |
| 539 | 539 | ** -v|--verbose Show all files as they are removed. |
| 540 | 540 | ** |
| 541 | -** See also: addremove, extra, status | |
| 541 | +** See also: addremove, extras, status | |
| 542 | 542 | */ |
| 543 | 543 | void clean_cmd(void){ |
| 544 | 544 | int allFileFlag, allDirFlag, dryRunFlag, verboseFlag; |
| 545 | 545 | int emptyDirsFlag, dirsOnlyFlag; |
| 546 | 546 | unsigned scanFlags = 0; |
| @@ -1408,11 +1408,11 @@ | ||
| 1408 | 1408 | ** --private do not sync changes and their descendants |
| 1409 | 1409 | ** --sha1sum verify file status using SHA1 hashing rather |
| 1410 | 1410 | ** than relying on file mtimes |
| 1411 | 1411 | ** --tag TAG-NAME assign given tag TAG-NAME to the checkin |
| 1412 | 1412 | ** |
| 1413 | -** See also: branch, changes, checkout, extra, sync | |
| 1413 | +** See also: branch, changes, checkout, extras, sync | |
| 1414 | 1414 | */ |
| 1415 | 1415 | void commit_cmd(void){ |
| 1416 | 1416 | int hasChanges; /* True if unsaved changes exist */ |
| 1417 | 1417 | int vid; /* blob-id of parent version */ |
| 1418 | 1418 | int nrid; /* blob-id of a modified file */ |
| 1419 | 1419 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -179,11 +179,11 @@ | |
| 179 | ** --sha1sum Verify file status using SHA1 hashing rather |
| 180 | ** than relying on file mtimes. |
| 181 | ** --header Identify the repository if there are changes |
| 182 | ** -v|--verbose Say "(none)" if there are no changes |
| 183 | ** |
| 184 | ** See also: extra, ls, status |
| 185 | */ |
| 186 | void changes_cmd(void){ |
| 187 | Blob report; |
| 188 | int vid; |
| 189 | int useSha1sum = find_option("sha1sum", 0, 0)!=0; |
| @@ -223,11 +223,11 @@ | |
| 223 | ** --rel-paths Display pathnames relative to the current working |
| 224 | ** directory. |
| 225 | ** --sha1sum Verify file status using SHA1 hashing rather |
| 226 | ** than relying on file mtimes. |
| 227 | ** |
| 228 | ** See also: changes, extra, ls |
| 229 | */ |
| 230 | void status_cmd(void){ |
| 231 | int vid; |
| 232 | db_must_be_within_tree(); |
| 233 | /* 012345678901234 */ |
| @@ -255,11 +255,11 @@ | |
| 255 | ** |
| 256 | ** Options: |
| 257 | ** --age Show when each file was committed |
| 258 | ** -v|--verbose Provide extra information about each file. |
| 259 | ** |
| 260 | ** See also: changes, extra, status |
| 261 | */ |
| 262 | void ls_cmd(void){ |
| 263 | int vid; |
| 264 | Stmt q; |
| 265 | int verboseFlag; |
| @@ -439,11 +439,11 @@ | |
| 439 | ** --rel-paths Display pathnames relative to the current working |
| 440 | ** directory. |
| 441 | ** |
| 442 | ** See also: changes, clean, status |
| 443 | */ |
| 444 | void extra_cmd(void){ |
| 445 | Stmt q; |
| 446 | const char *zIgnoreFlag = find_option("ignore",0,1); |
| 447 | unsigned scanFlags = find_option("dotfiles",0,0)!=0 ? SCAN_ALL : 0; |
| 448 | int cwdRelative = 0; |
| 449 | Glob *pIgnore; |
| @@ -536,11 +536,11 @@ | |
| 536 | ** list of glob patterns. |
| 537 | ** -n|--dry-run If given, display instead of run actions. |
| 538 | ** --temp Remove only Fossil-generated temporary files. |
| 539 | ** -v|--verbose Show all files as they are removed. |
| 540 | ** |
| 541 | ** See also: addremove, extra, status |
| 542 | */ |
| 543 | void clean_cmd(void){ |
| 544 | int allFileFlag, allDirFlag, dryRunFlag, verboseFlag; |
| 545 | int emptyDirsFlag, dirsOnlyFlag; |
| 546 | unsigned scanFlags = 0; |
| @@ -1408,11 +1408,11 @@ | |
| 1408 | ** --private do not sync changes and their descendants |
| 1409 | ** --sha1sum verify file status using SHA1 hashing rather |
| 1410 | ** than relying on file mtimes |
| 1411 | ** --tag TAG-NAME assign given tag TAG-NAME to the checkin |
| 1412 | ** |
| 1413 | ** See also: branch, changes, checkout, extra, sync |
| 1414 | */ |
| 1415 | void commit_cmd(void){ |
| 1416 | int hasChanges; /* True if unsaved changes exist */ |
| 1417 | int vid; /* blob-id of parent version */ |
| 1418 | int nrid; /* blob-id of a modified file */ |
| 1419 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -179,11 +179,11 @@ | |
| 179 | ** --sha1sum Verify file status using SHA1 hashing rather |
| 180 | ** than relying on file mtimes. |
| 181 | ** --header Identify the repository if there are changes |
| 182 | ** -v|--verbose Say "(none)" if there are no changes |
| 183 | ** |
| 184 | ** See also: extras, ls, status |
| 185 | */ |
| 186 | void changes_cmd(void){ |
| 187 | Blob report; |
| 188 | int vid; |
| 189 | int useSha1sum = find_option("sha1sum", 0, 0)!=0; |
| @@ -223,11 +223,11 @@ | |
| 223 | ** --rel-paths Display pathnames relative to the current working |
| 224 | ** directory. |
| 225 | ** --sha1sum Verify file status using SHA1 hashing rather |
| 226 | ** than relying on file mtimes. |
| 227 | ** |
| 228 | ** See also: changes, extras, ls |
| 229 | */ |
| 230 | void status_cmd(void){ |
| 231 | int vid; |
| 232 | db_must_be_within_tree(); |
| 233 | /* 012345678901234 */ |
| @@ -255,11 +255,11 @@ | |
| 255 | ** |
| 256 | ** Options: |
| 257 | ** --age Show when each file was committed |
| 258 | ** -v|--verbose Provide extra information about each file. |
| 259 | ** |
| 260 | ** See also: changes, extras, status |
| 261 | */ |
| 262 | void ls_cmd(void){ |
| 263 | int vid; |
| 264 | Stmt q; |
| 265 | int verboseFlag; |
| @@ -439,11 +439,11 @@ | |
| 439 | ** --rel-paths Display pathnames relative to the current working |
| 440 | ** directory. |
| 441 | ** |
| 442 | ** See also: changes, clean, status |
| 443 | */ |
| 444 | void extras_cmd(void){ |
| 445 | Stmt q; |
| 446 | const char *zIgnoreFlag = find_option("ignore",0,1); |
| 447 | unsigned scanFlags = find_option("dotfiles",0,0)!=0 ? SCAN_ALL : 0; |
| 448 | int cwdRelative = 0; |
| 449 | Glob *pIgnore; |
| @@ -536,11 +536,11 @@ | |
| 536 | ** list of glob patterns. |
| 537 | ** -n|--dry-run If given, display instead of run actions. |
| 538 | ** --temp Remove only Fossil-generated temporary files. |
| 539 | ** -v|--verbose Show all files as they are removed. |
| 540 | ** |
| 541 | ** See also: addremove, extras, status |
| 542 | */ |
| 543 | void clean_cmd(void){ |
| 544 | int allFileFlag, allDirFlag, dryRunFlag, verboseFlag; |
| 545 | int emptyDirsFlag, dirsOnlyFlag; |
| 546 | unsigned scanFlags = 0; |
| @@ -1408,11 +1408,11 @@ | |
| 1408 | ** --private do not sync changes and their descendants |
| 1409 | ** --sha1sum verify file status using SHA1 hashing rather |
| 1410 | ** than relying on file mtimes |
| 1411 | ** --tag TAG-NAME assign given tag TAG-NAME to the checkin |
| 1412 | ** |
| 1413 | ** See also: branch, changes, checkout, extras, sync |
| 1414 | */ |
| 1415 | void commit_cmd(void){ |
| 1416 | int hasChanges; /* True if unsaved changes exist */ |
| 1417 | int vid; /* blob-id of parent version */ |
| 1418 | int nrid; /* blob-id of a modified file */ |
| 1419 |
+6
-6
| --- src/clone.c | ||
| +++ src/clone.c | ||
| @@ -136,13 +136,13 @@ | ||
| 136 | 136 | if( file_size(g.argv[3])>0 ){ |
| 137 | 137 | fossil_fatal("file already exists: %s", g.argv[3]); |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | url_parse(g.argv[2], urlFlags); |
| 141 | - if( zDefaultUser==0 && g.urlUser!=0 ) zDefaultUser = g.urlUser; | |
| 142 | - if( g.urlIsFile ){ | |
| 143 | - file_copy(g.urlName, g.argv[3]); | |
| 141 | + if( zDefaultUser==0 && g.url.user!=0 ) zDefaultUser = g.url.user; | |
| 142 | + if( g.url.isFile ){ | |
| 143 | + file_copy(g.url.name, g.argv[3]); | |
| 144 | 144 | db_close(1); |
| 145 | 145 | db_open_repository(g.argv[3]); |
| 146 | 146 | db_record_repository_filename(g.argv[3]); |
| 147 | 147 | url_remember(); |
| 148 | 148 | if( !bPrivate ) delete_private_content(); |
| @@ -211,11 +211,11 @@ | ||
| 211 | 211 | void remember_or_get_http_auth( |
| 212 | 212 | const char *zHttpAuth, /* Credentials in the form "user:password" */ |
| 213 | 213 | int fRemember, /* True to remember credentials for later reuse */ |
| 214 | 214 | const char *zUrl /* URL for which these credentials apply */ |
| 215 | 215 | ){ |
| 216 | - char *zKey = mprintf("http-auth:%s", g.urlCanonical); | |
| 216 | + char *zKey = mprintf("http-auth:%s", g.url.canonical); | |
| 217 | 217 | if( zHttpAuth && zHttpAuth[0] ){ |
| 218 | 218 | g.zHttpAuth = mprintf("%s", zHttpAuth); |
| 219 | 219 | } |
| 220 | 220 | if( fRemember ){ |
| 221 | 221 | if( g.zHttpAuth && g.zHttpAuth[0] ){ |
| @@ -233,20 +233,20 @@ | ||
| 233 | 233 | |
| 234 | 234 | /* |
| 235 | 235 | ** Get the HTTP Authorization preference from db. |
| 236 | 236 | */ |
| 237 | 237 | char *get_httpauth(void){ |
| 238 | - char *zKey = mprintf("http-auth:%s", g.urlCanonical); | |
| 238 | + char *zKey = mprintf("http-auth:%s", g.url.canonical); | |
| 239 | 239 | return unobscure(db_get(zKey, 0)); |
| 240 | 240 | free(zKey); |
| 241 | 241 | } |
| 242 | 242 | |
| 243 | 243 | /* |
| 244 | 244 | ** Set the HTTP Authorization preference in db. |
| 245 | 245 | */ |
| 246 | 246 | void set_httpauth(const char *zHttpAuth){ |
| 247 | - char *zKey = mprintf("http-auth:%s", g.urlCanonical); | |
| 247 | + char *zKey = mprintf("http-auth:%s", g.url.canonical); | |
| 248 | 248 | db_set(zKey, obscure(zHttpAuth), 0); |
| 249 | 249 | free(zKey); |
| 250 | 250 | } |
| 251 | 251 | |
| 252 | 252 | /* |
| 253 | 253 |
| --- src/clone.c | |
| +++ src/clone.c | |
| @@ -136,13 +136,13 @@ | |
| 136 | if( file_size(g.argv[3])>0 ){ |
| 137 | fossil_fatal("file already exists: %s", g.argv[3]); |
| 138 | } |
| 139 | |
| 140 | url_parse(g.argv[2], urlFlags); |
| 141 | if( zDefaultUser==0 && g.urlUser!=0 ) zDefaultUser = g.urlUser; |
| 142 | if( g.urlIsFile ){ |
| 143 | file_copy(g.urlName, g.argv[3]); |
| 144 | db_close(1); |
| 145 | db_open_repository(g.argv[3]); |
| 146 | db_record_repository_filename(g.argv[3]); |
| 147 | url_remember(); |
| 148 | if( !bPrivate ) delete_private_content(); |
| @@ -211,11 +211,11 @@ | |
| 211 | void remember_or_get_http_auth( |
| 212 | const char *zHttpAuth, /* Credentials in the form "user:password" */ |
| 213 | int fRemember, /* True to remember credentials for later reuse */ |
| 214 | const char *zUrl /* URL for which these credentials apply */ |
| 215 | ){ |
| 216 | char *zKey = mprintf("http-auth:%s", g.urlCanonical); |
| 217 | if( zHttpAuth && zHttpAuth[0] ){ |
| 218 | g.zHttpAuth = mprintf("%s", zHttpAuth); |
| 219 | } |
| 220 | if( fRemember ){ |
| 221 | if( g.zHttpAuth && g.zHttpAuth[0] ){ |
| @@ -233,20 +233,20 @@ | |
| 233 | |
| 234 | /* |
| 235 | ** Get the HTTP Authorization preference from db. |
| 236 | */ |
| 237 | char *get_httpauth(void){ |
| 238 | char *zKey = mprintf("http-auth:%s", g.urlCanonical); |
| 239 | return unobscure(db_get(zKey, 0)); |
| 240 | free(zKey); |
| 241 | } |
| 242 | |
| 243 | /* |
| 244 | ** Set the HTTP Authorization preference in db. |
| 245 | */ |
| 246 | void set_httpauth(const char *zHttpAuth){ |
| 247 | char *zKey = mprintf("http-auth:%s", g.urlCanonical); |
| 248 | db_set(zKey, obscure(zHttpAuth), 0); |
| 249 | free(zKey); |
| 250 | } |
| 251 | |
| 252 | /* |
| 253 |
| --- src/clone.c | |
| +++ src/clone.c | |
| @@ -136,13 +136,13 @@ | |
| 136 | if( file_size(g.argv[3])>0 ){ |
| 137 | fossil_fatal("file already exists: %s", g.argv[3]); |
| 138 | } |
| 139 | |
| 140 | url_parse(g.argv[2], urlFlags); |
| 141 | if( zDefaultUser==0 && g.url.user!=0 ) zDefaultUser = g.url.user; |
| 142 | if( g.url.isFile ){ |
| 143 | file_copy(g.url.name, g.argv[3]); |
| 144 | db_close(1); |
| 145 | db_open_repository(g.argv[3]); |
| 146 | db_record_repository_filename(g.argv[3]); |
| 147 | url_remember(); |
| 148 | if( !bPrivate ) delete_private_content(); |
| @@ -211,11 +211,11 @@ | |
| 211 | void remember_or_get_http_auth( |
| 212 | const char *zHttpAuth, /* Credentials in the form "user:password" */ |
| 213 | int fRemember, /* True to remember credentials for later reuse */ |
| 214 | const char *zUrl /* URL for which these credentials apply */ |
| 215 | ){ |
| 216 | char *zKey = mprintf("http-auth:%s", g.url.canonical); |
| 217 | if( zHttpAuth && zHttpAuth[0] ){ |
| 218 | g.zHttpAuth = mprintf("%s", zHttpAuth); |
| 219 | } |
| 220 | if( fRemember ){ |
| 221 | if( g.zHttpAuth && g.zHttpAuth[0] ){ |
| @@ -233,20 +233,20 @@ | |
| 233 | |
| 234 | /* |
| 235 | ** Get the HTTP Authorization preference from db. |
| 236 | */ |
| 237 | char *get_httpauth(void){ |
| 238 | char *zKey = mprintf("http-auth:%s", g.url.canonical); |
| 239 | return unobscure(db_get(zKey, 0)); |
| 240 | free(zKey); |
| 241 | } |
| 242 | |
| 243 | /* |
| 244 | ** Set the HTTP Authorization preference in db. |
| 245 | */ |
| 246 | void set_httpauth(const char *zHttpAuth){ |
| 247 | char *zKey = mprintf("http-auth:%s", g.url.canonical); |
| 248 | db_set(zKey, obscure(zHttpAuth), 0); |
| 249 | free(zKey); |
| 250 | } |
| 251 | |
| 252 | /* |
| 253 |
+1
-1
| --- src/configure.c | ||
| +++ src/configure.c | ||
| @@ -924,11 +924,11 @@ | ||
| 924 | 924 | mask = configure_name_to_mask(g.argv[3], 1); |
| 925 | 925 | if( g.argc==5 ){ |
| 926 | 926 | zServer = g.argv[4]; |
| 927 | 927 | } |
| 928 | 928 | url_parse(zServer, URL_PROMPT_PW); |
| 929 | - if( g.urlProtocol==0 ) fossil_fatal("no server URL specified"); | |
| 929 | + if( g.url.protocol==0 ) fossil_fatal("no server URL specified"); | |
| 930 | 930 | user_select(); |
| 931 | 931 | url_enable_proxy("via proxy: "); |
| 932 | 932 | if( legacyFlag ) mask |= CONFIGSET_OLDFORMAT; |
| 933 | 933 | if( overwriteFlag ) mask |= CONFIGSET_OVERWRITE; |
| 934 | 934 | if( strncmp(zMethod, "push", n)==0 ){ |
| 935 | 935 |
| --- src/configure.c | |
| +++ src/configure.c | |
| @@ -924,11 +924,11 @@ | |
| 924 | mask = configure_name_to_mask(g.argv[3], 1); |
| 925 | if( g.argc==5 ){ |
| 926 | zServer = g.argv[4]; |
| 927 | } |
| 928 | url_parse(zServer, URL_PROMPT_PW); |
| 929 | if( g.urlProtocol==0 ) fossil_fatal("no server URL specified"); |
| 930 | user_select(); |
| 931 | url_enable_proxy("via proxy: "); |
| 932 | if( legacyFlag ) mask |= CONFIGSET_OLDFORMAT; |
| 933 | if( overwriteFlag ) mask |= CONFIGSET_OVERWRITE; |
| 934 | if( strncmp(zMethod, "push", n)==0 ){ |
| 935 |
| --- src/configure.c | |
| +++ src/configure.c | |
| @@ -924,11 +924,11 @@ | |
| 924 | mask = configure_name_to_mask(g.argv[3], 1); |
| 925 | if( g.argc==5 ){ |
| 926 | zServer = g.argv[4]; |
| 927 | } |
| 928 | url_parse(zServer, URL_PROMPT_PW); |
| 929 | if( g.url.protocol==0 ) fossil_fatal("no server URL specified"); |
| 930 | user_select(); |
| 931 | url_enable_proxy("via proxy: "); |
| 932 | if( legacyFlag ) mask |= CONFIGSET_OLDFORMAT; |
| 933 | if( overwriteFlag ) mask |= CONFIGSET_OVERWRITE; |
| 934 | if( strncmp(zMethod, "push", n)==0 ){ |
| 935 |
+1
-1
| --- src/delta.c | ||
| +++ src/delta.c | ||
| @@ -467,11 +467,11 @@ | ||
| 467 | 467 | zDelta += lenOut-base; |
| 468 | 468 | } |
| 469 | 469 | /* Output the final checksum record. */ |
| 470 | 470 | putInt(checksum(zOut, lenOut), &zDelta); |
| 471 | 471 | *(zDelta++) = ';'; |
| 472 | - free(collide); | |
| 472 | + fossil_free(collide); | |
| 473 | 473 | return zDelta - zOrigDelta; |
| 474 | 474 | } |
| 475 | 475 | |
| 476 | 476 | /* |
| 477 | 477 | ** Return the size (in bytes) of the output from applying |
| 478 | 478 |
| --- src/delta.c | |
| +++ src/delta.c | |
| @@ -467,11 +467,11 @@ | |
| 467 | zDelta += lenOut-base; |
| 468 | } |
| 469 | /* Output the final checksum record. */ |
| 470 | putInt(checksum(zOut, lenOut), &zDelta); |
| 471 | *(zDelta++) = ';'; |
| 472 | free(collide); |
| 473 | return zDelta - zOrigDelta; |
| 474 | } |
| 475 | |
| 476 | /* |
| 477 | ** Return the size (in bytes) of the output from applying |
| 478 |
| --- src/delta.c | |
| +++ src/delta.c | |
| @@ -467,11 +467,11 @@ | |
| 467 | zDelta += lenOut-base; |
| 468 | } |
| 469 | /* Output the final checksum record. */ |
| 470 | putInt(checksum(zOut, lenOut), &zDelta); |
| 471 | *(zDelta++) = ';'; |
| 472 | fossil_free(collide); |
| 473 | return zDelta - zOrigDelta; |
| 474 | } |
| 475 | |
| 476 | /* |
| 477 | ** Return the size (in bytes) of the output from applying |
| 478 |
+1
-1
| --- src/diff.c | ||
| +++ src/diff.c | ||
| @@ -225,11 +225,11 @@ | ||
| 225 | 225 | while( a<pA->n && b<pB->n ){ |
| 226 | 226 | if( pA->z[a++] != pB->z[b++] ) return 0; |
| 227 | 227 | while( a<pA->n && fossil_isspace(pA->z[a])) ++a; |
| 228 | 228 | while( b<pB->n && fossil_isspace(pB->z[b])) ++b; |
| 229 | 229 | } |
| 230 | - return pA->n-a == b<pB->n-b; | |
| 230 | + return pA->n-a == pB->n-b; | |
| 231 | 231 | } |
| 232 | 232 | return 0; |
| 233 | 233 | } |
| 234 | 234 | |
| 235 | 235 | /* |
| 236 | 236 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -225,11 +225,11 @@ | |
| 225 | while( a<pA->n && b<pB->n ){ |
| 226 | if( pA->z[a++] != pB->z[b++] ) return 0; |
| 227 | while( a<pA->n && fossil_isspace(pA->z[a])) ++a; |
| 228 | while( b<pB->n && fossil_isspace(pB->z[b])) ++b; |
| 229 | } |
| 230 | return pA->n-a == b<pB->n-b; |
| 231 | } |
| 232 | return 0; |
| 233 | } |
| 234 | |
| 235 | /* |
| 236 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -225,11 +225,11 @@ | |
| 225 | while( a<pA->n && b<pB->n ){ |
| 226 | if( pA->z[a++] != pB->z[b++] ) return 0; |
| 227 | while( a<pA->n && fossil_isspace(pA->z[a])) ++a; |
| 228 | while( b<pB->n && fossil_isspace(pB->z[b])) ++b; |
| 229 | } |
| 230 | return pA->n-a == pB->n-b; |
| 231 | } |
| 232 | return 0; |
| 233 | } |
| 234 | |
| 235 | /* |
| 236 |
+6
-10
| --- src/finfo.c | ||
| +++ src/finfo.c | ||
| @@ -386,11 +386,11 @@ | ||
| 386 | 386 | } |
| 387 | 387 | blob_reset(&sql); |
| 388 | 388 | blob_zero(&title); |
| 389 | 389 | if( baseCheckin ){ |
| 390 | 390 | char *zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", baseCheckin); |
| 391 | - char *zLink = href("%R/info/%S", zUuid); | |
| 391 | + char *zLink = href("%R/info/%s", zUuid); | |
| 392 | 392 | blob_appendf(&title, "Ancestors of file "); |
| 393 | 393 | hyperlinked_path(zFilename, &title, zUuid, "tree", ""); |
| 394 | 394 | blob_appendf(&title, " from check-in %z%.10s</a>", zLink, zUuid); |
| 395 | 395 | fossil_free(zUuid); |
| 396 | 396 | }else{ |
| @@ -416,12 +416,10 @@ | ||
| 416 | 416 | const char *zBr = db_column_text(&q, 9); |
| 417 | 417 | int fmid = db_column_int(&q, 10); |
| 418 | 418 | int pfnid = db_column_int(&q, 11); |
| 419 | 419 | int gidx; |
| 420 | 420 | char zTime[10]; |
| 421 | - char zShort[20]; | |
| 422 | - char zShortCkin[20]; | |
| 423 | 421 | if( zBr==0 ) zBr = "trunk"; |
| 424 | 422 | if( uBg ){ |
| 425 | 423 | zBgClr = hash_color(zUser); |
| 426 | 424 | }else if( brBg || zBgClr==0 || zBgClr[0]==0 ){ |
| 427 | 425 | zBgClr = strcmp(zBr,"trunk")==0 ? "" : hash_color(zBr); |
| @@ -442,12 +440,10 @@ | ||
| 442 | 440 | if( zBgClr && zBgClr[0] ){ |
| 443 | 441 | @ <td class="timelineTableCell" style="background-color: %h(zBgClr);"> |
| 444 | 442 | }else{ |
| 445 | 443 | @ <td class="timelineTableCell"> |
| 446 | 444 | } |
| 447 | - sqlite3_snprintf(sizeof(zShort), zShort, "%.10s", zUuid); | |
| 448 | - sqlite3_snprintf(sizeof(zShortCkin), zShortCkin, "%.10s", zCkin); | |
| 449 | 445 | if( zUuid ){ |
| 450 | 446 | if( fpid==0 ){ |
| 451 | 447 | @ <b>Added</b> |
| 452 | 448 | }else if( pfnid ){ |
| 453 | 449 | char *zPrevName = db_text(0, "SELECT name FROM filename WHERE fnid=%d", |
| @@ -470,23 +466,23 @@ | ||
| 470 | 466 | fossil_free(zNewName); |
| 471 | 467 | }else{ |
| 472 | 468 | @ <b>Deleted</b> by check-in |
| 473 | 469 | } |
| 474 | 470 | } |
| 475 | - hyperlink_to_uuid(zShortCkin); | |
| 471 | + hyperlink_to_uuid(zCkin); | |
| 476 | 472 | @ %w(zCom) (user: |
| 477 | 473 | hyperlink_to_user(zUser, zDate, ""); |
| 478 | 474 | @ branch: %h(zBr)) |
| 479 | 475 | if( g.perm.Hyperlink && zUuid ){ |
| 480 | 476 | const char *z = zFilename; |
| 481 | - @ %z(href("%R/annotate?checkin=%S&filename=%h",zCkin,z)) | |
| 477 | + @ %z(href("%R/annotate?filename=%h&checkin=%s",z,zCkin)) | |
| 482 | 478 | @ [annotate]</a> |
| 483 | - @ %z(href("%R/blame?checkin=%S&filename=%h",zCkin,z)) | |
| 479 | + @ %z(href("%R/blame?filename=%h&checkin=%s",z,zCkin)) | |
| 484 | 480 | @ [blame]</a> |
| 485 | - @ %z(href("%R/timeline?n=200&uf=%S",zUuid))[checkins using]</a> | |
| 481 | + @ %z(href("%R/timeline?n=200&uf=%s",zUuid))[checkins using]</a> | |
| 486 | 482 | if( fpid ){ |
| 487 | - @ %z(href("%R/fdiff?v1=%S&v2=%S&sbs=1",zPUuid,zUuid))[diff]</a> | |
| 483 | + @ %z(href("%R/fdiff?sbs=1&v1=%s&v2=%s",zPUuid,zUuid))[diff]</a> | |
| 488 | 484 | } |
| 489 | 485 | } |
| 490 | 486 | if( fDebug & FINFO_DEBUG_MLINK ){ |
| 491 | 487 | int srcid = db_int(0, "SELECT srcid FROM delta WHERE rid=%d", frid); |
| 492 | 488 | int sz = db_int(0, "SELECT length(content) FROM blob WHERE rid=%d", frid); |
| 493 | 489 |
| --- src/finfo.c | |
| +++ src/finfo.c | |
| @@ -386,11 +386,11 @@ | |
| 386 | } |
| 387 | blob_reset(&sql); |
| 388 | blob_zero(&title); |
| 389 | if( baseCheckin ){ |
| 390 | char *zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", baseCheckin); |
| 391 | char *zLink = href("%R/info/%S", zUuid); |
| 392 | blob_appendf(&title, "Ancestors of file "); |
| 393 | hyperlinked_path(zFilename, &title, zUuid, "tree", ""); |
| 394 | blob_appendf(&title, " from check-in %z%.10s</a>", zLink, zUuid); |
| 395 | fossil_free(zUuid); |
| 396 | }else{ |
| @@ -416,12 +416,10 @@ | |
| 416 | const char *zBr = db_column_text(&q, 9); |
| 417 | int fmid = db_column_int(&q, 10); |
| 418 | int pfnid = db_column_int(&q, 11); |
| 419 | int gidx; |
| 420 | char zTime[10]; |
| 421 | char zShort[20]; |
| 422 | char zShortCkin[20]; |
| 423 | if( zBr==0 ) zBr = "trunk"; |
| 424 | if( uBg ){ |
| 425 | zBgClr = hash_color(zUser); |
| 426 | }else if( brBg || zBgClr==0 || zBgClr[0]==0 ){ |
| 427 | zBgClr = strcmp(zBr,"trunk")==0 ? "" : hash_color(zBr); |
| @@ -442,12 +440,10 @@ | |
| 442 | if( zBgClr && zBgClr[0] ){ |
| 443 | @ <td class="timelineTableCell" style="background-color: %h(zBgClr);"> |
| 444 | }else{ |
| 445 | @ <td class="timelineTableCell"> |
| 446 | } |
| 447 | sqlite3_snprintf(sizeof(zShort), zShort, "%.10s", zUuid); |
| 448 | sqlite3_snprintf(sizeof(zShortCkin), zShortCkin, "%.10s", zCkin); |
| 449 | if( zUuid ){ |
| 450 | if( fpid==0 ){ |
| 451 | @ <b>Added</b> |
| 452 | }else if( pfnid ){ |
| 453 | char *zPrevName = db_text(0, "SELECT name FROM filename WHERE fnid=%d", |
| @@ -470,23 +466,23 @@ | |
| 470 | fossil_free(zNewName); |
| 471 | }else{ |
| 472 | @ <b>Deleted</b> by check-in |
| 473 | } |
| 474 | } |
| 475 | hyperlink_to_uuid(zShortCkin); |
| 476 | @ %w(zCom) (user: |
| 477 | hyperlink_to_user(zUser, zDate, ""); |
| 478 | @ branch: %h(zBr)) |
| 479 | if( g.perm.Hyperlink && zUuid ){ |
| 480 | const char *z = zFilename; |
| 481 | @ %z(href("%R/annotate?checkin=%S&filename=%h",zCkin,z)) |
| 482 | @ [annotate]</a> |
| 483 | @ %z(href("%R/blame?checkin=%S&filename=%h",zCkin,z)) |
| 484 | @ [blame]</a> |
| 485 | @ %z(href("%R/timeline?n=200&uf=%S",zUuid))[checkins using]</a> |
| 486 | if( fpid ){ |
| 487 | @ %z(href("%R/fdiff?v1=%S&v2=%S&sbs=1",zPUuid,zUuid))[diff]</a> |
| 488 | } |
| 489 | } |
| 490 | if( fDebug & FINFO_DEBUG_MLINK ){ |
| 491 | int srcid = db_int(0, "SELECT srcid FROM delta WHERE rid=%d", frid); |
| 492 | int sz = db_int(0, "SELECT length(content) FROM blob WHERE rid=%d", frid); |
| 493 |
| --- src/finfo.c | |
| +++ src/finfo.c | |
| @@ -386,11 +386,11 @@ | |
| 386 | } |
| 387 | blob_reset(&sql); |
| 388 | blob_zero(&title); |
| 389 | if( baseCheckin ){ |
| 390 | char *zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", baseCheckin); |
| 391 | char *zLink = href("%R/info/%s", zUuid); |
| 392 | blob_appendf(&title, "Ancestors of file "); |
| 393 | hyperlinked_path(zFilename, &title, zUuid, "tree", ""); |
| 394 | blob_appendf(&title, " from check-in %z%.10s</a>", zLink, zUuid); |
| 395 | fossil_free(zUuid); |
| 396 | }else{ |
| @@ -416,12 +416,10 @@ | |
| 416 | const char *zBr = db_column_text(&q, 9); |
| 417 | int fmid = db_column_int(&q, 10); |
| 418 | int pfnid = db_column_int(&q, 11); |
| 419 | int gidx; |
| 420 | char zTime[10]; |
| 421 | if( zBr==0 ) zBr = "trunk"; |
| 422 | if( uBg ){ |
| 423 | zBgClr = hash_color(zUser); |
| 424 | }else if( brBg || zBgClr==0 || zBgClr[0]==0 ){ |
| 425 | zBgClr = strcmp(zBr,"trunk")==0 ? "" : hash_color(zBr); |
| @@ -442,12 +440,10 @@ | |
| 440 | if( zBgClr && zBgClr[0] ){ |
| 441 | @ <td class="timelineTableCell" style="background-color: %h(zBgClr);"> |
| 442 | }else{ |
| 443 | @ <td class="timelineTableCell"> |
| 444 | } |
| 445 | if( zUuid ){ |
| 446 | if( fpid==0 ){ |
| 447 | @ <b>Added</b> |
| 448 | }else if( pfnid ){ |
| 449 | char *zPrevName = db_text(0, "SELECT name FROM filename WHERE fnid=%d", |
| @@ -470,23 +466,23 @@ | |
| 466 | fossil_free(zNewName); |
| 467 | }else{ |
| 468 | @ <b>Deleted</b> by check-in |
| 469 | } |
| 470 | } |
| 471 | hyperlink_to_uuid(zCkin); |
| 472 | @ %w(zCom) (user: |
| 473 | hyperlink_to_user(zUser, zDate, ""); |
| 474 | @ branch: %h(zBr)) |
| 475 | if( g.perm.Hyperlink && zUuid ){ |
| 476 | const char *z = zFilename; |
| 477 | @ %z(href("%R/annotate?filename=%h&checkin=%s",z,zCkin)) |
| 478 | @ [annotate]</a> |
| 479 | @ %z(href("%R/blame?filename=%h&checkin=%s",z,zCkin)) |
| 480 | @ [blame]</a> |
| 481 | @ %z(href("%R/timeline?n=200&uf=%s",zUuid))[checkins using]</a> |
| 482 | if( fpid ){ |
| 483 | @ %z(href("%R/fdiff?sbs=1&v1=%s&v2=%s",zPUuid,zUuid))[diff]</a> |
| 484 | } |
| 485 | } |
| 486 | if( fDebug & FINFO_DEBUG_MLINK ){ |
| 487 | int srcid = db_int(0, "SELECT srcid FROM delta WHERE rid=%d", frid); |
| 488 | int sz = db_int(0, "SELECT length(content) FROM blob WHERE rid=%d", frid); |
| 489 |
+6
-10
| --- src/finfo.c | ||
| +++ src/finfo.c | ||
| @@ -386,11 +386,11 @@ | ||
| 386 | 386 | } |
| 387 | 387 | blob_reset(&sql); |
| 388 | 388 | blob_zero(&title); |
| 389 | 389 | if( baseCheckin ){ |
| 390 | 390 | char *zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", baseCheckin); |
| 391 | - char *zLink = href("%R/info/%S", zUuid); | |
| 391 | + char *zLink = href("%R/info/%s", zUuid); | |
| 392 | 392 | blob_appendf(&title, "Ancestors of file "); |
| 393 | 393 | hyperlinked_path(zFilename, &title, zUuid, "tree", ""); |
| 394 | 394 | blob_appendf(&title, " from check-in %z%.10s</a>", zLink, zUuid); |
| 395 | 395 | fossil_free(zUuid); |
| 396 | 396 | }else{ |
| @@ -416,12 +416,10 @@ | ||
| 416 | 416 | const char *zBr = db_column_text(&q, 9); |
| 417 | 417 | int fmid = db_column_int(&q, 10); |
| 418 | 418 | int pfnid = db_column_int(&q, 11); |
| 419 | 419 | int gidx; |
| 420 | 420 | char zTime[10]; |
| 421 | - char zShort[20]; | |
| 422 | - char zShortCkin[20]; | |
| 423 | 421 | if( zBr==0 ) zBr = "trunk"; |
| 424 | 422 | if( uBg ){ |
| 425 | 423 | zBgClr = hash_color(zUser); |
| 426 | 424 | }else if( brBg || zBgClr==0 || zBgClr[0]==0 ){ |
| 427 | 425 | zBgClr = strcmp(zBr,"trunk")==0 ? "" : hash_color(zBr); |
| @@ -442,12 +440,10 @@ | ||
| 442 | 440 | if( zBgClr && zBgClr[0] ){ |
| 443 | 441 | @ <td class="timelineTableCell" style="background-color: %h(zBgClr);"> |
| 444 | 442 | }else{ |
| 445 | 443 | @ <td class="timelineTableCell"> |
| 446 | 444 | } |
| 447 | - sqlite3_snprintf(sizeof(zShort), zShort, "%.10s", zUuid); | |
| 448 | - sqlite3_snprintf(sizeof(zShortCkin), zShortCkin, "%.10s", zCkin); | |
| 449 | 445 | if( zUuid ){ |
| 450 | 446 | if( fpid==0 ){ |
| 451 | 447 | @ <b>Added</b> |
| 452 | 448 | }else if( pfnid ){ |
| 453 | 449 | char *zPrevName = db_text(0, "SELECT name FROM filename WHERE fnid=%d", |
| @@ -470,23 +466,23 @@ | ||
| 470 | 466 | fossil_free(zNewName); |
| 471 | 467 | }else{ |
| 472 | 468 | @ <b>Deleted</b> by check-in |
| 473 | 469 | } |
| 474 | 470 | } |
| 475 | - hyperlink_to_uuid(zShortCkin); | |
| 471 | + hyperlink_to_uuid(zCkin); | |
| 476 | 472 | @ %w(zCom) (user: |
| 477 | 473 | hyperlink_to_user(zUser, zDate, ""); |
| 478 | 474 | @ branch: %h(zBr)) |
| 479 | 475 | if( g.perm.Hyperlink && zUuid ){ |
| 480 | 476 | const char *z = zFilename; |
| 481 | - @ %z(href("%R/annotate?checkin=%S&filename=%h",zCkin,z)) | |
| 477 | + @ %z(href("%R/annotate?filename=%h&checkin=%s",z,zCkin)) | |
| 482 | 478 | @ [annotate]</a> |
| 483 | - @ %z(href("%R/blame?checkin=%S&filename=%h",zCkin,z)) | |
| 479 | + @ %z(href("%R/blame?filename=%h&checkin=%s",z,zCkin)) | |
| 484 | 480 | @ [blame]</a> |
| 485 | - @ %z(href("%R/timeline?n=200&uf=%S",zUuid))[checkins using]</a> | |
| 481 | + @ %z(href("%R/timeline?n=200&uf=%s",zUuid))[checkins using]</a> | |
| 486 | 482 | if( fpid ){ |
| 487 | - @ %z(href("%R/fdiff?v1=%S&v2=%S&sbs=1",zPUuid,zUuid))[diff]</a> | |
| 483 | + @ %z(href("%R/fdiff?sbs=1&v1=%s&v2=%s",zPUuid,zUuid))[diff]</a> | |
| 488 | 484 | } |
| 489 | 485 | } |
| 490 | 486 | if( fDebug & FINFO_DEBUG_MLINK ){ |
| 491 | 487 | int srcid = db_int(0, "SELECT srcid FROM delta WHERE rid=%d", frid); |
| 492 | 488 | int sz = db_int(0, "SELECT length(content) FROM blob WHERE rid=%d", frid); |
| 493 | 489 |
| --- src/finfo.c | |
| +++ src/finfo.c | |
| @@ -386,11 +386,11 @@ | |
| 386 | } |
| 387 | blob_reset(&sql); |
| 388 | blob_zero(&title); |
| 389 | if( baseCheckin ){ |
| 390 | char *zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", baseCheckin); |
| 391 | char *zLink = href("%R/info/%S", zUuid); |
| 392 | blob_appendf(&title, "Ancestors of file "); |
| 393 | hyperlinked_path(zFilename, &title, zUuid, "tree", ""); |
| 394 | blob_appendf(&title, " from check-in %z%.10s</a>", zLink, zUuid); |
| 395 | fossil_free(zUuid); |
| 396 | }else{ |
| @@ -416,12 +416,10 @@ | |
| 416 | const char *zBr = db_column_text(&q, 9); |
| 417 | int fmid = db_column_int(&q, 10); |
| 418 | int pfnid = db_column_int(&q, 11); |
| 419 | int gidx; |
| 420 | char zTime[10]; |
| 421 | char zShort[20]; |
| 422 | char zShortCkin[20]; |
| 423 | if( zBr==0 ) zBr = "trunk"; |
| 424 | if( uBg ){ |
| 425 | zBgClr = hash_color(zUser); |
| 426 | }else if( brBg || zBgClr==0 || zBgClr[0]==0 ){ |
| 427 | zBgClr = strcmp(zBr,"trunk")==0 ? "" : hash_color(zBr); |
| @@ -442,12 +440,10 @@ | |
| 442 | if( zBgClr && zBgClr[0] ){ |
| 443 | @ <td class="timelineTableCell" style="background-color: %h(zBgClr);"> |
| 444 | }else{ |
| 445 | @ <td class="timelineTableCell"> |
| 446 | } |
| 447 | sqlite3_snprintf(sizeof(zShort), zShort, "%.10s", zUuid); |
| 448 | sqlite3_snprintf(sizeof(zShortCkin), zShortCkin, "%.10s", zCkin); |
| 449 | if( zUuid ){ |
| 450 | if( fpid==0 ){ |
| 451 | @ <b>Added</b> |
| 452 | }else if( pfnid ){ |
| 453 | char *zPrevName = db_text(0, "SELECT name FROM filename WHERE fnid=%d", |
| @@ -470,23 +466,23 @@ | |
| 470 | fossil_free(zNewName); |
| 471 | }else{ |
| 472 | @ <b>Deleted</b> by check-in |
| 473 | } |
| 474 | } |
| 475 | hyperlink_to_uuid(zShortCkin); |
| 476 | @ %w(zCom) (user: |
| 477 | hyperlink_to_user(zUser, zDate, ""); |
| 478 | @ branch: %h(zBr)) |
| 479 | if( g.perm.Hyperlink && zUuid ){ |
| 480 | const char *z = zFilename; |
| 481 | @ %z(href("%R/annotate?checkin=%S&filename=%h",zCkin,z)) |
| 482 | @ [annotate]</a> |
| 483 | @ %z(href("%R/blame?checkin=%S&filename=%h",zCkin,z)) |
| 484 | @ [blame]</a> |
| 485 | @ %z(href("%R/timeline?n=200&uf=%S",zUuid))[checkins using]</a> |
| 486 | if( fpid ){ |
| 487 | @ %z(href("%R/fdiff?v1=%S&v2=%S&sbs=1",zPUuid,zUuid))[diff]</a> |
| 488 | } |
| 489 | } |
| 490 | if( fDebug & FINFO_DEBUG_MLINK ){ |
| 491 | int srcid = db_int(0, "SELECT srcid FROM delta WHERE rid=%d", frid); |
| 492 | int sz = db_int(0, "SELECT length(content) FROM blob WHERE rid=%d", frid); |
| 493 |
| --- src/finfo.c | |
| +++ src/finfo.c | |
| @@ -386,11 +386,11 @@ | |
| 386 | } |
| 387 | blob_reset(&sql); |
| 388 | blob_zero(&title); |
| 389 | if( baseCheckin ){ |
| 390 | char *zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", baseCheckin); |
| 391 | char *zLink = href("%R/info/%s", zUuid); |
| 392 | blob_appendf(&title, "Ancestors of file "); |
| 393 | hyperlinked_path(zFilename, &title, zUuid, "tree", ""); |
| 394 | blob_appendf(&title, " from check-in %z%.10s</a>", zLink, zUuid); |
| 395 | fossil_free(zUuid); |
| 396 | }else{ |
| @@ -416,12 +416,10 @@ | |
| 416 | const char *zBr = db_column_text(&q, 9); |
| 417 | int fmid = db_column_int(&q, 10); |
| 418 | int pfnid = db_column_int(&q, 11); |
| 419 | int gidx; |
| 420 | char zTime[10]; |
| 421 | if( zBr==0 ) zBr = "trunk"; |
| 422 | if( uBg ){ |
| 423 | zBgClr = hash_color(zUser); |
| 424 | }else if( brBg || zBgClr==0 || zBgClr[0]==0 ){ |
| 425 | zBgClr = strcmp(zBr,"trunk")==0 ? "" : hash_color(zBr); |
| @@ -442,12 +440,10 @@ | |
| 440 | if( zBgClr && zBgClr[0] ){ |
| 441 | @ <td class="timelineTableCell" style="background-color: %h(zBgClr);"> |
| 442 | }else{ |
| 443 | @ <td class="timelineTableCell"> |
| 444 | } |
| 445 | if( zUuid ){ |
| 446 | if( fpid==0 ){ |
| 447 | @ <b>Added</b> |
| 448 | }else if( pfnid ){ |
| 449 | char *zPrevName = db_text(0, "SELECT name FROM filename WHERE fnid=%d", |
| @@ -470,23 +466,23 @@ | |
| 466 | fossil_free(zNewName); |
| 467 | }else{ |
| 468 | @ <b>Deleted</b> by check-in |
| 469 | } |
| 470 | } |
| 471 | hyperlink_to_uuid(zCkin); |
| 472 | @ %w(zCom) (user: |
| 473 | hyperlink_to_user(zUser, zDate, ""); |
| 474 | @ branch: %h(zBr)) |
| 475 | if( g.perm.Hyperlink && zUuid ){ |
| 476 | const char *z = zFilename; |
| 477 | @ %z(href("%R/annotate?filename=%h&checkin=%s",z,zCkin)) |
| 478 | @ [annotate]</a> |
| 479 | @ %z(href("%R/blame?filename=%h&checkin=%s",z,zCkin)) |
| 480 | @ [blame]</a> |
| 481 | @ %z(href("%R/timeline?n=200&uf=%s",zUuid))[checkins using]</a> |
| 482 | if( fpid ){ |
| 483 | @ %z(href("%R/fdiff?sbs=1&v1=%s&v2=%s",zPUuid,zUuid))[diff]</a> |
| 484 | } |
| 485 | } |
| 486 | if( fDebug & FINFO_DEBUG_MLINK ){ |
| 487 | int srcid = db_int(0, "SELECT srcid FROM delta WHERE rid=%d", frid); |
| 488 | int sz = db_int(0, "SELECT length(content) FROM blob WHERE rid=%d", frid); |
| 489 |
+31
-31
| --- src/http.c | ||
| +++ src/http.c | ||
| @@ -55,31 +55,31 @@ | ||
| 55 | 55 | const char *zPw; /* The user password */ |
| 56 | 56 | Blob pw; /* The nonce with user password appended */ |
| 57 | 57 | Blob sig; /* The signature field */ |
| 58 | 58 | |
| 59 | 59 | blob_zero(pLogin); |
| 60 | - if( g.urlUser==0 || fossil_strcmp(g.urlUser, "anonymous")==0 ){ | |
| 60 | + if( g.url.user==0 || fossil_strcmp(g.url.user, "anonymous")==0 ){ | |
| 61 | 61 | return; /* If no login card for users "nobody" and "anonymous" */ |
| 62 | 62 | } |
| 63 | - if( g.urlIsSsh ){ | |
| 63 | + if( g.url.isSsh ){ | |
| 64 | 64 | return; /* If no login card for SSH: */ |
| 65 | 65 | } |
| 66 | 66 | blob_zero(&nonce); |
| 67 | 67 | blob_zero(&pw); |
| 68 | 68 | sha1sum_blob(pPayload, &nonce); |
| 69 | 69 | blob_copy(&pw, &nonce); |
| 70 | - zLogin = g.urlUser; | |
| 71 | - if( g.urlPasswd ){ | |
| 72 | - zPw = g.urlPasswd; | |
| 70 | + zLogin = g.url.user; | |
| 71 | + if( g.url.passwd ){ | |
| 72 | + zPw = g.url.passwd; | |
| 73 | 73 | }else if( g.cgiOutput ){ |
| 74 | 74 | /* Password failure while doing a sync from the web interface */ |
| 75 | 75 | cgi_printf("*** incorrect or missing password for user %h\n", zLogin); |
| 76 | 76 | zPw = 0; |
| 77 | 77 | }else{ |
| 78 | 78 | /* Password failure while doing a sync from the command-line interface */ |
| 79 | 79 | url_prompt_for_password(); |
| 80 | - zPw = g.urlPasswd; | |
| 80 | + zPw = g.url.passwd; | |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | /* The login card wants the SHA1 hash of the password, so convert the |
| 84 | 84 | ** password to its SHA1 hash it it isn't already a SHA1 hash. |
| 85 | 85 | */ |
| @@ -102,29 +102,29 @@ | ||
| 102 | 102 | static void http_build_header(Blob *pPayload, Blob *pHdr){ |
| 103 | 103 | int i; |
| 104 | 104 | const char *zSep; |
| 105 | 105 | |
| 106 | 106 | blob_zero(pHdr); |
| 107 | - i = strlen(g.urlPath); | |
| 108 | - if( i>0 && g.urlPath[i-1]=='/' ){ | |
| 107 | + i = strlen(g.url.path); | |
| 108 | + if( i>0 && g.url.path[i-1]=='/' ){ | |
| 109 | 109 | zSep = ""; |
| 110 | 110 | }else{ |
| 111 | 111 | zSep = "/"; |
| 112 | 112 | } |
| 113 | - blob_appendf(pHdr, "POST %s%sxfer/xfer HTTP/1.0\r\n", g.urlPath, zSep); | |
| 114 | - if( g.urlProxyAuth ){ | |
| 115 | - blob_appendf(pHdr, "Proxy-Authorization: %s\r\n", g.urlProxyAuth); | |
| 113 | + blob_appendf(pHdr, "POST %s%sxfer/xfer HTTP/1.0\r\n", g.url.path, zSep); | |
| 114 | + if( g.url.proxyAuth ){ | |
| 115 | + blob_appendf(pHdr, "Proxy-Authorization: %s\r\n", g.url.proxyAuth); | |
| 116 | 116 | } |
| 117 | 117 | if( g.zHttpAuth && g.zHttpAuth[0] ){ |
| 118 | 118 | const char *zCredentials = g.zHttpAuth; |
| 119 | 119 | char *zEncoded = encode64(zCredentials, -1); |
| 120 | 120 | blob_appendf(pHdr, "Authorization: Basic %s\r\n", zEncoded); |
| 121 | 121 | fossil_free(zEncoded); |
| 122 | 122 | } |
| 123 | - blob_appendf(pHdr, "Host: %s\r\n", g.urlHostname); | |
| 123 | + blob_appendf(pHdr, "Host: %s\r\n", g.url.hostname); | |
| 124 | 124 | blob_appendf(pHdr, "User-Agent: %s\r\n", get_user_agent()); |
| 125 | - if( g.urlIsSsh ) blob_appendf(pHdr, "X-Fossil-Transport: SSH\r\n"); | |
| 125 | + if( g.url.isSsh ) blob_appendf(pHdr, "X-Fossil-Transport: SSH\r\n"); | |
| 126 | 126 | if( g.fHttpTrace ){ |
| 127 | 127 | blob_appendf(pHdr, "Content-Type: application/x-fossil-debug\r\n"); |
| 128 | 128 | }else{ |
| 129 | 129 | blob_appendf(pHdr, "Content-Type: application/x-fossil\r\n"); |
| 130 | 130 | } |
| @@ -147,11 +147,11 @@ | ||
| 147 | 147 | ** Prompt to save HTTP Basic Authorization information |
| 148 | 148 | */ |
| 149 | 149 | static int save_httpauth_prompt(void){ |
| 150 | 150 | Blob x; |
| 151 | 151 | char c; |
| 152 | - if( (g.urlFlags & URL_REMEMBER)==0 ) return 0; | |
| 152 | + if( (g.url.flags & URL_REMEMBER)==0 ) return 0; | |
| 153 | 153 | prompt_user("Remember Basic Authorization credentials (Y/n)? ", &x); |
| 154 | 154 | c = blob_str(&x)[0]; |
| 155 | 155 | blob_reset(&x); |
| 156 | 156 | return ( c!='n' && c!='N' ); |
| 157 | 157 | } |
| @@ -166,15 +166,15 @@ | ||
| 166 | 166 | char *zPw; |
| 167 | 167 | char *zPrompt; |
| 168 | 168 | char *zHttpAuth = 0; |
| 169 | 169 | if( !isatty(fileno(stdin)) ) return 0; |
| 170 | 170 | zPrompt = mprintf("\n%s authorization required by\n%s\n", |
| 171 | - g.urlIsHttps==1 ? "Encrypted HTTPS" : "Unencrypted HTTP", g.urlCanonical); | |
| 171 | + g.url.isHttps==1 ? "Encrypted HTTPS" : "Unencrypted HTTP", g.url.canonical); | |
| 172 | 172 | fossil_print(zPrompt); |
| 173 | 173 | free(zPrompt); |
| 174 | - if ( g.urlUser && g.urlPasswd && use_fossil_creds_for_httpauth_prompt() ){ | |
| 175 | - zHttpAuth = mprintf("%s:%s", g.urlUser, g.urlPasswd); | |
| 174 | + if ( g.url.user && g.url.passwd && use_fossil_creds_for_httpauth_prompt() ){ | |
| 175 | + zHttpAuth = mprintf("%s:%s", g.url.user, g.url.passwd); | |
| 176 | 176 | }else{ |
| 177 | 177 | prompt_user("Basic Authorization user: ", &x); |
| 178 | 178 | zUser = mprintf("%b", &x); |
| 179 | 179 | zPrompt = mprintf("HTTP password for %b: ", &x); |
| 180 | 180 | blob_reset(&x); |
| @@ -213,12 +213,12 @@ | ||
| 213 | 213 | char *zLine; /* A single line of the reply header */ |
| 214 | 214 | int i; /* Loop counter */ |
| 215 | 215 | int isError = 0; /* True if the reply is an error message */ |
| 216 | 216 | int isCompressed = 1; /* True if the reply is compressed */ |
| 217 | 217 | |
| 218 | - if( transport_open(GLOBAL_URL()) ){ | |
| 219 | - fossil_warning(transport_errmsg(GLOBAL_URL())); | |
| 218 | + if( transport_open(&g.url) ){ | |
| 219 | + fossil_warning(transport_errmsg(&g.url)); | |
| 220 | 220 | return 1; |
| 221 | 221 | } |
| 222 | 222 | |
| 223 | 223 | /* Construct the login card and prepare the complete payload */ |
| 224 | 224 | blob_zero(&login); |
| @@ -260,32 +260,32 @@ | ||
| 260 | 260 | } |
| 261 | 261 | |
| 262 | 262 | /* |
| 263 | 263 | ** Send the request to the server. |
| 264 | 264 | */ |
| 265 | - transport_send(GLOBAL_URL(), &hdr); | |
| 266 | - transport_send(GLOBAL_URL(), &payload); | |
| 265 | + transport_send(&g.url, &hdr); | |
| 266 | + transport_send(&g.url, &payload); | |
| 267 | 267 | blob_reset(&hdr); |
| 268 | 268 | blob_reset(&payload); |
| 269 | - transport_flip(GLOBAL_URL()); | |
| 269 | + transport_flip(&g.url); | |
| 270 | 270 | |
| 271 | 271 | /* |
| 272 | 272 | ** Read and interpret the server reply |
| 273 | 273 | */ |
| 274 | 274 | closeConnection = 1; |
| 275 | 275 | iLength = -1; |
| 276 | - while( (zLine = transport_receive_line(GLOBAL_URL()))!=0 && zLine[0]!=0 ){ | |
| 276 | + while( (zLine = transport_receive_line(&g.url))!=0 && zLine[0]!=0 ){ | |
| 277 | 277 | /* printf("[%s]\n", zLine); fflush(stdout); */ |
| 278 | 278 | if( fossil_strnicmp(zLine, "http/1.", 7)==0 ){ |
| 279 | 279 | if( sscanf(zLine, "HTTP/1.%d %d", &iHttpVersion, &rc)!=2 ) goto write_err; |
| 280 | 280 | if( rc==401 ){ |
| 281 | 281 | if( fSeenHttpAuth++ < MAX_HTTP_AUTH ){ |
| 282 | 282 | if( g.zHttpAuth ){ |
| 283 | 283 | if( g.zHttpAuth ) free(g.zHttpAuth); |
| 284 | 284 | } |
| 285 | 285 | g.zHttpAuth = prompt_for_httpauth_creds(); |
| 286 | - transport_close(GLOBAL_URL()); | |
| 286 | + transport_close(&g.url); | |
| 287 | 287 | return http_exchange(pSend, pReply, useLogin, maxRedirect); |
| 288 | 288 | } |
| 289 | 289 | } |
| 290 | 290 | if( rc!=200 && rc!=302 ){ |
| 291 | 291 | int ii; |
| @@ -297,11 +297,11 @@ | ||
| 297 | 297 | if( iHttpVersion==0 ){ |
| 298 | 298 | closeConnection = 1; |
| 299 | 299 | }else{ |
| 300 | 300 | closeConnection = 0; |
| 301 | 301 | } |
| 302 | - }else if( g.urlIsSsh && fossil_strnicmp(zLine, "status:", 7)==0 ){ | |
| 302 | + }else if( g.url.isSsh && fossil_strnicmp(zLine, "status:", 7)==0 ){ | |
| 303 | 303 | if( sscanf(zLine, "Status: %d", &rc)!=1 ) goto write_err; |
| 304 | 304 | if( rc!=200 && rc!=302 ){ |
| 305 | 305 | int ii; |
| 306 | 306 | for(ii=7; zLine[ii] && zLine[ii]!=' '; ii++){} |
| 307 | 307 | while( zLine[ii]==' ' ) ii++; |
| @@ -337,11 +337,11 @@ | ||
| 337 | 337 | fossil_print("redirect to %s\n", &zLine[i]); |
| 338 | 338 | url_parse(&zLine[i], 0); |
| 339 | 339 | fSeenHttpAuth = 0; |
| 340 | 340 | if( g.zHttpAuth ) free(g.zHttpAuth); |
| 341 | 341 | g.zHttpAuth = get_httpauth(); |
| 342 | - transport_close(GLOBAL_URL()); | |
| 342 | + transport_close(&g.url); | |
| 343 | 343 | return http_exchange(pSend, pReply, useLogin, maxRedirect); |
| 344 | 344 | }else if( fossil_strnicmp(zLine, "content-type: ", 14)==0 ){ |
| 345 | 345 | if( fossil_strnicmp(&zLine[14], "application/x-fossil-debug", -1)==0 ){ |
| 346 | 346 | isCompressed = 0; |
| 347 | 347 | }else if( fossil_strnicmp(&zLine[14], |
| @@ -364,11 +364,11 @@ | ||
| 364 | 364 | /* |
| 365 | 365 | ** Extract the reply payload that follows the header |
| 366 | 366 | */ |
| 367 | 367 | blob_zero(pReply); |
| 368 | 368 | blob_resize(pReply, iLength); |
| 369 | - iLength = transport_receive(GLOBAL_URL(), blob_buffer(pReply), iLength); | |
| 369 | + iLength = transport_receive(&g.url, blob_buffer(pReply), iLength); | |
| 370 | 370 | blob_resize(pReply, iLength); |
| 371 | 371 | if( isError ){ |
| 372 | 372 | char *z; |
| 373 | 373 | int i, j; |
| 374 | 374 | z = blob_str(pReply); |
| @@ -391,20 +391,20 @@ | ||
| 391 | 391 | ** connection from remaining open. The easiest fix for now is to |
| 392 | 392 | ** simply close and restart the connection for each round-trip. |
| 393 | 393 | ** |
| 394 | 394 | ** For SSH we will leave the connection open. |
| 395 | 395 | */ |
| 396 | - if( ! g.urlIsSsh ) closeConnection = 1; /* FIX ME */ | |
| 396 | + if( ! g.url.isSsh ) closeConnection = 1; /* FIX ME */ | |
| 397 | 397 | if( closeConnection ){ |
| 398 | - transport_close(GLOBAL_URL()); | |
| 398 | + transport_close(&g.url); | |
| 399 | 399 | }else{ |
| 400 | - transport_rewind(GLOBAL_URL()); | |
| 400 | + transport_rewind(&g.url); | |
| 401 | 401 | } |
| 402 | 402 | return 0; |
| 403 | 403 | |
| 404 | 404 | /* |
| 405 | 405 | ** Jump to here if an error is seen. |
| 406 | 406 | */ |
| 407 | 407 | write_err: |
| 408 | - transport_close(GLOBAL_URL()); | |
| 408 | + transport_close(&g.url); | |
| 409 | 409 | return 1; |
| 410 | 410 | } |
| 411 | 411 |
| --- src/http.c | |
| +++ src/http.c | |
| @@ -55,31 +55,31 @@ | |
| 55 | const char *zPw; /* The user password */ |
| 56 | Blob pw; /* The nonce with user password appended */ |
| 57 | Blob sig; /* The signature field */ |
| 58 | |
| 59 | blob_zero(pLogin); |
| 60 | if( g.urlUser==0 || fossil_strcmp(g.urlUser, "anonymous")==0 ){ |
| 61 | return; /* If no login card for users "nobody" and "anonymous" */ |
| 62 | } |
| 63 | if( g.urlIsSsh ){ |
| 64 | return; /* If no login card for SSH: */ |
| 65 | } |
| 66 | blob_zero(&nonce); |
| 67 | blob_zero(&pw); |
| 68 | sha1sum_blob(pPayload, &nonce); |
| 69 | blob_copy(&pw, &nonce); |
| 70 | zLogin = g.urlUser; |
| 71 | if( g.urlPasswd ){ |
| 72 | zPw = g.urlPasswd; |
| 73 | }else if( g.cgiOutput ){ |
| 74 | /* Password failure while doing a sync from the web interface */ |
| 75 | cgi_printf("*** incorrect or missing password for user %h\n", zLogin); |
| 76 | zPw = 0; |
| 77 | }else{ |
| 78 | /* Password failure while doing a sync from the command-line interface */ |
| 79 | url_prompt_for_password(); |
| 80 | zPw = g.urlPasswd; |
| 81 | } |
| 82 | |
| 83 | /* The login card wants the SHA1 hash of the password, so convert the |
| 84 | ** password to its SHA1 hash it it isn't already a SHA1 hash. |
| 85 | */ |
| @@ -102,29 +102,29 @@ | |
| 102 | static void http_build_header(Blob *pPayload, Blob *pHdr){ |
| 103 | int i; |
| 104 | const char *zSep; |
| 105 | |
| 106 | blob_zero(pHdr); |
| 107 | i = strlen(g.urlPath); |
| 108 | if( i>0 && g.urlPath[i-1]=='/' ){ |
| 109 | zSep = ""; |
| 110 | }else{ |
| 111 | zSep = "/"; |
| 112 | } |
| 113 | blob_appendf(pHdr, "POST %s%sxfer/xfer HTTP/1.0\r\n", g.urlPath, zSep); |
| 114 | if( g.urlProxyAuth ){ |
| 115 | blob_appendf(pHdr, "Proxy-Authorization: %s\r\n", g.urlProxyAuth); |
| 116 | } |
| 117 | if( g.zHttpAuth && g.zHttpAuth[0] ){ |
| 118 | const char *zCredentials = g.zHttpAuth; |
| 119 | char *zEncoded = encode64(zCredentials, -1); |
| 120 | blob_appendf(pHdr, "Authorization: Basic %s\r\n", zEncoded); |
| 121 | fossil_free(zEncoded); |
| 122 | } |
| 123 | blob_appendf(pHdr, "Host: %s\r\n", g.urlHostname); |
| 124 | blob_appendf(pHdr, "User-Agent: %s\r\n", get_user_agent()); |
| 125 | if( g.urlIsSsh ) blob_appendf(pHdr, "X-Fossil-Transport: SSH\r\n"); |
| 126 | if( g.fHttpTrace ){ |
| 127 | blob_appendf(pHdr, "Content-Type: application/x-fossil-debug\r\n"); |
| 128 | }else{ |
| 129 | blob_appendf(pHdr, "Content-Type: application/x-fossil\r\n"); |
| 130 | } |
| @@ -147,11 +147,11 @@ | |
| 147 | ** Prompt to save HTTP Basic Authorization information |
| 148 | */ |
| 149 | static int save_httpauth_prompt(void){ |
| 150 | Blob x; |
| 151 | char c; |
| 152 | if( (g.urlFlags & URL_REMEMBER)==0 ) return 0; |
| 153 | prompt_user("Remember Basic Authorization credentials (Y/n)? ", &x); |
| 154 | c = blob_str(&x)[0]; |
| 155 | blob_reset(&x); |
| 156 | return ( c!='n' && c!='N' ); |
| 157 | } |
| @@ -166,15 +166,15 @@ | |
| 166 | char *zPw; |
| 167 | char *zPrompt; |
| 168 | char *zHttpAuth = 0; |
| 169 | if( !isatty(fileno(stdin)) ) return 0; |
| 170 | zPrompt = mprintf("\n%s authorization required by\n%s\n", |
| 171 | g.urlIsHttps==1 ? "Encrypted HTTPS" : "Unencrypted HTTP", g.urlCanonical); |
| 172 | fossil_print(zPrompt); |
| 173 | free(zPrompt); |
| 174 | if ( g.urlUser && g.urlPasswd && use_fossil_creds_for_httpauth_prompt() ){ |
| 175 | zHttpAuth = mprintf("%s:%s", g.urlUser, g.urlPasswd); |
| 176 | }else{ |
| 177 | prompt_user("Basic Authorization user: ", &x); |
| 178 | zUser = mprintf("%b", &x); |
| 179 | zPrompt = mprintf("HTTP password for %b: ", &x); |
| 180 | blob_reset(&x); |
| @@ -213,12 +213,12 @@ | |
| 213 | char *zLine; /* A single line of the reply header */ |
| 214 | int i; /* Loop counter */ |
| 215 | int isError = 0; /* True if the reply is an error message */ |
| 216 | int isCompressed = 1; /* True if the reply is compressed */ |
| 217 | |
| 218 | if( transport_open(GLOBAL_URL()) ){ |
| 219 | fossil_warning(transport_errmsg(GLOBAL_URL())); |
| 220 | return 1; |
| 221 | } |
| 222 | |
| 223 | /* Construct the login card and prepare the complete payload */ |
| 224 | blob_zero(&login); |
| @@ -260,32 +260,32 @@ | |
| 260 | } |
| 261 | |
| 262 | /* |
| 263 | ** Send the request to the server. |
| 264 | */ |
| 265 | transport_send(GLOBAL_URL(), &hdr); |
| 266 | transport_send(GLOBAL_URL(), &payload); |
| 267 | blob_reset(&hdr); |
| 268 | blob_reset(&payload); |
| 269 | transport_flip(GLOBAL_URL()); |
| 270 | |
| 271 | /* |
| 272 | ** Read and interpret the server reply |
| 273 | */ |
| 274 | closeConnection = 1; |
| 275 | iLength = -1; |
| 276 | while( (zLine = transport_receive_line(GLOBAL_URL()))!=0 && zLine[0]!=0 ){ |
| 277 | /* printf("[%s]\n", zLine); fflush(stdout); */ |
| 278 | if( fossil_strnicmp(zLine, "http/1.", 7)==0 ){ |
| 279 | if( sscanf(zLine, "HTTP/1.%d %d", &iHttpVersion, &rc)!=2 ) goto write_err; |
| 280 | if( rc==401 ){ |
| 281 | if( fSeenHttpAuth++ < MAX_HTTP_AUTH ){ |
| 282 | if( g.zHttpAuth ){ |
| 283 | if( g.zHttpAuth ) free(g.zHttpAuth); |
| 284 | } |
| 285 | g.zHttpAuth = prompt_for_httpauth_creds(); |
| 286 | transport_close(GLOBAL_URL()); |
| 287 | return http_exchange(pSend, pReply, useLogin, maxRedirect); |
| 288 | } |
| 289 | } |
| 290 | if( rc!=200 && rc!=302 ){ |
| 291 | int ii; |
| @@ -297,11 +297,11 @@ | |
| 297 | if( iHttpVersion==0 ){ |
| 298 | closeConnection = 1; |
| 299 | }else{ |
| 300 | closeConnection = 0; |
| 301 | } |
| 302 | }else if( g.urlIsSsh && fossil_strnicmp(zLine, "status:", 7)==0 ){ |
| 303 | if( sscanf(zLine, "Status: %d", &rc)!=1 ) goto write_err; |
| 304 | if( rc!=200 && rc!=302 ){ |
| 305 | int ii; |
| 306 | for(ii=7; zLine[ii] && zLine[ii]!=' '; ii++){} |
| 307 | while( zLine[ii]==' ' ) ii++; |
| @@ -337,11 +337,11 @@ | |
| 337 | fossil_print("redirect to %s\n", &zLine[i]); |
| 338 | url_parse(&zLine[i], 0); |
| 339 | fSeenHttpAuth = 0; |
| 340 | if( g.zHttpAuth ) free(g.zHttpAuth); |
| 341 | g.zHttpAuth = get_httpauth(); |
| 342 | transport_close(GLOBAL_URL()); |
| 343 | return http_exchange(pSend, pReply, useLogin, maxRedirect); |
| 344 | }else if( fossil_strnicmp(zLine, "content-type: ", 14)==0 ){ |
| 345 | if( fossil_strnicmp(&zLine[14], "application/x-fossil-debug", -1)==0 ){ |
| 346 | isCompressed = 0; |
| 347 | }else if( fossil_strnicmp(&zLine[14], |
| @@ -364,11 +364,11 @@ | |
| 364 | /* |
| 365 | ** Extract the reply payload that follows the header |
| 366 | */ |
| 367 | blob_zero(pReply); |
| 368 | blob_resize(pReply, iLength); |
| 369 | iLength = transport_receive(GLOBAL_URL(), blob_buffer(pReply), iLength); |
| 370 | blob_resize(pReply, iLength); |
| 371 | if( isError ){ |
| 372 | char *z; |
| 373 | int i, j; |
| 374 | z = blob_str(pReply); |
| @@ -391,20 +391,20 @@ | |
| 391 | ** connection from remaining open. The easiest fix for now is to |
| 392 | ** simply close and restart the connection for each round-trip. |
| 393 | ** |
| 394 | ** For SSH we will leave the connection open. |
| 395 | */ |
| 396 | if( ! g.urlIsSsh ) closeConnection = 1; /* FIX ME */ |
| 397 | if( closeConnection ){ |
| 398 | transport_close(GLOBAL_URL()); |
| 399 | }else{ |
| 400 | transport_rewind(GLOBAL_URL()); |
| 401 | } |
| 402 | return 0; |
| 403 | |
| 404 | /* |
| 405 | ** Jump to here if an error is seen. |
| 406 | */ |
| 407 | write_err: |
| 408 | transport_close(GLOBAL_URL()); |
| 409 | return 1; |
| 410 | } |
| 411 |
| --- src/http.c | |
| +++ src/http.c | |
| @@ -55,31 +55,31 @@ | |
| 55 | const char *zPw; /* The user password */ |
| 56 | Blob pw; /* The nonce with user password appended */ |
| 57 | Blob sig; /* The signature field */ |
| 58 | |
| 59 | blob_zero(pLogin); |
| 60 | if( g.url.user==0 || fossil_strcmp(g.url.user, "anonymous")==0 ){ |
| 61 | return; /* If no login card for users "nobody" and "anonymous" */ |
| 62 | } |
| 63 | if( g.url.isSsh ){ |
| 64 | return; /* If no login card for SSH: */ |
| 65 | } |
| 66 | blob_zero(&nonce); |
| 67 | blob_zero(&pw); |
| 68 | sha1sum_blob(pPayload, &nonce); |
| 69 | blob_copy(&pw, &nonce); |
| 70 | zLogin = g.url.user; |
| 71 | if( g.url.passwd ){ |
| 72 | zPw = g.url.passwd; |
| 73 | }else if( g.cgiOutput ){ |
| 74 | /* Password failure while doing a sync from the web interface */ |
| 75 | cgi_printf("*** incorrect or missing password for user %h\n", zLogin); |
| 76 | zPw = 0; |
| 77 | }else{ |
| 78 | /* Password failure while doing a sync from the command-line interface */ |
| 79 | url_prompt_for_password(); |
| 80 | zPw = g.url.passwd; |
| 81 | } |
| 82 | |
| 83 | /* The login card wants the SHA1 hash of the password, so convert the |
| 84 | ** password to its SHA1 hash it it isn't already a SHA1 hash. |
| 85 | */ |
| @@ -102,29 +102,29 @@ | |
| 102 | static void http_build_header(Blob *pPayload, Blob *pHdr){ |
| 103 | int i; |
| 104 | const char *zSep; |
| 105 | |
| 106 | blob_zero(pHdr); |
| 107 | i = strlen(g.url.path); |
| 108 | if( i>0 && g.url.path[i-1]=='/' ){ |
| 109 | zSep = ""; |
| 110 | }else{ |
| 111 | zSep = "/"; |
| 112 | } |
| 113 | blob_appendf(pHdr, "POST %s%sxfer/xfer HTTP/1.0\r\n", g.url.path, zSep); |
| 114 | if( g.url.proxyAuth ){ |
| 115 | blob_appendf(pHdr, "Proxy-Authorization: %s\r\n", g.url.proxyAuth); |
| 116 | } |
| 117 | if( g.zHttpAuth && g.zHttpAuth[0] ){ |
| 118 | const char *zCredentials = g.zHttpAuth; |
| 119 | char *zEncoded = encode64(zCredentials, -1); |
| 120 | blob_appendf(pHdr, "Authorization: Basic %s\r\n", zEncoded); |
| 121 | fossil_free(zEncoded); |
| 122 | } |
| 123 | blob_appendf(pHdr, "Host: %s\r\n", g.url.hostname); |
| 124 | blob_appendf(pHdr, "User-Agent: %s\r\n", get_user_agent()); |
| 125 | if( g.url.isSsh ) blob_appendf(pHdr, "X-Fossil-Transport: SSH\r\n"); |
| 126 | if( g.fHttpTrace ){ |
| 127 | blob_appendf(pHdr, "Content-Type: application/x-fossil-debug\r\n"); |
| 128 | }else{ |
| 129 | blob_appendf(pHdr, "Content-Type: application/x-fossil\r\n"); |
| 130 | } |
| @@ -147,11 +147,11 @@ | |
| 147 | ** Prompt to save HTTP Basic Authorization information |
| 148 | */ |
| 149 | static int save_httpauth_prompt(void){ |
| 150 | Blob x; |
| 151 | char c; |
| 152 | if( (g.url.flags & URL_REMEMBER)==0 ) return 0; |
| 153 | prompt_user("Remember Basic Authorization credentials (Y/n)? ", &x); |
| 154 | c = blob_str(&x)[0]; |
| 155 | blob_reset(&x); |
| 156 | return ( c!='n' && c!='N' ); |
| 157 | } |
| @@ -166,15 +166,15 @@ | |
| 166 | char *zPw; |
| 167 | char *zPrompt; |
| 168 | char *zHttpAuth = 0; |
| 169 | if( !isatty(fileno(stdin)) ) return 0; |
| 170 | zPrompt = mprintf("\n%s authorization required by\n%s\n", |
| 171 | g.url.isHttps==1 ? "Encrypted HTTPS" : "Unencrypted HTTP", g.url.canonical); |
| 172 | fossil_print(zPrompt); |
| 173 | free(zPrompt); |
| 174 | if ( g.url.user && g.url.passwd && use_fossil_creds_for_httpauth_prompt() ){ |
| 175 | zHttpAuth = mprintf("%s:%s", g.url.user, g.url.passwd); |
| 176 | }else{ |
| 177 | prompt_user("Basic Authorization user: ", &x); |
| 178 | zUser = mprintf("%b", &x); |
| 179 | zPrompt = mprintf("HTTP password for %b: ", &x); |
| 180 | blob_reset(&x); |
| @@ -213,12 +213,12 @@ | |
| 213 | char *zLine; /* A single line of the reply header */ |
| 214 | int i; /* Loop counter */ |
| 215 | int isError = 0; /* True if the reply is an error message */ |
| 216 | int isCompressed = 1; /* True if the reply is compressed */ |
| 217 | |
| 218 | if( transport_open(&g.url) ){ |
| 219 | fossil_warning(transport_errmsg(&g.url)); |
| 220 | return 1; |
| 221 | } |
| 222 | |
| 223 | /* Construct the login card and prepare the complete payload */ |
| 224 | blob_zero(&login); |
| @@ -260,32 +260,32 @@ | |
| 260 | } |
| 261 | |
| 262 | /* |
| 263 | ** Send the request to the server. |
| 264 | */ |
| 265 | transport_send(&g.url, &hdr); |
| 266 | transport_send(&g.url, &payload); |
| 267 | blob_reset(&hdr); |
| 268 | blob_reset(&payload); |
| 269 | transport_flip(&g.url); |
| 270 | |
| 271 | /* |
| 272 | ** Read and interpret the server reply |
| 273 | */ |
| 274 | closeConnection = 1; |
| 275 | iLength = -1; |
| 276 | while( (zLine = transport_receive_line(&g.url))!=0 && zLine[0]!=0 ){ |
| 277 | /* printf("[%s]\n", zLine); fflush(stdout); */ |
| 278 | if( fossil_strnicmp(zLine, "http/1.", 7)==0 ){ |
| 279 | if( sscanf(zLine, "HTTP/1.%d %d", &iHttpVersion, &rc)!=2 ) goto write_err; |
| 280 | if( rc==401 ){ |
| 281 | if( fSeenHttpAuth++ < MAX_HTTP_AUTH ){ |
| 282 | if( g.zHttpAuth ){ |
| 283 | if( g.zHttpAuth ) free(g.zHttpAuth); |
| 284 | } |
| 285 | g.zHttpAuth = prompt_for_httpauth_creds(); |
| 286 | transport_close(&g.url); |
| 287 | return http_exchange(pSend, pReply, useLogin, maxRedirect); |
| 288 | } |
| 289 | } |
| 290 | if( rc!=200 && rc!=302 ){ |
| 291 | int ii; |
| @@ -297,11 +297,11 @@ | |
| 297 | if( iHttpVersion==0 ){ |
| 298 | closeConnection = 1; |
| 299 | }else{ |
| 300 | closeConnection = 0; |
| 301 | } |
| 302 | }else if( g.url.isSsh && fossil_strnicmp(zLine, "status:", 7)==0 ){ |
| 303 | if( sscanf(zLine, "Status: %d", &rc)!=1 ) goto write_err; |
| 304 | if( rc!=200 && rc!=302 ){ |
| 305 | int ii; |
| 306 | for(ii=7; zLine[ii] && zLine[ii]!=' '; ii++){} |
| 307 | while( zLine[ii]==' ' ) ii++; |
| @@ -337,11 +337,11 @@ | |
| 337 | fossil_print("redirect to %s\n", &zLine[i]); |
| 338 | url_parse(&zLine[i], 0); |
| 339 | fSeenHttpAuth = 0; |
| 340 | if( g.zHttpAuth ) free(g.zHttpAuth); |
| 341 | g.zHttpAuth = get_httpauth(); |
| 342 | transport_close(&g.url); |
| 343 | return http_exchange(pSend, pReply, useLogin, maxRedirect); |
| 344 | }else if( fossil_strnicmp(zLine, "content-type: ", 14)==0 ){ |
| 345 | if( fossil_strnicmp(&zLine[14], "application/x-fossil-debug", -1)==0 ){ |
| 346 | isCompressed = 0; |
| 347 | }else if( fossil_strnicmp(&zLine[14], |
| @@ -364,11 +364,11 @@ | |
| 364 | /* |
| 365 | ** Extract the reply payload that follows the header |
| 366 | */ |
| 367 | blob_zero(pReply); |
| 368 | blob_resize(pReply, iLength); |
| 369 | iLength = transport_receive(&g.url, blob_buffer(pReply), iLength); |
| 370 | blob_resize(pReply, iLength); |
| 371 | if( isError ){ |
| 372 | char *z; |
| 373 | int i, j; |
| 374 | z = blob_str(pReply); |
| @@ -391,20 +391,20 @@ | |
| 391 | ** connection from remaining open. The easiest fix for now is to |
| 392 | ** simply close and restart the connection for each round-trip. |
| 393 | ** |
| 394 | ** For SSH we will leave the connection open. |
| 395 | */ |
| 396 | if( ! g.url.isSsh ) closeConnection = 1; /* FIX ME */ |
| 397 | if( closeConnection ){ |
| 398 | transport_close(&g.url); |
| 399 | }else{ |
| 400 | transport_rewind(&g.url); |
| 401 | } |
| 402 | return 0; |
| 403 | |
| 404 | /* |
| 405 | ** Jump to here if an error is seen. |
| 406 | */ |
| 407 | write_err: |
| 408 | transport_close(&g.url); |
| 409 | return 1; |
| 410 | } |
| 411 |
+7
-6
| --- src/http_socket.c | ||
| +++ src/http_socket.c | ||
| @@ -124,14 +124,14 @@ | ||
| 124 | 124 | } |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | /* |
| 128 | 128 | ** Open a socket connection. The identify of the server is determined |
| 129 | -** by global variables that are set using url_parse(): | |
| 129 | +** by pUrlData | |
| 130 | 130 | ** |
| 131 | -** g.urlName Name of the server. Ex: www.fossil-scm.org | |
| 132 | -** g.urlPort TCP/IP port to use. Ex: 80 | |
| 131 | +** pUrlDAta->name Name of the server. Ex: www.fossil-scm.org | |
| 132 | +** pUrlDAta->port TCP/IP port to use. Ex: 80 | |
| 133 | 133 | ** |
| 134 | 134 | ** Return the number of errors. |
| 135 | 135 | */ |
| 136 | 136 | int socket_open(UrlData *pUrlData){ |
| 137 | 137 | static struct sockaddr_in addr; /* The server address */ |
| @@ -212,13 +212,14 @@ | ||
| 212 | 212 | } |
| 213 | 213 | return total; |
| 214 | 214 | } |
| 215 | 215 | |
| 216 | 216 | /* |
| 217 | -** Attempt to resolve g.urlName to IP and setup g.zIpAddr so rcvfrom gets | |
| 218 | -** populated. For hostnames with more than one IP (or if overridden in | |
| 219 | -** ~/.ssh/config) the rcvfrom may not match the host to which we connect. | |
| 217 | +** Attempt to resolve pUrlData->name to an IP address and setup g.zIpAddr | |
| 218 | +** so rcvfrom gets populated. For hostnames with more than one IP (or | |
| 219 | +** if overridden in ~/.ssh/config) the rcvfrom may not match the host | |
| 220 | +** to which we connect. | |
| 220 | 221 | */ |
| 221 | 222 | void socket_ssh_resolve_addr(UrlData *pUrlData){ |
| 222 | 223 | struct hostent *pHost; /* Used to make best effort for rcvfrom */ |
| 223 | 224 | struct sockaddr_in addr; |
| 224 | 225 | |
| 225 | 226 |
| --- src/http_socket.c | |
| +++ src/http_socket.c | |
| @@ -124,14 +124,14 @@ | |
| 124 | } |
| 125 | } |
| 126 | |
| 127 | /* |
| 128 | ** Open a socket connection. The identify of the server is determined |
| 129 | ** by global variables that are set using url_parse(): |
| 130 | ** |
| 131 | ** g.urlName Name of the server. Ex: www.fossil-scm.org |
| 132 | ** g.urlPort TCP/IP port to use. Ex: 80 |
| 133 | ** |
| 134 | ** Return the number of errors. |
| 135 | */ |
| 136 | int socket_open(UrlData *pUrlData){ |
| 137 | static struct sockaddr_in addr; /* The server address */ |
| @@ -212,13 +212,14 @@ | |
| 212 | } |
| 213 | return total; |
| 214 | } |
| 215 | |
| 216 | /* |
| 217 | ** Attempt to resolve g.urlName to IP and setup g.zIpAddr so rcvfrom gets |
| 218 | ** populated. For hostnames with more than one IP (or if overridden in |
| 219 | ** ~/.ssh/config) the rcvfrom may not match the host to which we connect. |
| 220 | */ |
| 221 | void socket_ssh_resolve_addr(UrlData *pUrlData){ |
| 222 | struct hostent *pHost; /* Used to make best effort for rcvfrom */ |
| 223 | struct sockaddr_in addr; |
| 224 | |
| 225 |
| --- src/http_socket.c | |
| +++ src/http_socket.c | |
| @@ -124,14 +124,14 @@ | |
| 124 | } |
| 125 | } |
| 126 | |
| 127 | /* |
| 128 | ** Open a socket connection. The identify of the server is determined |
| 129 | ** by pUrlData |
| 130 | ** |
| 131 | ** pUrlDAta->name Name of the server. Ex: www.fossil-scm.org |
| 132 | ** pUrlDAta->port TCP/IP port to use. Ex: 80 |
| 133 | ** |
| 134 | ** Return the number of errors. |
| 135 | */ |
| 136 | int socket_open(UrlData *pUrlData){ |
| 137 | static struct sockaddr_in addr; /* The server address */ |
| @@ -212,13 +212,14 @@ | |
| 212 | } |
| 213 | return total; |
| 214 | } |
| 215 | |
| 216 | /* |
| 217 | ** Attempt to resolve pUrlData->name to an IP address and setup g.zIpAddr |
| 218 | ** so rcvfrom gets populated. For hostnames with more than one IP (or |
| 219 | ** if overridden in ~/.ssh/config) the rcvfrom may not match the host |
| 220 | ** to which we connect. |
| 221 | */ |
| 222 | void socket_ssh_resolve_addr(UrlData *pUrlData){ |
| 223 | struct hostent *pHost; /* Used to make best effort for rcvfrom */ |
| 224 | struct sockaddr_in addr; |
| 225 | |
| 226 |
+8
-6
| --- src/http_ssl.c | ||
| +++ src/http_ssl.c | ||
| @@ -224,13 +224,13 @@ | ||
| 224 | 224 | return rc; |
| 225 | 225 | } |
| 226 | 226 | |
| 227 | 227 | /* |
| 228 | 228 | ** Open an SSL connection. The identify of the server is determined |
| 229 | -** by variables that are set using url_parse(): | |
| 229 | +** as follows: | |
| 230 | 230 | ** |
| 231 | -** pUrlData->name Name of the server. Ex: www.fossil-scm.org | |
| 231 | +** g.url.name Name of the server. Ex: www.fossil-scm.org | |
| 232 | 232 | ** pUrlData->port TCP/IP port to use. Ex: 80 |
| 233 | 233 | ** |
| 234 | 234 | ** Return the number of errors. |
| 235 | 235 | */ |
| 236 | 236 | int ssl_open(UrlData *pUrlData){ |
| @@ -253,11 +253,11 @@ | ||
| 253 | 253 | |
| 254 | 254 | if( pUrlData->useProxy ){ |
| 255 | 255 | int rc; |
| 256 | 256 | BIO *sBio; |
| 257 | 257 | char *connStr; |
| 258 | - connStr = mprintf("%s:%d", g.urlName, pUrlData->port); | |
| 258 | + connStr = mprintf("%s:%d", g.url.name, pUrlData->port); | |
| 259 | 259 | sBio = BIO_new_connect(connStr); |
| 260 | 260 | free(connStr); |
| 261 | 261 | if( BIO_do_connect(sBio)<=0 ){ |
| 262 | 262 | ssl_set_errmsg("SSL: cannot connect to proxy %s:%d (%s)", |
| 263 | 263 | pUrlData->name, pUrlData->port, ERR_reason_error_string(ERR_get_error())); |
| @@ -417,26 +417,28 @@ | ||
| 417 | 417 | free(zHost); |
| 418 | 418 | BIO_free(mem); |
| 419 | 419 | } |
| 420 | 420 | |
| 421 | 421 | /* |
| 422 | -** Get certificate for g.urlName from global config. | |
| 422 | +** Get certificate for pUrlData->urlName from global config. | |
| 423 | 423 | ** Return NULL if no certificate found. |
| 424 | 424 | */ |
| 425 | 425 | X509 *ssl_get_certificate(UrlData *pUrlData, int *pTrusted){ |
| 426 | 426 | char *zHost, *zCert; |
| 427 | 427 | BIO *mem; |
| 428 | 428 | X509 *cert; |
| 429 | 429 | |
| 430 | - zHost = mprintf("cert:%s", pUrlData->useProxy?pUrlData->hostname:pUrlData->name); | |
| 430 | + zHost = mprintf("cert:%s", | |
| 431 | + pUrlData->useProxy ? pUrlData->hostname : pUrlData->name); | |
| 431 | 432 | zCert = db_get(zHost, NULL); |
| 432 | 433 | free(zHost); |
| 433 | 434 | if ( zCert==NULL ) |
| 434 | 435 | return NULL; |
| 435 | 436 | |
| 436 | 437 | if ( pTrusted!=0 ){ |
| 437 | - zHost = mprintf("trusted:%s", pUrlData->useProxy?pUrlData->hostname:pUrlData->name); | |
| 438 | + zHost = mprintf("trusted:%s", | |
| 439 | + pUrlData->useProxy ? pUrlData->hostname : pUrlData->name); | |
| 438 | 440 | *pTrusted = db_get_int(zHost, 0); |
| 439 | 441 | free(zHost); |
| 440 | 442 | } |
| 441 | 443 | |
| 442 | 444 | mem = BIO_new(BIO_s_mem()); |
| 443 | 445 |
| --- src/http_ssl.c | |
| +++ src/http_ssl.c | |
| @@ -224,13 +224,13 @@ | |
| 224 | return rc; |
| 225 | } |
| 226 | |
| 227 | /* |
| 228 | ** Open an SSL connection. The identify of the server is determined |
| 229 | ** by variables that are set using url_parse(): |
| 230 | ** |
| 231 | ** pUrlData->name Name of the server. Ex: www.fossil-scm.org |
| 232 | ** pUrlData->port TCP/IP port to use. Ex: 80 |
| 233 | ** |
| 234 | ** Return the number of errors. |
| 235 | */ |
| 236 | int ssl_open(UrlData *pUrlData){ |
| @@ -253,11 +253,11 @@ | |
| 253 | |
| 254 | if( pUrlData->useProxy ){ |
| 255 | int rc; |
| 256 | BIO *sBio; |
| 257 | char *connStr; |
| 258 | connStr = mprintf("%s:%d", g.urlName, pUrlData->port); |
| 259 | sBio = BIO_new_connect(connStr); |
| 260 | free(connStr); |
| 261 | if( BIO_do_connect(sBio)<=0 ){ |
| 262 | ssl_set_errmsg("SSL: cannot connect to proxy %s:%d (%s)", |
| 263 | pUrlData->name, pUrlData->port, ERR_reason_error_string(ERR_get_error())); |
| @@ -417,26 +417,28 @@ | |
| 417 | free(zHost); |
| 418 | BIO_free(mem); |
| 419 | } |
| 420 | |
| 421 | /* |
| 422 | ** Get certificate for g.urlName from global config. |
| 423 | ** Return NULL if no certificate found. |
| 424 | */ |
| 425 | X509 *ssl_get_certificate(UrlData *pUrlData, int *pTrusted){ |
| 426 | char *zHost, *zCert; |
| 427 | BIO *mem; |
| 428 | X509 *cert; |
| 429 | |
| 430 | zHost = mprintf("cert:%s", pUrlData->useProxy?pUrlData->hostname:pUrlData->name); |
| 431 | zCert = db_get(zHost, NULL); |
| 432 | free(zHost); |
| 433 | if ( zCert==NULL ) |
| 434 | return NULL; |
| 435 | |
| 436 | if ( pTrusted!=0 ){ |
| 437 | zHost = mprintf("trusted:%s", pUrlData->useProxy?pUrlData->hostname:pUrlData->name); |
| 438 | *pTrusted = db_get_int(zHost, 0); |
| 439 | free(zHost); |
| 440 | } |
| 441 | |
| 442 | mem = BIO_new(BIO_s_mem()); |
| 443 |
| --- src/http_ssl.c | |
| +++ src/http_ssl.c | |
| @@ -224,13 +224,13 @@ | |
| 224 | return rc; |
| 225 | } |
| 226 | |
| 227 | /* |
| 228 | ** Open an SSL connection. The identify of the server is determined |
| 229 | ** as follows: |
| 230 | ** |
| 231 | ** g.url.name Name of the server. Ex: www.fossil-scm.org |
| 232 | ** pUrlData->port TCP/IP port to use. Ex: 80 |
| 233 | ** |
| 234 | ** Return the number of errors. |
| 235 | */ |
| 236 | int ssl_open(UrlData *pUrlData){ |
| @@ -253,11 +253,11 @@ | |
| 253 | |
| 254 | if( pUrlData->useProxy ){ |
| 255 | int rc; |
| 256 | BIO *sBio; |
| 257 | char *connStr; |
| 258 | connStr = mprintf("%s:%d", g.url.name, pUrlData->port); |
| 259 | sBio = BIO_new_connect(connStr); |
| 260 | free(connStr); |
| 261 | if( BIO_do_connect(sBio)<=0 ){ |
| 262 | ssl_set_errmsg("SSL: cannot connect to proxy %s:%d (%s)", |
| 263 | pUrlData->name, pUrlData->port, ERR_reason_error_string(ERR_get_error())); |
| @@ -417,26 +417,28 @@ | |
| 417 | free(zHost); |
| 418 | BIO_free(mem); |
| 419 | } |
| 420 | |
| 421 | /* |
| 422 | ** Get certificate for pUrlData->urlName from global config. |
| 423 | ** Return NULL if no certificate found. |
| 424 | */ |
| 425 | X509 *ssl_get_certificate(UrlData *pUrlData, int *pTrusted){ |
| 426 | char *zHost, *zCert; |
| 427 | BIO *mem; |
| 428 | X509 *cert; |
| 429 | |
| 430 | zHost = mprintf("cert:%s", |
| 431 | pUrlData->useProxy ? pUrlData->hostname : pUrlData->name); |
| 432 | zCert = db_get(zHost, NULL); |
| 433 | free(zHost); |
| 434 | if ( zCert==NULL ) |
| 435 | return NULL; |
| 436 | |
| 437 | if ( pTrusted!=0 ){ |
| 438 | zHost = mprintf("trusted:%s", |
| 439 | pUrlData->useProxy ? pUrlData->hostname : pUrlData->name); |
| 440 | *pTrusted = db_get_int(zHost, 0); |
| 441 | free(zHost); |
| 442 | } |
| 443 | |
| 444 | mem = BIO_new(BIO_s_mem()); |
| 445 |
+4
-4
| --- src/http_transport.c | ||
| +++ src/http_transport.c | ||
| @@ -138,15 +138,15 @@ | ||
| 138 | 138 | return sshPid==0; |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | /* |
| 142 | 142 | ** Open a connection to the server. The server is defined by the following |
| 143 | -** global variables: | |
| 143 | +** variables: | |
| 144 | 144 | ** |
| 145 | -** g.urlName Name of the server. Ex: www.fossil-scm.org | |
| 146 | -** g.urlPort TCP/IP port. Ex: 80 | |
| 147 | -** g.urlIsHttps Use TLS for the connection | |
| 145 | +** pUrlData->name Name of the server. Ex: www.fossil-scm.org | |
| 146 | +** pUrlData->port TCP/IP port. Ex: 80 | |
| 147 | +** pUrlData->isHttps Use TLS for the connection | |
| 148 | 148 | ** |
| 149 | 149 | ** Return the number of errors. |
| 150 | 150 | */ |
| 151 | 151 | int transport_open(UrlData *pUrlData){ |
| 152 | 152 | int rc = 0; |
| 153 | 153 |
| --- src/http_transport.c | |
| +++ src/http_transport.c | |
| @@ -138,15 +138,15 @@ | |
| 138 | return sshPid==0; |
| 139 | } |
| 140 | |
| 141 | /* |
| 142 | ** Open a connection to the server. The server is defined by the following |
| 143 | ** global variables: |
| 144 | ** |
| 145 | ** g.urlName Name of the server. Ex: www.fossil-scm.org |
| 146 | ** g.urlPort TCP/IP port. Ex: 80 |
| 147 | ** g.urlIsHttps Use TLS for the connection |
| 148 | ** |
| 149 | ** Return the number of errors. |
| 150 | */ |
| 151 | int transport_open(UrlData *pUrlData){ |
| 152 | int rc = 0; |
| 153 |
| --- src/http_transport.c | |
| +++ src/http_transport.c | |
| @@ -138,15 +138,15 @@ | |
| 138 | return sshPid==0; |
| 139 | } |
| 140 | |
| 141 | /* |
| 142 | ** Open a connection to the server. The server is defined by the following |
| 143 | ** variables: |
| 144 | ** |
| 145 | ** pUrlData->name Name of the server. Ex: www.fossil-scm.org |
| 146 | ** pUrlData->port TCP/IP port. Ex: 80 |
| 147 | ** pUrlData->isHttps Use TLS for the connection |
| 148 | ** |
| 149 | ** Return the number of errors. |
| 150 | */ |
| 151 | int transport_open(UrlData *pUrlData){ |
| 152 | int rc = 0; |
| 153 |
+28
-28
| --- src/info.c | ||
| +++ src/info.c | ||
| @@ -399,11 +399,11 @@ | ||
| 399 | 399 | } |
| 400 | 400 | if( diffFlags ){ |
| 401 | 401 | append_diff(zOld, zNew, diffFlags, pRe); |
| 402 | 402 | }else if( zOld && zNew && fossil_strcmp(zOld,zNew)!=0 ){ |
| 403 | 403 | @ |
| 404 | - @ %z(href("%R/fdiff?v1=%S&v2=%S&sbs=1",zOld,zNew))[diff]</a> | |
| 404 | + @ %z(href("%R/fdiff?v1=%s&v2=%s&sbs=1",zOld,zNew))[diff]</a> | |
| 405 | 405 | } |
| 406 | 406 | } |
| 407 | 407 | } |
| 408 | 408 | |
| 409 | 409 | /* |
| @@ -612,19 +612,19 @@ | ||
| 612 | 612 | if( (zPJ[jj]>0 && zPJ[jj]<' ') || strchr("\"*/:<>?\\|", zPJ[jj]) ){ |
| 613 | 613 | zPJ[jj] = '_'; |
| 614 | 614 | } |
| 615 | 615 | } |
| 616 | 616 | @ <tr><th>Timelines:</th><td> |
| 617 | - @ %z(href("%R/timeline?f=%S&unhide",zUuid))family</a> | |
| 617 | + @ %z(href("%R/timeline?f=%s&unhide",zUuid))family</a> | |
| 618 | 618 | if( zParent ){ |
| 619 | - @ | %z(href("%R/timeline?p=%S&unhide",zUuid))ancestors</a> | |
| 619 | + @ | %z(href("%R/timeline?p=%s&unhide",zUuid))ancestors</a> | |
| 620 | 620 | } |
| 621 | 621 | if( !isLeaf ){ |
| 622 | - @ | %z(href("%R/timeline?d=%S&unhide",zUuid))descendants</a> | |
| 622 | + @ | %z(href("%R/timeline?d=%s&unhide",zUuid))descendants</a> | |
| 623 | 623 | } |
| 624 | 624 | if( zParent && !isLeaf ){ |
| 625 | - @ | %z(href("%R/timeline?dp=%S&unhide",zUuid))both</a> | |
| 625 | + @ | %z(href("%R/timeline?dp=%s&unhide",zUuid))both</a> | |
| 626 | 626 | } |
| 627 | 627 | db_prepare(&q2,"SELECT substr(tag.tagname,5) FROM tagxref, tag " |
| 628 | 628 | " WHERE rid=%d AND tagtype>0 " |
| 629 | 629 | " AND tag.tagid=tagxref.tagid " |
| 630 | 630 | " AND +tag.tagname GLOB 'sym-*'", rid); |
| @@ -647,16 +647,16 @@ | ||
| 647 | 647 | fossil_free(zUrl); |
| 648 | 648 | } |
| 649 | 649 | @ </td></tr> |
| 650 | 650 | @ <tr><th>Other Links:</th> |
| 651 | 651 | @ <td> |
| 652 | - @ %z(href("%R/tree?ci=%S",zUuid))files</a> | |
| 653 | - @ | %z(href("%R/fileage?name=%S",zUuid))file ages</a> | |
| 654 | - @ | %z(href("%R/tree?ci=%S&nofiles",zUuid))folders</a> | |
| 655 | - @ | %z(href("%R/artifact/%S",zUuid))manifest</a> | |
| 652 | + @ %z(href("%R/tree?ci=%s",zUuid))files</a> | |
| 653 | + @ | %z(href("%R/fileage?name=%s",zUuid))file ages</a> | |
| 654 | + @ | %z(href("%R/tree?ci=%s&nofiles",zUuid))folders</a> | |
| 655 | + @ | %z(href("%R/artifact/%s",zUuid))manifest</a> | |
| 656 | 656 | if( g.perm.Write ){ |
| 657 | - @ | %z(href("%R/ci_edit?r=%S",zUuid))edit</a> | |
| 657 | + @ | %z(href("%R/ci_edit?r=%s",zUuid))edit</a> | |
| 658 | 658 | } |
| 659 | 659 | @ </td> |
| 660 | 660 | @ </tr> |
| 661 | 661 | blob_reset(&projName); |
| 662 | 662 | } |
| @@ -699,11 +699,11 @@ | ||
| 699 | 699 | @ Show Unified Diffs</a> |
| 700 | 700 | @ %z(xhref("class='button'","%R/%s/%T?sbs=1",zPage,zName)) |
| 701 | 701 | @ Show Side-by-Side Diffs</a> |
| 702 | 702 | } |
| 703 | 703 | if( zParent ){ |
| 704 | - @ %z(xhref("class='button'","%R/vpatch?from=%S&to=%S",zParent,zUuid)) | |
| 704 | + @ %z(xhref("class='button'","%R/vpatch?from=%s&to=%s",zParent,zUuid)) | |
| 705 | 705 | @ Patch</a> |
| 706 | 706 | } |
| 707 | 707 | @</div> |
| 708 | 708 | if( pRe ){ |
| 709 | 709 | @ <p><b>Only differences that match regular expression "%h(zRe)" |
| @@ -770,11 +770,11 @@ | ||
| 770 | 770 | } |
| 771 | 771 | } |
| 772 | 772 | style_header("Update of \"%h\"", pWiki->zWikiTitle); |
| 773 | 773 | zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 774 | 774 | zDate = db_text(0, "SELECT datetime(%.17g)", pWiki->rDate); |
| 775 | - style_submenu_element("Raw", "Raw", "artifact/%S", zUuid); | |
| 775 | + style_submenu_element("Raw", "Raw", "artifact/%s", zUuid); | |
| 776 | 776 | style_submenu_element("History", "History", "whistory?name=%t", |
| 777 | 777 | pWiki->zWikiTitle); |
| 778 | 778 | style_submenu_element("Page", "Page", "wiki?name=%t", |
| 779 | 779 | pWiki->zWikiTitle); |
| 780 | 780 | login_anonymous_available(); |
| @@ -798,11 +798,11 @@ | ||
| 798 | 798 | if( pWiki->nParent>0 ){ |
| 799 | 799 | int i; |
| 800 | 800 | @ <tr><th>Parent%s(pWiki->nParent==1?"":"s"):</th><td> |
| 801 | 801 | for(i=0; i<pWiki->nParent; i++){ |
| 802 | 802 | char *zParent = pWiki->azParent[i]; |
| 803 | - @ %z(href("info/%S",zParent))%s(zParent)</a> | |
| 803 | + @ %z(href("info/%s",zParent))%s(zParent)</a> | |
| 804 | 804 | } |
| 805 | 805 | @ </td></tr> |
| 806 | 806 | } |
| 807 | 807 | @ </table> |
| 808 | 808 | |
| @@ -1188,14 +1188,14 @@ | ||
| 1188 | 1188 | @ on branch %z(href("%R/timeline?r=%T",zBr))%h(zBr)</a> |
| 1189 | 1189 | } |
| 1190 | 1190 | @ - %!w(zCom) (user: |
| 1191 | 1191 | hyperlink_to_user(zUser,zDate,")"); |
| 1192 | 1192 | if( g.perm.Hyperlink ){ |
| 1193 | - @ %z(href("%R/finfo?name=%T&ci=%S",zName,zVers))[ancestry]</a> | |
| 1194 | - @ %z(href("%R/annotate?checkin=%S&filename=%T",zVers,zName)) | |
| 1193 | + @ %z(href("%R/finfo?name=%T&ci=%s",zName,zVers))[ancestry]</a> | |
| 1194 | + @ %z(href("%R/annotate?checkin=%s&filename=%T",zVers,zName)) | |
| 1195 | 1195 | @ [annotate]</a> |
| 1196 | - @ %z(href("%R/blame?checkin=%S&filename=%T",zVers,zName)) | |
| 1196 | + @ %z(href("%R/blame?filename=%T&checkin=%s",zName,zVers)) | |
| 1197 | 1197 | @ [blame]</a> |
| 1198 | 1198 | } |
| 1199 | 1199 | cnt++; |
| 1200 | 1200 | if( pDownloadName && blob_size(pDownloadName)==0 ){ |
| 1201 | 1201 | blob_append(pDownloadName, zName, -1); |
| @@ -1302,11 +1302,11 @@ | ||
| 1302 | 1302 | @ Attachment "%h(zFilename)" to |
| 1303 | 1303 | } |
| 1304 | 1304 | objType |= OBJTYPE_ATTACHMENT; |
| 1305 | 1305 | if( strlen(zTarget)==UUID_SIZE && validate16(zTarget,UUID_SIZE) ){ |
| 1306 | 1306 | if( g.perm.Hyperlink && g.perm.RdTkt ){ |
| 1307 | - @ ticket [%z(href("%R/tktview?name=%S",zTarget))%S(zTarget)</a>] | |
| 1307 | + @ ticket [%z(href("%R/tktview?name=%s",zTarget))%S(zTarget)</a>] | |
| 1308 | 1308 | }else{ |
| 1309 | 1309 | @ ticket [%S(zTarget)] |
| 1310 | 1310 | } |
| 1311 | 1311 | }else{ |
| 1312 | 1312 | if( g.perm.Hyperlink && g.perm.RdWiki ){ |
| @@ -1328,11 +1328,11 @@ | ||
| 1328 | 1328 | @ Control artifact. |
| 1329 | 1329 | if( pDownloadName && blob_size(pDownloadName)==0 ){ |
| 1330 | 1330 | blob_appendf(pDownloadName, "%.10s.txt", zUuid); |
| 1331 | 1331 | } |
| 1332 | 1332 | }else if( linkToView && g.perm.Hyperlink ){ |
| 1333 | - @ %z(href("%R/artifact/%S",zUuid))[view]</a> | |
| 1333 | + @ %z(href("%R/artifact/%s",zUuid))[view]</a> | |
| 1334 | 1334 | } |
| 1335 | 1335 | return objType; |
| 1336 | 1336 | } |
| 1337 | 1337 | |
| 1338 | 1338 | |
| @@ -1404,17 +1404,17 @@ | ||
| 1404 | 1404 | g.zTop, P("v1"), P("v2"), zW); |
| 1405 | 1405 | } |
| 1406 | 1406 | |
| 1407 | 1407 | if( P("smhdr")!=0 ){ |
| 1408 | 1408 | @ <h2>Differences From Artifact |
| 1409 | - @ %z(href("%R/artifact/%S",zV1))[%S(zV1)]</a> To | |
| 1410 | - @ %z(href("%R/artifact/%S",zV2))[%S(zV2)]</a>.</h2> | |
| 1409 | + @ %z(href("%R/artifact/%s",zV1))[%S(zV1)]</a> To | |
| 1410 | + @ %z(href("%R/artifact/%s",zV2))[%S(zV2)]</a>.</h2> | |
| 1411 | 1411 | }else{ |
| 1412 | 1412 | @ <h2>Differences From |
| 1413 | - @ Artifact %z(href("%R/artifact/%S",zV1))[%S(zV1)]</a>:</h2> | |
| 1413 | + @ Artifact %z(href("%R/artifact/%s",zV1))[%S(zV1)]</a>:</h2> | |
| 1414 | 1414 | object_description(v1, 0, 0); |
| 1415 | - @ <h2>To Artifact %z(href("%R/artifact/%S",zV2))[%S(zV2)]</a>:</h2> | |
| 1415 | + @ <h2>To Artifact %z(href("%R/artifact/%s",zV2))[%S(zV2)]</a>:</h2> | |
| 1416 | 1416 | object_description(v2, 0, 0); |
| 1417 | 1417 | } |
| 1418 | 1418 | if( pRe ){ |
| 1419 | 1419 | @ <b>Only differences that match regular expression "%h(zRe)" |
| 1420 | 1420 | @ are shown.</b> |
| @@ -1761,13 +1761,13 @@ | ||
| 1761 | 1761 | @ <pre> |
| 1762 | 1762 | @ %h(z) |
| 1763 | 1763 | @ </pre> |
| 1764 | 1764 | } |
| 1765 | 1765 | }else if( strncmp(zMime, "image/", 6)==0 ){ |
| 1766 | - @ <img src="%R/raw/%S(zUuid)?m=%s(zMime)" /> | |
| 1766 | + @ <img src="%R/raw/%s(zUuid)?m=%s(zMime)" /> | |
| 1767 | 1767 | style_submenu_element("Image", "Image", |
| 1768 | - "%R/raw/%S?m=%s", zUuid, zMime); | |
| 1768 | + "%R/raw/%s?m=%s", zUuid, zMime); | |
| 1769 | 1769 | }else{ |
| 1770 | 1770 | @ <i>(file is %d(blob_size(&content)) bytes of binary data)</i> |
| 1771 | 1771 | } |
| 1772 | 1772 | @ </blockquote> |
| 1773 | 1773 | } |
| @@ -1819,19 +1819,19 @@ | ||
| 1819 | 1819 | } |
| 1820 | 1820 | zTktTitle = db_table_has_column( "ticket", "title" ) |
| 1821 | 1821 | ? db_text("(No title)", "SELECT title FROM ticket WHERE tkt_uuid=%Q", zTktName) |
| 1822 | 1822 | : 0; |
| 1823 | 1823 | style_header("Ticket Change Details"); |
| 1824 | - style_submenu_element("Raw", "Raw", "%R/artifact/%S", zUuid); | |
| 1824 | + style_submenu_element("Raw", "Raw", "%R/artifact/%s", zUuid); | |
| 1825 | 1825 | style_submenu_element("History", "History", "%R/tkthistory/%s", zTktName); |
| 1826 | 1826 | style_submenu_element("Page", "Page", "%R/tktview/%t", zTktName); |
| 1827 | 1827 | style_submenu_element("Timeline", "Timeline", "%R/tkttimeline/%t", zTktName); |
| 1828 | 1828 | if( P("plaintext") ){ |
| 1829 | - style_submenu_element("Formatted", "Formatted", "%R/info/%S", zUuid); | |
| 1829 | + style_submenu_element("Formatted", "Formatted", "%R/info/%s", zUuid); | |
| 1830 | 1830 | }else{ |
| 1831 | 1831 | style_submenu_element("Plaintext", "Plaintext", |
| 1832 | - "%R/info/%S?plaintext", zUuid); | |
| 1832 | + "%R/info/%s?plaintext", zUuid); | |
| 1833 | 1833 | } |
| 1834 | 1834 | |
| 1835 | 1835 | @ <div class="section">Overview</div> |
| 1836 | 1836 | @ <p><table class="label-value"> |
| 1837 | 1837 | @ <tr><th>Artifact ID:</th> |
| @@ -2341,11 +2341,11 @@ | ||
| 2341 | 2341 | } |
| 2342 | 2342 | @ <p>Make changes to attributes of check-in |
| 2343 | 2343 | @ [%z(href("%R/ci/%s",zUuid))%s(zUuid)</a>]:</p> |
| 2344 | 2344 | form_begin(0, "%R/ci_edit"); |
| 2345 | 2345 | login_insert_csrf_secret(); |
| 2346 | - @ <div><input type="hidden" name="r" value="%S(zUuid)" /> | |
| 2346 | + @ <div><input type="hidden" name="r" value="%s(zUuid)" /> | |
| 2347 | 2347 | @ <table border="0" cellspacing="10"> |
| 2348 | 2348 | |
| 2349 | 2349 | @ <tr><th align="right" valign="top">User:</th> |
| 2350 | 2350 | @ <td valign="top"> |
| 2351 | 2351 | @ <input type="text" name="u" size="20" value="%h(zNewUser)" /> |
| 2352 | 2352 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -399,11 +399,11 @@ | |
| 399 | } |
| 400 | if( diffFlags ){ |
| 401 | append_diff(zOld, zNew, diffFlags, pRe); |
| 402 | }else if( zOld && zNew && fossil_strcmp(zOld,zNew)!=0 ){ |
| 403 | @ |
| 404 | @ %z(href("%R/fdiff?v1=%S&v2=%S&sbs=1",zOld,zNew))[diff]</a> |
| 405 | } |
| 406 | } |
| 407 | } |
| 408 | |
| 409 | /* |
| @@ -612,19 +612,19 @@ | |
| 612 | if( (zPJ[jj]>0 && zPJ[jj]<' ') || strchr("\"*/:<>?\\|", zPJ[jj]) ){ |
| 613 | zPJ[jj] = '_'; |
| 614 | } |
| 615 | } |
| 616 | @ <tr><th>Timelines:</th><td> |
| 617 | @ %z(href("%R/timeline?f=%S&unhide",zUuid))family</a> |
| 618 | if( zParent ){ |
| 619 | @ | %z(href("%R/timeline?p=%S&unhide",zUuid))ancestors</a> |
| 620 | } |
| 621 | if( !isLeaf ){ |
| 622 | @ | %z(href("%R/timeline?d=%S&unhide",zUuid))descendants</a> |
| 623 | } |
| 624 | if( zParent && !isLeaf ){ |
| 625 | @ | %z(href("%R/timeline?dp=%S&unhide",zUuid))both</a> |
| 626 | } |
| 627 | db_prepare(&q2,"SELECT substr(tag.tagname,5) FROM tagxref, tag " |
| 628 | " WHERE rid=%d AND tagtype>0 " |
| 629 | " AND tag.tagid=tagxref.tagid " |
| 630 | " AND +tag.tagname GLOB 'sym-*'", rid); |
| @@ -647,16 +647,16 @@ | |
| 647 | fossil_free(zUrl); |
| 648 | } |
| 649 | @ </td></tr> |
| 650 | @ <tr><th>Other Links:</th> |
| 651 | @ <td> |
| 652 | @ %z(href("%R/tree?ci=%S",zUuid))files</a> |
| 653 | @ | %z(href("%R/fileage?name=%S",zUuid))file ages</a> |
| 654 | @ | %z(href("%R/tree?ci=%S&nofiles",zUuid))folders</a> |
| 655 | @ | %z(href("%R/artifact/%S",zUuid))manifest</a> |
| 656 | if( g.perm.Write ){ |
| 657 | @ | %z(href("%R/ci_edit?r=%S",zUuid))edit</a> |
| 658 | } |
| 659 | @ </td> |
| 660 | @ </tr> |
| 661 | blob_reset(&projName); |
| 662 | } |
| @@ -699,11 +699,11 @@ | |
| 699 | @ Show Unified Diffs</a> |
| 700 | @ %z(xhref("class='button'","%R/%s/%T?sbs=1",zPage,zName)) |
| 701 | @ Show Side-by-Side Diffs</a> |
| 702 | } |
| 703 | if( zParent ){ |
| 704 | @ %z(xhref("class='button'","%R/vpatch?from=%S&to=%S",zParent,zUuid)) |
| 705 | @ Patch</a> |
| 706 | } |
| 707 | @</div> |
| 708 | if( pRe ){ |
| 709 | @ <p><b>Only differences that match regular expression "%h(zRe)" |
| @@ -770,11 +770,11 @@ | |
| 770 | } |
| 771 | } |
| 772 | style_header("Update of \"%h\"", pWiki->zWikiTitle); |
| 773 | zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 774 | zDate = db_text(0, "SELECT datetime(%.17g)", pWiki->rDate); |
| 775 | style_submenu_element("Raw", "Raw", "artifact/%S", zUuid); |
| 776 | style_submenu_element("History", "History", "whistory?name=%t", |
| 777 | pWiki->zWikiTitle); |
| 778 | style_submenu_element("Page", "Page", "wiki?name=%t", |
| 779 | pWiki->zWikiTitle); |
| 780 | login_anonymous_available(); |
| @@ -798,11 +798,11 @@ | |
| 798 | if( pWiki->nParent>0 ){ |
| 799 | int i; |
| 800 | @ <tr><th>Parent%s(pWiki->nParent==1?"":"s"):</th><td> |
| 801 | for(i=0; i<pWiki->nParent; i++){ |
| 802 | char *zParent = pWiki->azParent[i]; |
| 803 | @ %z(href("info/%S",zParent))%s(zParent)</a> |
| 804 | } |
| 805 | @ </td></tr> |
| 806 | } |
| 807 | @ </table> |
| 808 | |
| @@ -1188,14 +1188,14 @@ | |
| 1188 | @ on branch %z(href("%R/timeline?r=%T",zBr))%h(zBr)</a> |
| 1189 | } |
| 1190 | @ - %!w(zCom) (user: |
| 1191 | hyperlink_to_user(zUser,zDate,")"); |
| 1192 | if( g.perm.Hyperlink ){ |
| 1193 | @ %z(href("%R/finfo?name=%T&ci=%S",zName,zVers))[ancestry]</a> |
| 1194 | @ %z(href("%R/annotate?checkin=%S&filename=%T",zVers,zName)) |
| 1195 | @ [annotate]</a> |
| 1196 | @ %z(href("%R/blame?checkin=%S&filename=%T",zVers,zName)) |
| 1197 | @ [blame]</a> |
| 1198 | } |
| 1199 | cnt++; |
| 1200 | if( pDownloadName && blob_size(pDownloadName)==0 ){ |
| 1201 | blob_append(pDownloadName, zName, -1); |
| @@ -1302,11 +1302,11 @@ | |
| 1302 | @ Attachment "%h(zFilename)" to |
| 1303 | } |
| 1304 | objType |= OBJTYPE_ATTACHMENT; |
| 1305 | if( strlen(zTarget)==UUID_SIZE && validate16(zTarget,UUID_SIZE) ){ |
| 1306 | if( g.perm.Hyperlink && g.perm.RdTkt ){ |
| 1307 | @ ticket [%z(href("%R/tktview?name=%S",zTarget))%S(zTarget)</a>] |
| 1308 | }else{ |
| 1309 | @ ticket [%S(zTarget)] |
| 1310 | } |
| 1311 | }else{ |
| 1312 | if( g.perm.Hyperlink && g.perm.RdWiki ){ |
| @@ -1328,11 +1328,11 @@ | |
| 1328 | @ Control artifact. |
| 1329 | if( pDownloadName && blob_size(pDownloadName)==0 ){ |
| 1330 | blob_appendf(pDownloadName, "%.10s.txt", zUuid); |
| 1331 | } |
| 1332 | }else if( linkToView && g.perm.Hyperlink ){ |
| 1333 | @ %z(href("%R/artifact/%S",zUuid))[view]</a> |
| 1334 | } |
| 1335 | return objType; |
| 1336 | } |
| 1337 | |
| 1338 | |
| @@ -1404,17 +1404,17 @@ | |
| 1404 | g.zTop, P("v1"), P("v2"), zW); |
| 1405 | } |
| 1406 | |
| 1407 | if( P("smhdr")!=0 ){ |
| 1408 | @ <h2>Differences From Artifact |
| 1409 | @ %z(href("%R/artifact/%S",zV1))[%S(zV1)]</a> To |
| 1410 | @ %z(href("%R/artifact/%S",zV2))[%S(zV2)]</a>.</h2> |
| 1411 | }else{ |
| 1412 | @ <h2>Differences From |
| 1413 | @ Artifact %z(href("%R/artifact/%S",zV1))[%S(zV1)]</a>:</h2> |
| 1414 | object_description(v1, 0, 0); |
| 1415 | @ <h2>To Artifact %z(href("%R/artifact/%S",zV2))[%S(zV2)]</a>:</h2> |
| 1416 | object_description(v2, 0, 0); |
| 1417 | } |
| 1418 | if( pRe ){ |
| 1419 | @ <b>Only differences that match regular expression "%h(zRe)" |
| 1420 | @ are shown.</b> |
| @@ -1761,13 +1761,13 @@ | |
| 1761 | @ <pre> |
| 1762 | @ %h(z) |
| 1763 | @ </pre> |
| 1764 | } |
| 1765 | }else if( strncmp(zMime, "image/", 6)==0 ){ |
| 1766 | @ <img src="%R/raw/%S(zUuid)?m=%s(zMime)" /> |
| 1767 | style_submenu_element("Image", "Image", |
| 1768 | "%R/raw/%S?m=%s", zUuid, zMime); |
| 1769 | }else{ |
| 1770 | @ <i>(file is %d(blob_size(&content)) bytes of binary data)</i> |
| 1771 | } |
| 1772 | @ </blockquote> |
| 1773 | } |
| @@ -1819,19 +1819,19 @@ | |
| 1819 | } |
| 1820 | zTktTitle = db_table_has_column( "ticket", "title" ) |
| 1821 | ? db_text("(No title)", "SELECT title FROM ticket WHERE tkt_uuid=%Q", zTktName) |
| 1822 | : 0; |
| 1823 | style_header("Ticket Change Details"); |
| 1824 | style_submenu_element("Raw", "Raw", "%R/artifact/%S", zUuid); |
| 1825 | style_submenu_element("History", "History", "%R/tkthistory/%s", zTktName); |
| 1826 | style_submenu_element("Page", "Page", "%R/tktview/%t", zTktName); |
| 1827 | style_submenu_element("Timeline", "Timeline", "%R/tkttimeline/%t", zTktName); |
| 1828 | if( P("plaintext") ){ |
| 1829 | style_submenu_element("Formatted", "Formatted", "%R/info/%S", zUuid); |
| 1830 | }else{ |
| 1831 | style_submenu_element("Plaintext", "Plaintext", |
| 1832 | "%R/info/%S?plaintext", zUuid); |
| 1833 | } |
| 1834 | |
| 1835 | @ <div class="section">Overview</div> |
| 1836 | @ <p><table class="label-value"> |
| 1837 | @ <tr><th>Artifact ID:</th> |
| @@ -2341,11 +2341,11 @@ | |
| 2341 | } |
| 2342 | @ <p>Make changes to attributes of check-in |
| 2343 | @ [%z(href("%R/ci/%s",zUuid))%s(zUuid)</a>]:</p> |
| 2344 | form_begin(0, "%R/ci_edit"); |
| 2345 | login_insert_csrf_secret(); |
| 2346 | @ <div><input type="hidden" name="r" value="%S(zUuid)" /> |
| 2347 | @ <table border="0" cellspacing="10"> |
| 2348 | |
| 2349 | @ <tr><th align="right" valign="top">User:</th> |
| 2350 | @ <td valign="top"> |
| 2351 | @ <input type="text" name="u" size="20" value="%h(zNewUser)" /> |
| 2352 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -399,11 +399,11 @@ | |
| 399 | } |
| 400 | if( diffFlags ){ |
| 401 | append_diff(zOld, zNew, diffFlags, pRe); |
| 402 | }else if( zOld && zNew && fossil_strcmp(zOld,zNew)!=0 ){ |
| 403 | @ |
| 404 | @ %z(href("%R/fdiff?v1=%s&v2=%s&sbs=1",zOld,zNew))[diff]</a> |
| 405 | } |
| 406 | } |
| 407 | } |
| 408 | |
| 409 | /* |
| @@ -612,19 +612,19 @@ | |
| 612 | if( (zPJ[jj]>0 && zPJ[jj]<' ') || strchr("\"*/:<>?\\|", zPJ[jj]) ){ |
| 613 | zPJ[jj] = '_'; |
| 614 | } |
| 615 | } |
| 616 | @ <tr><th>Timelines:</th><td> |
| 617 | @ %z(href("%R/timeline?f=%s&unhide",zUuid))family</a> |
| 618 | if( zParent ){ |
| 619 | @ | %z(href("%R/timeline?p=%s&unhide",zUuid))ancestors</a> |
| 620 | } |
| 621 | if( !isLeaf ){ |
| 622 | @ | %z(href("%R/timeline?d=%s&unhide",zUuid))descendants</a> |
| 623 | } |
| 624 | if( zParent && !isLeaf ){ |
| 625 | @ | %z(href("%R/timeline?dp=%s&unhide",zUuid))both</a> |
| 626 | } |
| 627 | db_prepare(&q2,"SELECT substr(tag.tagname,5) FROM tagxref, tag " |
| 628 | " WHERE rid=%d AND tagtype>0 " |
| 629 | " AND tag.tagid=tagxref.tagid " |
| 630 | " AND +tag.tagname GLOB 'sym-*'", rid); |
| @@ -647,16 +647,16 @@ | |
| 647 | fossil_free(zUrl); |
| 648 | } |
| 649 | @ </td></tr> |
| 650 | @ <tr><th>Other Links:</th> |
| 651 | @ <td> |
| 652 | @ %z(href("%R/tree?ci=%s",zUuid))files</a> |
| 653 | @ | %z(href("%R/fileage?name=%s",zUuid))file ages</a> |
| 654 | @ | %z(href("%R/tree?ci=%s&nofiles",zUuid))folders</a> |
| 655 | @ | %z(href("%R/artifact/%s",zUuid))manifest</a> |
| 656 | if( g.perm.Write ){ |
| 657 | @ | %z(href("%R/ci_edit?r=%s",zUuid))edit</a> |
| 658 | } |
| 659 | @ </td> |
| 660 | @ </tr> |
| 661 | blob_reset(&projName); |
| 662 | } |
| @@ -699,11 +699,11 @@ | |
| 699 | @ Show Unified Diffs</a> |
| 700 | @ %z(xhref("class='button'","%R/%s/%T?sbs=1",zPage,zName)) |
| 701 | @ Show Side-by-Side Diffs</a> |
| 702 | } |
| 703 | if( zParent ){ |
| 704 | @ %z(xhref("class='button'","%R/vpatch?from=%s&to=%s",zParent,zUuid)) |
| 705 | @ Patch</a> |
| 706 | } |
| 707 | @</div> |
| 708 | if( pRe ){ |
| 709 | @ <p><b>Only differences that match regular expression "%h(zRe)" |
| @@ -770,11 +770,11 @@ | |
| 770 | } |
| 771 | } |
| 772 | style_header("Update of \"%h\"", pWiki->zWikiTitle); |
| 773 | zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid); |
| 774 | zDate = db_text(0, "SELECT datetime(%.17g)", pWiki->rDate); |
| 775 | style_submenu_element("Raw", "Raw", "artifact/%s", zUuid); |
| 776 | style_submenu_element("History", "History", "whistory?name=%t", |
| 777 | pWiki->zWikiTitle); |
| 778 | style_submenu_element("Page", "Page", "wiki?name=%t", |
| 779 | pWiki->zWikiTitle); |
| 780 | login_anonymous_available(); |
| @@ -798,11 +798,11 @@ | |
| 798 | if( pWiki->nParent>0 ){ |
| 799 | int i; |
| 800 | @ <tr><th>Parent%s(pWiki->nParent==1?"":"s"):</th><td> |
| 801 | for(i=0; i<pWiki->nParent; i++){ |
| 802 | char *zParent = pWiki->azParent[i]; |
| 803 | @ %z(href("info/%s",zParent))%s(zParent)</a> |
| 804 | } |
| 805 | @ </td></tr> |
| 806 | } |
| 807 | @ </table> |
| 808 | |
| @@ -1188,14 +1188,14 @@ | |
| 1188 | @ on branch %z(href("%R/timeline?r=%T",zBr))%h(zBr)</a> |
| 1189 | } |
| 1190 | @ - %!w(zCom) (user: |
| 1191 | hyperlink_to_user(zUser,zDate,")"); |
| 1192 | if( g.perm.Hyperlink ){ |
| 1193 | @ %z(href("%R/finfo?name=%T&ci=%s",zName,zVers))[ancestry]</a> |
| 1194 | @ %z(href("%R/annotate?checkin=%s&filename=%T",zVers,zName)) |
| 1195 | @ [annotate]</a> |
| 1196 | @ %z(href("%R/blame?filename=%T&checkin=%s",zName,zVers)) |
| 1197 | @ [blame]</a> |
| 1198 | } |
| 1199 | cnt++; |
| 1200 | if( pDownloadName && blob_size(pDownloadName)==0 ){ |
| 1201 | blob_append(pDownloadName, zName, -1); |
| @@ -1302,11 +1302,11 @@ | |
| 1302 | @ Attachment "%h(zFilename)" to |
| 1303 | } |
| 1304 | objType |= OBJTYPE_ATTACHMENT; |
| 1305 | if( strlen(zTarget)==UUID_SIZE && validate16(zTarget,UUID_SIZE) ){ |
| 1306 | if( g.perm.Hyperlink && g.perm.RdTkt ){ |
| 1307 | @ ticket [%z(href("%R/tktview?name=%s",zTarget))%S(zTarget)</a>] |
| 1308 | }else{ |
| 1309 | @ ticket [%S(zTarget)] |
| 1310 | } |
| 1311 | }else{ |
| 1312 | if( g.perm.Hyperlink && g.perm.RdWiki ){ |
| @@ -1328,11 +1328,11 @@ | |
| 1328 | @ Control artifact. |
| 1329 | if( pDownloadName && blob_size(pDownloadName)==0 ){ |
| 1330 | blob_appendf(pDownloadName, "%.10s.txt", zUuid); |
| 1331 | } |
| 1332 | }else if( linkToView && g.perm.Hyperlink ){ |
| 1333 | @ %z(href("%R/artifact/%s",zUuid))[view]</a> |
| 1334 | } |
| 1335 | return objType; |
| 1336 | } |
| 1337 | |
| 1338 | |
| @@ -1404,17 +1404,17 @@ | |
| 1404 | g.zTop, P("v1"), P("v2"), zW); |
| 1405 | } |
| 1406 | |
| 1407 | if( P("smhdr")!=0 ){ |
| 1408 | @ <h2>Differences From Artifact |
| 1409 | @ %z(href("%R/artifact/%s",zV1))[%S(zV1)]</a> To |
| 1410 | @ %z(href("%R/artifact/%s",zV2))[%S(zV2)]</a>.</h2> |
| 1411 | }else{ |
| 1412 | @ <h2>Differences From |
| 1413 | @ Artifact %z(href("%R/artifact/%s",zV1))[%S(zV1)]</a>:</h2> |
| 1414 | object_description(v1, 0, 0); |
| 1415 | @ <h2>To Artifact %z(href("%R/artifact/%s",zV2))[%S(zV2)]</a>:</h2> |
| 1416 | object_description(v2, 0, 0); |
| 1417 | } |
| 1418 | if( pRe ){ |
| 1419 | @ <b>Only differences that match regular expression "%h(zRe)" |
| 1420 | @ are shown.</b> |
| @@ -1761,13 +1761,13 @@ | |
| 1761 | @ <pre> |
| 1762 | @ %h(z) |
| 1763 | @ </pre> |
| 1764 | } |
| 1765 | }else if( strncmp(zMime, "image/", 6)==0 ){ |
| 1766 | @ <img src="%R/raw/%s(zUuid)?m=%s(zMime)" /> |
| 1767 | style_submenu_element("Image", "Image", |
| 1768 | "%R/raw/%s?m=%s", zUuid, zMime); |
| 1769 | }else{ |
| 1770 | @ <i>(file is %d(blob_size(&content)) bytes of binary data)</i> |
| 1771 | } |
| 1772 | @ </blockquote> |
| 1773 | } |
| @@ -1819,19 +1819,19 @@ | |
| 1819 | } |
| 1820 | zTktTitle = db_table_has_column( "ticket", "title" ) |
| 1821 | ? db_text("(No title)", "SELECT title FROM ticket WHERE tkt_uuid=%Q", zTktName) |
| 1822 | : 0; |
| 1823 | style_header("Ticket Change Details"); |
| 1824 | style_submenu_element("Raw", "Raw", "%R/artifact/%s", zUuid); |
| 1825 | style_submenu_element("History", "History", "%R/tkthistory/%s", zTktName); |
| 1826 | style_submenu_element("Page", "Page", "%R/tktview/%t", zTktName); |
| 1827 | style_submenu_element("Timeline", "Timeline", "%R/tkttimeline/%t", zTktName); |
| 1828 | if( P("plaintext") ){ |
| 1829 | style_submenu_element("Formatted", "Formatted", "%R/info/%s", zUuid); |
| 1830 | }else{ |
| 1831 | style_submenu_element("Plaintext", "Plaintext", |
| 1832 | "%R/info/%s?plaintext", zUuid); |
| 1833 | } |
| 1834 | |
| 1835 | @ <div class="section">Overview</div> |
| 1836 | @ <p><table class="label-value"> |
| 1837 | @ <tr><th>Artifact ID:</th> |
| @@ -2341,11 +2341,11 @@ | |
| 2341 | } |
| 2342 | @ <p>Make changes to attributes of check-in |
| 2343 | @ [%z(href("%R/ci/%s",zUuid))%s(zUuid)</a>]:</p> |
| 2344 | form_begin(0, "%R/ci_edit"); |
| 2345 | login_insert_csrf_secret(); |
| 2346 | @ <div><input type="hidden" name="r" value="%s(zUuid)" /> |
| 2347 | @ <table border="0" cellspacing="10"> |
| 2348 | |
| 2349 | @ <tr><th align="right" valign="top">User:</th> |
| 2350 | @ <td valign="top"> |
| 2351 | @ <input type="text" name="u" size="20" value="%h(zNewUser)" /> |
| 2352 |
+14
-14
| --- src/json.c | ||
| +++ src/json.c | ||
| @@ -1275,15 +1275,15 @@ | ||
| 1275 | 1275 | INT(g, xlinkClusterOnly); |
| 1276 | 1276 | INT(g, fTimeFormat); |
| 1277 | 1277 | INT(g, markPrivate); |
| 1278 | 1278 | INT(g, clockSkewSeen); |
| 1279 | 1279 | INT(g, isHTTP); |
| 1280 | - INT(g, urlIsFile); | |
| 1281 | - INT(g, urlIsHttps); | |
| 1282 | - INT(g, urlIsSsh); | |
| 1283 | - INT(g, urlPort); | |
| 1284 | - INT(g, urlDfltPort); | |
| 1280 | + INT(g.url, isFile); | |
| 1281 | + INT(g.url, isHttps); | |
| 1282 | + INT(g.url, isSsh); | |
| 1283 | + INT(g.url, port); | |
| 1284 | + INT(g.url, dfltPort); | |
| 1285 | 1285 | INT(g, useLocalauth); |
| 1286 | 1286 | INT(g, noPswd); |
| 1287 | 1287 | INT(g, userUid); |
| 1288 | 1288 | INT(g, rcvid); |
| 1289 | 1289 | INT(g, okCsrf); |
| @@ -1299,19 +1299,19 @@ | ||
| 1299 | 1299 | CSTR(g, zExtra); |
| 1300 | 1300 | CSTR(g, zBaseURL); |
| 1301 | 1301 | CSTR(g, zTop); |
| 1302 | 1302 | CSTR(g, zContentType); |
| 1303 | 1303 | CSTR(g, zErrMsg); |
| 1304 | - CSTR(g, urlName); | |
| 1305 | - CSTR(g, urlHostname); | |
| 1306 | - CSTR(g, urlProtocol); | |
| 1307 | - CSTR(g, urlPath); | |
| 1308 | - CSTR(g, urlUser); | |
| 1309 | - CSTR(g, urlPasswd); | |
| 1310 | - CSTR(g, urlCanonical); | |
| 1311 | - CSTR(g, urlProxyAuth); | |
| 1312 | - CSTR(g, urlFossil); | |
| 1304 | + CSTR(g.url, name); | |
| 1305 | + CSTR(g.url, hostname); | |
| 1306 | + CSTR(g.url, protocol); | |
| 1307 | + CSTR(g.url, path); | |
| 1308 | + CSTR(g.url, user); | |
| 1309 | + CSTR(g.url, passwd); | |
| 1310 | + CSTR(g.url, canonical); | |
| 1311 | + CSTR(g.url, proxyAuth); | |
| 1312 | + CSTR(g.url, fossil); | |
| 1313 | 1313 | CSTR(g, zLogin); |
| 1314 | 1314 | CSTR(g, zSSLIdentity); |
| 1315 | 1315 | CSTR(g, zIpAddr); |
| 1316 | 1316 | CSTR(g, zNonce); |
| 1317 | 1317 | CSTR(g, zCsrfToken); |
| 1318 | 1318 |
| --- src/json.c | |
| +++ src/json.c | |
| @@ -1275,15 +1275,15 @@ | |
| 1275 | INT(g, xlinkClusterOnly); |
| 1276 | INT(g, fTimeFormat); |
| 1277 | INT(g, markPrivate); |
| 1278 | INT(g, clockSkewSeen); |
| 1279 | INT(g, isHTTP); |
| 1280 | INT(g, urlIsFile); |
| 1281 | INT(g, urlIsHttps); |
| 1282 | INT(g, urlIsSsh); |
| 1283 | INT(g, urlPort); |
| 1284 | INT(g, urlDfltPort); |
| 1285 | INT(g, useLocalauth); |
| 1286 | INT(g, noPswd); |
| 1287 | INT(g, userUid); |
| 1288 | INT(g, rcvid); |
| 1289 | INT(g, okCsrf); |
| @@ -1299,19 +1299,19 @@ | |
| 1299 | CSTR(g, zExtra); |
| 1300 | CSTR(g, zBaseURL); |
| 1301 | CSTR(g, zTop); |
| 1302 | CSTR(g, zContentType); |
| 1303 | CSTR(g, zErrMsg); |
| 1304 | CSTR(g, urlName); |
| 1305 | CSTR(g, urlHostname); |
| 1306 | CSTR(g, urlProtocol); |
| 1307 | CSTR(g, urlPath); |
| 1308 | CSTR(g, urlUser); |
| 1309 | CSTR(g, urlPasswd); |
| 1310 | CSTR(g, urlCanonical); |
| 1311 | CSTR(g, urlProxyAuth); |
| 1312 | CSTR(g, urlFossil); |
| 1313 | CSTR(g, zLogin); |
| 1314 | CSTR(g, zSSLIdentity); |
| 1315 | CSTR(g, zIpAddr); |
| 1316 | CSTR(g, zNonce); |
| 1317 | CSTR(g, zCsrfToken); |
| 1318 |
| --- src/json.c | |
| +++ src/json.c | |
| @@ -1275,15 +1275,15 @@ | |
| 1275 | INT(g, xlinkClusterOnly); |
| 1276 | INT(g, fTimeFormat); |
| 1277 | INT(g, markPrivate); |
| 1278 | INT(g, clockSkewSeen); |
| 1279 | INT(g, isHTTP); |
| 1280 | INT(g.url, isFile); |
| 1281 | INT(g.url, isHttps); |
| 1282 | INT(g.url, isSsh); |
| 1283 | INT(g.url, port); |
| 1284 | INT(g.url, dfltPort); |
| 1285 | INT(g, useLocalauth); |
| 1286 | INT(g, noPswd); |
| 1287 | INT(g, userUid); |
| 1288 | INT(g, rcvid); |
| 1289 | INT(g, okCsrf); |
| @@ -1299,19 +1299,19 @@ | |
| 1299 | CSTR(g, zExtra); |
| 1300 | CSTR(g, zBaseURL); |
| 1301 | CSTR(g, zTop); |
| 1302 | CSTR(g, zContentType); |
| 1303 | CSTR(g, zErrMsg); |
| 1304 | CSTR(g.url, name); |
| 1305 | CSTR(g.url, hostname); |
| 1306 | CSTR(g.url, protocol); |
| 1307 | CSTR(g.url, path); |
| 1308 | CSTR(g.url, user); |
| 1309 | CSTR(g.url, passwd); |
| 1310 | CSTR(g.url, canonical); |
| 1311 | CSTR(g.url, proxyAuth); |
| 1312 | CSTR(g.url, fossil); |
| 1313 | CSTR(g, zLogin); |
| 1314 | CSTR(g, zSSLIdentity); |
| 1315 | CSTR(g, zIpAddr); |
| 1316 | CSTR(g, zNonce); |
| 1317 | CSTR(g, zCsrfToken); |
| 1318 |
+4
-6
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -112,15 +112,10 @@ | ||
| 112 | 112 | void *xPostEval; /* Optional, called after Tcl_Eval*(). */ |
| 113 | 113 | void *pPostContext; /* Optional, provided to xPostEval(). */ |
| 114 | 114 | }; |
| 115 | 115 | #endif |
| 116 | 116 | |
| 117 | -/* | |
| 118 | -** All global variables are in this structure. | |
| 119 | -*/ | |
| 120 | -#define GLOBAL_URL() ((UrlData *)(&g.urlIsFile)) | |
| 121 | - | |
| 122 | 117 | struct Global { |
| 123 | 118 | int argc; char **argv; /* Command-line arguments to the program */ |
| 124 | 119 | char *nameOfExe; /* Full path of executable. */ |
| 125 | 120 | const char *zErrlog; /* Log errors to this file, if not NULL */ |
| 126 | 121 | int isConst; /* True if the output is unchanging & cacheable */ |
| @@ -172,11 +167,12 @@ | ||
| 172 | 167 | int wikiFlags; /* Wiki conversion flags applied to %w and %W */ |
| 173 | 168 | char isHTTP; /* True if server/CGI modes, else assume CLI. */ |
| 174 | 169 | char javascriptHyperlink; /* If true, set href= using script, not HTML */ |
| 175 | 170 | Blob httpHeader; /* Complete text of the HTTP request header */ |
| 176 | 171 | int useRepositoryFromCmdArg; /* -R <repository> specified on command line */ |
| 177 | - | |
| 172 | + UrlData url; /* Information about current URL */ | |
| 173 | +#if 0 | |
| 178 | 174 | /* |
| 179 | 175 | ** NOTE: These members MUST be kept in sync with those in the "UrlData" |
| 180 | 176 | ** structure defined in "url.c". |
| 181 | 177 | */ |
| 182 | 178 | int urlIsFile; /* True if a "file:" url */ |
| @@ -195,10 +191,12 @@ | ||
| 195 | 191 | char *urlFossil; /* The fossil query parameter on ssh: */ |
| 196 | 192 | unsigned urlFlags; /* Boolean flags controlling URL processing */ |
| 197 | 193 | int useProxy; /* Used to remember that a proxy is in use */ |
| 198 | 194 | char *proxyUrlPath; |
| 199 | 195 | int proxyOrigPort; /* Tunneled port number for https through proxy */ |
| 196 | +#endif | |
| 197 | + | |
| 200 | 198 | const char *zLogin; /* Login name. NULL or "" if not logged in. */ |
| 201 | 199 | const char *zSSLIdentity; /* Value of --ssl-identity option, filename of |
| 202 | 200 | ** SSL client identity */ |
| 203 | 201 | int useLocalauth; /* No login required if from 127.0.0.1 */ |
| 204 | 202 | int noPswd; /* Logged in without password (on 127.0.0.1) */ |
| 205 | 203 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -112,15 +112,10 @@ | |
| 112 | void *xPostEval; /* Optional, called after Tcl_Eval*(). */ |
| 113 | void *pPostContext; /* Optional, provided to xPostEval(). */ |
| 114 | }; |
| 115 | #endif |
| 116 | |
| 117 | /* |
| 118 | ** All global variables are in this structure. |
| 119 | */ |
| 120 | #define GLOBAL_URL() ((UrlData *)(&g.urlIsFile)) |
| 121 | |
| 122 | struct Global { |
| 123 | int argc; char **argv; /* Command-line arguments to the program */ |
| 124 | char *nameOfExe; /* Full path of executable. */ |
| 125 | const char *zErrlog; /* Log errors to this file, if not NULL */ |
| 126 | int isConst; /* True if the output is unchanging & cacheable */ |
| @@ -172,11 +167,12 @@ | |
| 172 | int wikiFlags; /* Wiki conversion flags applied to %w and %W */ |
| 173 | char isHTTP; /* True if server/CGI modes, else assume CLI. */ |
| 174 | char javascriptHyperlink; /* If true, set href= using script, not HTML */ |
| 175 | Blob httpHeader; /* Complete text of the HTTP request header */ |
| 176 | int useRepositoryFromCmdArg; /* -R <repository> specified on command line */ |
| 177 | |
| 178 | /* |
| 179 | ** NOTE: These members MUST be kept in sync with those in the "UrlData" |
| 180 | ** structure defined in "url.c". |
| 181 | */ |
| 182 | int urlIsFile; /* True if a "file:" url */ |
| @@ -195,10 +191,12 @@ | |
| 195 | char *urlFossil; /* The fossil query parameter on ssh: */ |
| 196 | unsigned urlFlags; /* Boolean flags controlling URL processing */ |
| 197 | int useProxy; /* Used to remember that a proxy is in use */ |
| 198 | char *proxyUrlPath; |
| 199 | int proxyOrigPort; /* Tunneled port number for https through proxy */ |
| 200 | const char *zLogin; /* Login name. NULL or "" if not logged in. */ |
| 201 | const char *zSSLIdentity; /* Value of --ssl-identity option, filename of |
| 202 | ** SSL client identity */ |
| 203 | int useLocalauth; /* No login required if from 127.0.0.1 */ |
| 204 | int noPswd; /* Logged in without password (on 127.0.0.1) */ |
| 205 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -112,15 +112,10 @@ | |
| 112 | void *xPostEval; /* Optional, called after Tcl_Eval*(). */ |
| 113 | void *pPostContext; /* Optional, provided to xPostEval(). */ |
| 114 | }; |
| 115 | #endif |
| 116 | |
| 117 | struct Global { |
| 118 | int argc; char **argv; /* Command-line arguments to the program */ |
| 119 | char *nameOfExe; /* Full path of executable. */ |
| 120 | const char *zErrlog; /* Log errors to this file, if not NULL */ |
| 121 | int isConst; /* True if the output is unchanging & cacheable */ |
| @@ -172,11 +167,12 @@ | |
| 167 | int wikiFlags; /* Wiki conversion flags applied to %w and %W */ |
| 168 | char isHTTP; /* True if server/CGI modes, else assume CLI. */ |
| 169 | char javascriptHyperlink; /* If true, set href= using script, not HTML */ |
| 170 | Blob httpHeader; /* Complete text of the HTTP request header */ |
| 171 | int useRepositoryFromCmdArg; /* -R <repository> specified on command line */ |
| 172 | UrlData url; /* Information about current URL */ |
| 173 | #if 0 |
| 174 | /* |
| 175 | ** NOTE: These members MUST be kept in sync with those in the "UrlData" |
| 176 | ** structure defined in "url.c". |
| 177 | */ |
| 178 | int urlIsFile; /* True if a "file:" url */ |
| @@ -195,10 +191,12 @@ | |
| 191 | char *urlFossil; /* The fossil query parameter on ssh: */ |
| 192 | unsigned urlFlags; /* Boolean flags controlling URL processing */ |
| 193 | int useProxy; /* Used to remember that a proxy is in use */ |
| 194 | char *proxyUrlPath; |
| 195 | int proxyOrigPort; /* Tunneled port number for https through proxy */ |
| 196 | #endif |
| 197 | |
| 198 | const char *zLogin; /* Login name. NULL or "" if not logged in. */ |
| 199 | const char *zSSLIdentity; /* Value of --ssl-identity option, filename of |
| 200 | ** SSL client identity */ |
| 201 | int useLocalauth; /* No login required if from 127.0.0.1 */ |
| 202 | int noPswd; /* Logged in without password (on 127.0.0.1) */ |
| 203 |
+4
-6
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -112,15 +112,10 @@ | ||
| 112 | 112 | void *xPostEval; /* Optional, called after Tcl_Eval*(). */ |
| 113 | 113 | void *pPostContext; /* Optional, provided to xPostEval(). */ |
| 114 | 114 | }; |
| 115 | 115 | #endif |
| 116 | 116 | |
| 117 | -/* | |
| 118 | -** All global variables are in this structure. | |
| 119 | -*/ | |
| 120 | -#define GLOBAL_URL() ((UrlData *)(&g.urlIsFile)) | |
| 121 | - | |
| 122 | 117 | struct Global { |
| 123 | 118 | int argc; char **argv; /* Command-line arguments to the program */ |
| 124 | 119 | char *nameOfExe; /* Full path of executable. */ |
| 125 | 120 | const char *zErrlog; /* Log errors to this file, if not NULL */ |
| 126 | 121 | int isConst; /* True if the output is unchanging & cacheable */ |
| @@ -172,11 +167,12 @@ | ||
| 172 | 167 | int wikiFlags; /* Wiki conversion flags applied to %w and %W */ |
| 173 | 168 | char isHTTP; /* True if server/CGI modes, else assume CLI. */ |
| 174 | 169 | char javascriptHyperlink; /* If true, set href= using script, not HTML */ |
| 175 | 170 | Blob httpHeader; /* Complete text of the HTTP request header */ |
| 176 | 171 | int useRepositoryFromCmdArg; /* -R <repository> specified on command line */ |
| 177 | - | |
| 172 | + UrlData url; /* Information about current URL */ | |
| 173 | +#if 0 | |
| 178 | 174 | /* |
| 179 | 175 | ** NOTE: These members MUST be kept in sync with those in the "UrlData" |
| 180 | 176 | ** structure defined in "url.c". |
| 181 | 177 | */ |
| 182 | 178 | int urlIsFile; /* True if a "file:" url */ |
| @@ -195,10 +191,12 @@ | ||
| 195 | 191 | char *urlFossil; /* The fossil query parameter on ssh: */ |
| 196 | 192 | unsigned urlFlags; /* Boolean flags controlling URL processing */ |
| 197 | 193 | int useProxy; /* Used to remember that a proxy is in use */ |
| 198 | 194 | char *proxyUrlPath; |
| 199 | 195 | int proxyOrigPort; /* Tunneled port number for https through proxy */ |
| 196 | +#endif | |
| 197 | + | |
| 200 | 198 | const char *zLogin; /* Login name. NULL or "" if not logged in. */ |
| 201 | 199 | const char *zSSLIdentity; /* Value of --ssl-identity option, filename of |
| 202 | 200 | ** SSL client identity */ |
| 203 | 201 | int useLocalauth; /* No login required if from 127.0.0.1 */ |
| 204 | 202 | int noPswd; /* Logged in without password (on 127.0.0.1) */ |
| 205 | 203 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -112,15 +112,10 @@ | |
| 112 | void *xPostEval; /* Optional, called after Tcl_Eval*(). */ |
| 113 | void *pPostContext; /* Optional, provided to xPostEval(). */ |
| 114 | }; |
| 115 | #endif |
| 116 | |
| 117 | /* |
| 118 | ** All global variables are in this structure. |
| 119 | */ |
| 120 | #define GLOBAL_URL() ((UrlData *)(&g.urlIsFile)) |
| 121 | |
| 122 | struct Global { |
| 123 | int argc; char **argv; /* Command-line arguments to the program */ |
| 124 | char *nameOfExe; /* Full path of executable. */ |
| 125 | const char *zErrlog; /* Log errors to this file, if not NULL */ |
| 126 | int isConst; /* True if the output is unchanging & cacheable */ |
| @@ -172,11 +167,12 @@ | |
| 172 | int wikiFlags; /* Wiki conversion flags applied to %w and %W */ |
| 173 | char isHTTP; /* True if server/CGI modes, else assume CLI. */ |
| 174 | char javascriptHyperlink; /* If true, set href= using script, not HTML */ |
| 175 | Blob httpHeader; /* Complete text of the HTTP request header */ |
| 176 | int useRepositoryFromCmdArg; /* -R <repository> specified on command line */ |
| 177 | |
| 178 | /* |
| 179 | ** NOTE: These members MUST be kept in sync with those in the "UrlData" |
| 180 | ** structure defined in "url.c". |
| 181 | */ |
| 182 | int urlIsFile; /* True if a "file:" url */ |
| @@ -195,10 +191,12 @@ | |
| 195 | char *urlFossil; /* The fossil query parameter on ssh: */ |
| 196 | unsigned urlFlags; /* Boolean flags controlling URL processing */ |
| 197 | int useProxy; /* Used to remember that a proxy is in use */ |
| 198 | char *proxyUrlPath; |
| 199 | int proxyOrigPort; /* Tunneled port number for https through proxy */ |
| 200 | const char *zLogin; /* Login name. NULL or "" if not logged in. */ |
| 201 | const char *zSSLIdentity; /* Value of --ssl-identity option, filename of |
| 202 | ** SSL client identity */ |
| 203 | int useLocalauth; /* No login required if from 127.0.0.1 */ |
| 204 | int noPswd; /* Logged in without password (on 127.0.0.1) */ |
| 205 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -112,15 +112,10 @@ | |
| 112 | void *xPostEval; /* Optional, called after Tcl_Eval*(). */ |
| 113 | void *pPostContext; /* Optional, provided to xPostEval(). */ |
| 114 | }; |
| 115 | #endif |
| 116 | |
| 117 | struct Global { |
| 118 | int argc; char **argv; /* Command-line arguments to the program */ |
| 119 | char *nameOfExe; /* Full path of executable. */ |
| 120 | const char *zErrlog; /* Log errors to this file, if not NULL */ |
| 121 | int isConst; /* True if the output is unchanging & cacheable */ |
| @@ -172,11 +167,12 @@ | |
| 167 | int wikiFlags; /* Wiki conversion flags applied to %w and %W */ |
| 168 | char isHTTP; /* True if server/CGI modes, else assume CLI. */ |
| 169 | char javascriptHyperlink; /* If true, set href= using script, not HTML */ |
| 170 | Blob httpHeader; /* Complete text of the HTTP request header */ |
| 171 | int useRepositoryFromCmdArg; /* -R <repository> specified on command line */ |
| 172 | UrlData url; /* Information about current URL */ |
| 173 | #if 0 |
| 174 | /* |
| 175 | ** NOTE: These members MUST be kept in sync with those in the "UrlData" |
| 176 | ** structure defined in "url.c". |
| 177 | */ |
| 178 | int urlIsFile; /* True if a "file:" url */ |
| @@ -195,10 +191,12 @@ | |
| 191 | char *urlFossil; /* The fossil query parameter on ssh: */ |
| 192 | unsigned urlFlags; /* Boolean flags controlling URL processing */ |
| 193 | int useProxy; /* Used to remember that a proxy is in use */ |
| 194 | char *proxyUrlPath; |
| 195 | int proxyOrigPort; /* Tunneled port number for https through proxy */ |
| 196 | #endif |
| 197 | |
| 198 | const char *zLogin; /* Login name. NULL or "" if not logged in. */ |
| 199 | const char *zSSLIdentity; /* Value of --ssl-identity option, filename of |
| 200 | ** SSL client identity */ |
| 201 | int useLocalauth; /* No login required if from 127.0.0.1 */ |
| 202 | int noPswd; /* Logged in without password (on 127.0.0.1) */ |
| 203 |
+2
-2
| --- src/manifest.c | ||
| +++ src/manifest.c | ||
| @@ -1931,11 +1931,11 @@ | ||
| 1931 | 1931 | || !validate16(p->zAttachTarget, UUID_SIZE) |
| 1932 | 1932 | ){ |
| 1933 | 1933 | char *zComment; |
| 1934 | 1934 | if( p->zAttachSrc && p->zAttachSrc[0] ){ |
| 1935 | 1935 | zComment = mprintf( |
| 1936 | - "Add attachment [/artifact/%S|%h] to wiki page [%h]", | |
| 1936 | + "Add attachment [/artifact/%s|%h] to wiki page [%h]", | |
| 1937 | 1937 | p->zAttachSrc, p->zAttachName, p->zAttachTarget); |
| 1938 | 1938 | }else{ |
| 1939 | 1939 | zComment = mprintf("Delete attachment \"%h\" from wiki page [%h]", |
| 1940 | 1940 | p->zAttachName, p->zAttachTarget); |
| 1941 | 1941 | } |
| @@ -1947,11 +1947,11 @@ | ||
| 1947 | 1947 | free(zComment); |
| 1948 | 1948 | }else{ |
| 1949 | 1949 | char *zComment; |
| 1950 | 1950 | if( p->zAttachSrc && p->zAttachSrc[0] ){ |
| 1951 | 1951 | zComment = mprintf( |
| 1952 | - "Add attachment [/artifact/%S|%h] to ticket [%s|%.10s]", | |
| 1952 | + "Add attachment [/artifact/%s|%h] to ticket [%s|%.10s]", | |
| 1953 | 1953 | p->zAttachSrc, p->zAttachName, p->zAttachTarget, p->zAttachTarget); |
| 1954 | 1954 | }else{ |
| 1955 | 1955 | zComment = mprintf("Delete attachment \"%h\" from ticket [%s|%.10s]", |
| 1956 | 1956 | p->zAttachName, p->zAttachTarget, p->zAttachTarget); |
| 1957 | 1957 | } |
| 1958 | 1958 |
| --- src/manifest.c | |
| +++ src/manifest.c | |
| @@ -1931,11 +1931,11 @@ | |
| 1931 | || !validate16(p->zAttachTarget, UUID_SIZE) |
| 1932 | ){ |
| 1933 | char *zComment; |
| 1934 | if( p->zAttachSrc && p->zAttachSrc[0] ){ |
| 1935 | zComment = mprintf( |
| 1936 | "Add attachment [/artifact/%S|%h] to wiki page [%h]", |
| 1937 | p->zAttachSrc, p->zAttachName, p->zAttachTarget); |
| 1938 | }else{ |
| 1939 | zComment = mprintf("Delete attachment \"%h\" from wiki page [%h]", |
| 1940 | p->zAttachName, p->zAttachTarget); |
| 1941 | } |
| @@ -1947,11 +1947,11 @@ | |
| 1947 | free(zComment); |
| 1948 | }else{ |
| 1949 | char *zComment; |
| 1950 | if( p->zAttachSrc && p->zAttachSrc[0] ){ |
| 1951 | zComment = mprintf( |
| 1952 | "Add attachment [/artifact/%S|%h] to ticket [%s|%.10s]", |
| 1953 | p->zAttachSrc, p->zAttachName, p->zAttachTarget, p->zAttachTarget); |
| 1954 | }else{ |
| 1955 | zComment = mprintf("Delete attachment \"%h\" from ticket [%s|%.10s]", |
| 1956 | p->zAttachName, p->zAttachTarget, p->zAttachTarget); |
| 1957 | } |
| 1958 |
| --- src/manifest.c | |
| +++ src/manifest.c | |
| @@ -1931,11 +1931,11 @@ | |
| 1931 | || !validate16(p->zAttachTarget, UUID_SIZE) |
| 1932 | ){ |
| 1933 | char *zComment; |
| 1934 | if( p->zAttachSrc && p->zAttachSrc[0] ){ |
| 1935 | zComment = mprintf( |
| 1936 | "Add attachment [/artifact/%s|%h] to wiki page [%h]", |
| 1937 | p->zAttachSrc, p->zAttachName, p->zAttachTarget); |
| 1938 | }else{ |
| 1939 | zComment = mprintf("Delete attachment \"%h\" from wiki page [%h]", |
| 1940 | p->zAttachName, p->zAttachTarget); |
| 1941 | } |
| @@ -1947,11 +1947,11 @@ | |
| 1947 | free(zComment); |
| 1948 | }else{ |
| 1949 | char *zComment; |
| 1950 | if( p->zAttachSrc && p->zAttachSrc[0] ){ |
| 1951 | zComment = mprintf( |
| 1952 | "Add attachment [/artifact/%s|%h] to ticket [%s|%.10s]", |
| 1953 | p->zAttachSrc, p->zAttachName, p->zAttachTarget, p->zAttachTarget); |
| 1954 | }else{ |
| 1955 | zComment = mprintf("Delete attachment \"%h\" from ticket [%s|%.10s]", |
| 1956 | p->zAttachName, p->zAttachTarget, p->zAttachTarget); |
| 1957 | } |
| 1958 |
+3
-2
| --- src/name.c | ||
| +++ src/name.c | ||
| @@ -402,16 +402,17 @@ | ||
| 402 | 402 | canonical16(z, strlen(z)); |
| 403 | 403 | db_prepare(&q, "SELECT uuid, rid FROM blob WHERE uuid GLOB '%q*'", z); |
| 404 | 404 | while( db_step(&q)==SQLITE_ROW ){ |
| 405 | 405 | const char *zUuid = db_column_text(&q, 0); |
| 406 | 406 | int rid = db_column_int(&q, 1); |
| 407 | - @ <li><p><a href="%s(g.zTop)/%T(zSrc)/%S(zUuid)"> | |
| 408 | - @ %S(zUuid)</a> - | |
| 407 | + @ <li><p><a href="%s(g.zTop)/%T(zSrc)/%s(zUuid)"> | |
| 408 | + @ %s(zUuid)</a> - | |
| 409 | 409 | object_description(rid, 0, 0); |
| 410 | 410 | @ </p></li> |
| 411 | 411 | } |
| 412 | 412 | @ </ol> |
| 413 | + db_finalize(&q); | |
| 413 | 414 | style_footer(); |
| 414 | 415 | } |
| 415 | 416 | |
| 416 | 417 | /* |
| 417 | 418 | ** Convert the name in CGI parameter zParamName into a rid and return that |
| 418 | 419 |
| --- src/name.c | |
| +++ src/name.c | |
| @@ -402,16 +402,17 @@ | |
| 402 | canonical16(z, strlen(z)); |
| 403 | db_prepare(&q, "SELECT uuid, rid FROM blob WHERE uuid GLOB '%q*'", z); |
| 404 | while( db_step(&q)==SQLITE_ROW ){ |
| 405 | const char *zUuid = db_column_text(&q, 0); |
| 406 | int rid = db_column_int(&q, 1); |
| 407 | @ <li><p><a href="%s(g.zTop)/%T(zSrc)/%S(zUuid)"> |
| 408 | @ %S(zUuid)</a> - |
| 409 | object_description(rid, 0, 0); |
| 410 | @ </p></li> |
| 411 | } |
| 412 | @ </ol> |
| 413 | style_footer(); |
| 414 | } |
| 415 | |
| 416 | /* |
| 417 | ** Convert the name in CGI parameter zParamName into a rid and return that |
| 418 |
| --- src/name.c | |
| +++ src/name.c | |
| @@ -402,16 +402,17 @@ | |
| 402 | canonical16(z, strlen(z)); |
| 403 | db_prepare(&q, "SELECT uuid, rid FROM blob WHERE uuid GLOB '%q*'", z); |
| 404 | while( db_step(&q)==SQLITE_ROW ){ |
| 405 | const char *zUuid = db_column_text(&q, 0); |
| 406 | int rid = db_column_int(&q, 1); |
| 407 | @ <li><p><a href="%s(g.zTop)/%T(zSrc)/%s(zUuid)"> |
| 408 | @ %s(zUuid)</a> - |
| 409 | object_description(rid, 0, 0); |
| 410 | @ </p></li> |
| 411 | } |
| 412 | @ </ol> |
| 413 | db_finalize(&q); |
| 414 | style_footer(); |
| 415 | } |
| 416 | |
| 417 | /* |
| 418 | ** Convert the name in CGI parameter zParamName into a rid and return that |
| 419 |
+3
| --- src/report.c | ||
| +++ src/report.c | ||
| @@ -302,10 +302,11 @@ | ||
| 302 | 302 | "FROM reportfmt WHERE rn=%d",rn); |
| 303 | 303 | style_header("SQL For Report Format Number %d", rn); |
| 304 | 304 | if( db_step(&q)!=SQLITE_ROW ){ |
| 305 | 305 | @ <p>Unknown report number: %d(rn)</p> |
| 306 | 306 | style_footer(); |
| 307 | + db_finalize(&q); | |
| 307 | 308 | return; |
| 308 | 309 | } |
| 309 | 310 | zTitle = db_column_text(&q, 0); |
| 310 | 311 | zSQL = db_column_text(&q, 1); |
| 311 | 312 | zOwner = db_column_text(&q, 2); |
| @@ -323,10 +324,11 @@ | ||
| 323 | 324 | output_color_key(zClrKey, 0, "border=0 cellspacing=0 cellpadding=3"); |
| 324 | 325 | @ </td> |
| 325 | 326 | @ </tr></table> |
| 326 | 327 | report_format_hints(); |
| 327 | 328 | style_footer(); |
| 329 | + db_finalize(&q); | |
| 328 | 330 | } |
| 329 | 331 | |
| 330 | 332 | /* |
| 331 | 333 | ** WEBPAGE: /rptnew |
| 332 | 334 | ** WEBPAGE: /rptedit |
| @@ -1026,10 +1028,11 @@ | ||
| 1026 | 1028 | /* view_add_functions(tabs); */ |
| 1027 | 1029 | db_prepare(&q, |
| 1028 | 1030 | "SELECT title, sqlcode, owner, cols FROM reportfmt WHERE rn=%d", rn); |
| 1029 | 1031 | if( db_step(&q)!=SQLITE_ROW ){ |
| 1030 | 1032 | cgi_redirect("reportlist"); |
| 1033 | + db_finalize(&q); | |
| 1031 | 1034 | return; |
| 1032 | 1035 | } |
| 1033 | 1036 | zTitle = db_column_malloc(&q, 0); |
| 1034 | 1037 | zSql = db_column_malloc(&q, 1); |
| 1035 | 1038 | zOwner = db_column_malloc(&q, 2); |
| 1036 | 1039 |
| --- src/report.c | |
| +++ src/report.c | |
| @@ -302,10 +302,11 @@ | |
| 302 | "FROM reportfmt WHERE rn=%d",rn); |
| 303 | style_header("SQL For Report Format Number %d", rn); |
| 304 | if( db_step(&q)!=SQLITE_ROW ){ |
| 305 | @ <p>Unknown report number: %d(rn)</p> |
| 306 | style_footer(); |
| 307 | return; |
| 308 | } |
| 309 | zTitle = db_column_text(&q, 0); |
| 310 | zSQL = db_column_text(&q, 1); |
| 311 | zOwner = db_column_text(&q, 2); |
| @@ -323,10 +324,11 @@ | |
| 323 | output_color_key(zClrKey, 0, "border=0 cellspacing=0 cellpadding=3"); |
| 324 | @ </td> |
| 325 | @ </tr></table> |
| 326 | report_format_hints(); |
| 327 | style_footer(); |
| 328 | } |
| 329 | |
| 330 | /* |
| 331 | ** WEBPAGE: /rptnew |
| 332 | ** WEBPAGE: /rptedit |
| @@ -1026,10 +1028,11 @@ | |
| 1026 | /* view_add_functions(tabs); */ |
| 1027 | db_prepare(&q, |
| 1028 | "SELECT title, sqlcode, owner, cols FROM reportfmt WHERE rn=%d", rn); |
| 1029 | if( db_step(&q)!=SQLITE_ROW ){ |
| 1030 | cgi_redirect("reportlist"); |
| 1031 | return; |
| 1032 | } |
| 1033 | zTitle = db_column_malloc(&q, 0); |
| 1034 | zSql = db_column_malloc(&q, 1); |
| 1035 | zOwner = db_column_malloc(&q, 2); |
| 1036 |
| --- src/report.c | |
| +++ src/report.c | |
| @@ -302,10 +302,11 @@ | |
| 302 | "FROM reportfmt WHERE rn=%d",rn); |
| 303 | style_header("SQL For Report Format Number %d", rn); |
| 304 | if( db_step(&q)!=SQLITE_ROW ){ |
| 305 | @ <p>Unknown report number: %d(rn)</p> |
| 306 | style_footer(); |
| 307 | db_finalize(&q); |
| 308 | return; |
| 309 | } |
| 310 | zTitle = db_column_text(&q, 0); |
| 311 | zSQL = db_column_text(&q, 1); |
| 312 | zOwner = db_column_text(&q, 2); |
| @@ -323,10 +324,11 @@ | |
| 324 | output_color_key(zClrKey, 0, "border=0 cellspacing=0 cellpadding=3"); |
| 325 | @ </td> |
| 326 | @ </tr></table> |
| 327 | report_format_hints(); |
| 328 | style_footer(); |
| 329 | db_finalize(&q); |
| 330 | } |
| 331 | |
| 332 | /* |
| 333 | ** WEBPAGE: /rptnew |
| 334 | ** WEBPAGE: /rptedit |
| @@ -1026,10 +1028,11 @@ | |
| 1028 | /* view_add_functions(tabs); */ |
| 1029 | db_prepare(&q, |
| 1030 | "SELECT title, sqlcode, owner, cols FROM reportfmt WHERE rn=%d", rn); |
| 1031 | if( db_step(&q)!=SQLITE_ROW ){ |
| 1032 | cgi_redirect("reportlist"); |
| 1033 | db_finalize(&q); |
| 1034 | return; |
| 1035 | } |
| 1036 | zTitle = db_column_malloc(&q, 0); |
| 1037 | zSql = db_column_malloc(&q, 1); |
| 1038 | zOwner = db_column_malloc(&q, 2); |
| 1039 |
+1
| --- src/setup.c | ||
| +++ src/setup.c | ||
| @@ -277,10 +277,11 @@ | ||
| 277 | 277 | @ </p></li> |
| 278 | 278 | @ |
| 279 | 279 | @ </ol> |
| 280 | 280 | @ </td></tr></table> |
| 281 | 281 | style_footer(); |
| 282 | + db_finalize(&s); | |
| 282 | 283 | } |
| 283 | 284 | |
| 284 | 285 | /* |
| 285 | 286 | ** Return true if zPw is a valid password string. A valid |
| 286 | 287 | ** password string is: |
| 287 | 288 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -277,10 +277,11 @@ | |
| 277 | @ </p></li> |
| 278 | @ |
| 279 | @ </ol> |
| 280 | @ </td></tr></table> |
| 281 | style_footer(); |
| 282 | } |
| 283 | |
| 284 | /* |
| 285 | ** Return true if zPw is a valid password string. A valid |
| 286 | ** password string is: |
| 287 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -277,10 +277,11 @@ | |
| 277 | @ </p></li> |
| 278 | @ |
| 279 | @ </ol> |
| 280 | @ </td></tr></table> |
| 281 | style_footer(); |
| 282 | db_finalize(&s); |
| 283 | } |
| 284 | |
| 285 | /* |
| 286 | ** Return true if zPw is a valid password string. A valid |
| 287 | ** password string is: |
| 288 |
+4
-3
| --- src/sqlite3.c | ||
| +++ src/sqlite3.c | ||
| @@ -1,8 +1,8 @@ | ||
| 1 | 1 | /****************************************************************************** |
| 2 | 2 | ** This file is an amalgamation of many separate C source files from SQLite |
| 3 | -** version 3.8.4.1. By combining all the individual C code files into this | |
| 3 | +** version 3.8.4.2. By combining all the individual C code files into this | |
| 4 | 4 | ** single large file, the entire code can be compiled as a single translation |
| 5 | 5 | ** unit. This allows many compilers to do optimizations that would not be |
| 6 | 6 | ** possible if the files were compiled separately. Performance improvements |
| 7 | 7 | ** of 5% or more are commonly seen when SQLite is compiled as a single |
| 8 | 8 | ** translation unit. |
| @@ -220,13 +220,13 @@ | ||
| 220 | 220 | ** |
| 221 | 221 | ** See also: [sqlite3_libversion()], |
| 222 | 222 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 223 | 223 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 224 | 224 | */ |
| 225 | -#define SQLITE_VERSION "3.8.4.1" | |
| 225 | +#define SQLITE_VERSION "3.8.4.2" | |
| 226 | 226 | #define SQLITE_VERSION_NUMBER 3008004 |
| 227 | -#define SQLITE_SOURCE_ID "2014-03-11 15:27:36 018d317b1257ce68a92908b05c9c7cf1494050d0" | |
| 227 | +#define SQLITE_SOURCE_ID "2014-03-26 18:51:19 02ea166372bdb2ef9d8dfbb05e78a97609673a8e" | |
| 228 | 228 | |
| 229 | 229 | /* |
| 230 | 230 | ** CAPI3REF: Run-Time Library Version Numbers |
| 231 | 231 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 232 | 232 | ** |
| @@ -64780,10 +64780,11 @@ | ||
| 64780 | 64780 | i = 1; |
| 64781 | 64781 | pRhs++; |
| 64782 | 64782 | }else{ |
| 64783 | 64783 | idx1 = getVarint32(aKey1, szHdr1); |
| 64784 | 64784 | d1 = szHdr1; |
| 64785 | + if( d1>(unsigned)nKey1 ) return 1; /* Corruption */ | |
| 64785 | 64786 | i = 0; |
| 64786 | 64787 | } |
| 64787 | 64788 | |
| 64788 | 64789 | VVA_ONLY( mem1.zMalloc = 0; ) /* Only needed by assert() statements */ |
| 64789 | 64790 | assert( pPKey2->pKeyInfo->nField+pPKey2->pKeyInfo->nXField>=pPKey2->nField |
| 64790 | 64791 |
| --- src/sqlite3.c | |
| +++ src/sqlite3.c | |
| @@ -1,8 +1,8 @@ | |
| 1 | /****************************************************************************** |
| 2 | ** This file is an amalgamation of many separate C source files from SQLite |
| 3 | ** version 3.8.4.1. By combining all the individual C code files into this |
| 4 | ** single large file, the entire code can be compiled as a single translation |
| 5 | ** unit. This allows many compilers to do optimizations that would not be |
| 6 | ** possible if the files were compiled separately. Performance improvements |
| 7 | ** of 5% or more are commonly seen when SQLite is compiled as a single |
| 8 | ** translation unit. |
| @@ -220,13 +220,13 @@ | |
| 220 | ** |
| 221 | ** See also: [sqlite3_libversion()], |
| 222 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 223 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 224 | */ |
| 225 | #define SQLITE_VERSION "3.8.4.1" |
| 226 | #define SQLITE_VERSION_NUMBER 3008004 |
| 227 | #define SQLITE_SOURCE_ID "2014-03-11 15:27:36 018d317b1257ce68a92908b05c9c7cf1494050d0" |
| 228 | |
| 229 | /* |
| 230 | ** CAPI3REF: Run-Time Library Version Numbers |
| 231 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 232 | ** |
| @@ -64780,10 +64780,11 @@ | |
| 64780 | i = 1; |
| 64781 | pRhs++; |
| 64782 | }else{ |
| 64783 | idx1 = getVarint32(aKey1, szHdr1); |
| 64784 | d1 = szHdr1; |
| 64785 | i = 0; |
| 64786 | } |
| 64787 | |
| 64788 | VVA_ONLY( mem1.zMalloc = 0; ) /* Only needed by assert() statements */ |
| 64789 | assert( pPKey2->pKeyInfo->nField+pPKey2->pKeyInfo->nXField>=pPKey2->nField |
| 64790 |
| --- src/sqlite3.c | |
| +++ src/sqlite3.c | |
| @@ -1,8 +1,8 @@ | |
| 1 | /****************************************************************************** |
| 2 | ** This file is an amalgamation of many separate C source files from SQLite |
| 3 | ** version 3.8.4.2. By combining all the individual C code files into this |
| 4 | ** single large file, the entire code can be compiled as a single translation |
| 5 | ** unit. This allows many compilers to do optimizations that would not be |
| 6 | ** possible if the files were compiled separately. Performance improvements |
| 7 | ** of 5% or more are commonly seen when SQLite is compiled as a single |
| 8 | ** translation unit. |
| @@ -220,13 +220,13 @@ | |
| 220 | ** |
| 221 | ** See also: [sqlite3_libversion()], |
| 222 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 223 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 224 | */ |
| 225 | #define SQLITE_VERSION "3.8.4.2" |
| 226 | #define SQLITE_VERSION_NUMBER 3008004 |
| 227 | #define SQLITE_SOURCE_ID "2014-03-26 18:51:19 02ea166372bdb2ef9d8dfbb05e78a97609673a8e" |
| 228 | |
| 229 | /* |
| 230 | ** CAPI3REF: Run-Time Library Version Numbers |
| 231 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 232 | ** |
| @@ -64780,10 +64780,11 @@ | |
| 64780 | i = 1; |
| 64781 | pRhs++; |
| 64782 | }else{ |
| 64783 | idx1 = getVarint32(aKey1, szHdr1); |
| 64784 | d1 = szHdr1; |
| 64785 | if( d1>(unsigned)nKey1 ) return 1; /* Corruption */ |
| 64786 | i = 0; |
| 64787 | } |
| 64788 | |
| 64789 | VVA_ONLY( mem1.zMalloc = 0; ) /* Only needed by assert() statements */ |
| 64790 | assert( pPKey2->pKeyInfo->nField+pPKey2->pKeyInfo->nXField>=pPKey2->nField |
| 64791 |
+2
-2
| --- src/sqlite3.h | ||
| +++ src/sqlite3.h | ||
| @@ -105,13 +105,13 @@ | ||
| 105 | 105 | ** |
| 106 | 106 | ** See also: [sqlite3_libversion()], |
| 107 | 107 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 108 | 108 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 109 | 109 | */ |
| 110 | -#define SQLITE_VERSION "3.8.4.1" | |
| 110 | +#define SQLITE_VERSION "3.8.4.2" | |
| 111 | 111 | #define SQLITE_VERSION_NUMBER 3008004 |
| 112 | -#define SQLITE_SOURCE_ID "2014-03-11 15:27:36 018d317b1257ce68a92908b05c9c7cf1494050d0" | |
| 112 | +#define SQLITE_SOURCE_ID "2014-03-26 18:51:19 02ea166372bdb2ef9d8dfbb05e78a97609673a8e" | |
| 113 | 113 | |
| 114 | 114 | /* |
| 115 | 115 | ** CAPI3REF: Run-Time Library Version Numbers |
| 116 | 116 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 117 | 117 | ** |
| 118 | 118 |
| --- src/sqlite3.h | |
| +++ src/sqlite3.h | |
| @@ -105,13 +105,13 @@ | |
| 105 | ** |
| 106 | ** See also: [sqlite3_libversion()], |
| 107 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 108 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 109 | */ |
| 110 | #define SQLITE_VERSION "3.8.4.1" |
| 111 | #define SQLITE_VERSION_NUMBER 3008004 |
| 112 | #define SQLITE_SOURCE_ID "2014-03-11 15:27:36 018d317b1257ce68a92908b05c9c7cf1494050d0" |
| 113 | |
| 114 | /* |
| 115 | ** CAPI3REF: Run-Time Library Version Numbers |
| 116 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 117 | ** |
| 118 |
| --- src/sqlite3.h | |
| +++ src/sqlite3.h | |
| @@ -105,13 +105,13 @@ | |
| 105 | ** |
| 106 | ** See also: [sqlite3_libversion()], |
| 107 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 108 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 109 | */ |
| 110 | #define SQLITE_VERSION "3.8.4.2" |
| 111 | #define SQLITE_VERSION_NUMBER 3008004 |
| 112 | #define SQLITE_SOURCE_ID "2014-03-26 18:51:19 02ea166372bdb2ef9d8dfbb05e78a97609673a8e" |
| 113 | |
| 114 | /* |
| 115 | ** CAPI3REF: Run-Time Library Version Numbers |
| 116 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 117 | ** |
| 118 |
+10
-10
| --- src/sync.c | ||
| +++ src/sync.c | ||
| @@ -48,14 +48,14 @@ | ||
| 48 | 48 | } |
| 49 | 49 | }else{ |
| 50 | 50 | /* Autosync defaults on. To make it default off, "return" here. */ |
| 51 | 51 | } |
| 52 | 52 | url_parse(0, URL_REMEMBER); |
| 53 | - if( g.urlProtocol==0 ) return 0; | |
| 54 | - if( g.urlUser!=0 && g.urlPasswd==0 ){ | |
| 55 | - g.urlPasswd = unobscure(db_get("last-sync-pw", 0)); | |
| 56 | - g.urlFlags |= URL_PROMPT_PW; | |
| 53 | + if( g.url.protocol==0 ) return 0; | |
| 54 | + if( g.url.user!=0 && g.url.passwd==0 ){ | |
| 55 | + g.url.passwd = unobscure(db_get("last-sync-pw", 0)); | |
| 56 | + g.url.flags |= URL_PROMPT_PW; | |
| 57 | 57 | url_prompt_for_password(); |
| 58 | 58 | } |
| 59 | 59 | g.zHttpAuth = get_httpauth(); |
| 60 | 60 | url_remember(); |
| 61 | 61 | #if 0 /* Disabled for now */ |
| @@ -69,11 +69,11 @@ | ||
| 69 | 69 | */ |
| 70 | 70 | configSync = CONFIGSET_SHUN; |
| 71 | 71 | } |
| 72 | 72 | #endif |
| 73 | 73 | if( find_option("verbose","v",0)!=0 ) flags |= SYNC_VERBOSE; |
| 74 | - fossil_print("Autosync: %s\n", g.urlCanonical); | |
| 74 | + fossil_print("Autosync: %s\n", g.url.canonical); | |
| 75 | 75 | url_enable_proxy("via proxy: "); |
| 76 | 76 | rc = client_sync(flags, configSync, 0); |
| 77 | 77 | if( rc ) fossil_warning("Autosync failed"); |
| 78 | 78 | return rc; |
| 79 | 79 | } |
| @@ -121,22 +121,22 @@ | ||
| 121 | 121 | clone_ssh_db_set_options(); |
| 122 | 122 | } |
| 123 | 123 | url_parse(zUrl, urlFlags); |
| 124 | 124 | remember_or_get_http_auth(zHttpAuth, urlFlags & URL_REMEMBER, zUrl); |
| 125 | 125 | url_remember(); |
| 126 | - if( g.urlProtocol==0 ){ | |
| 126 | + if( g.url.protocol==0 ){ | |
| 127 | 127 | if( urlOptional ) fossil_exit(0); |
| 128 | 128 | usage("URL"); |
| 129 | 129 | } |
| 130 | 130 | user_select(); |
| 131 | 131 | if( g.argc==2 ){ |
| 132 | 132 | if( ((*pSyncFlags) & (SYNC_PUSH|SYNC_PULL))==(SYNC_PUSH|SYNC_PULL) ){ |
| 133 | - fossil_print("Sync with %s\n", g.urlCanonical); | |
| 133 | + fossil_print("Sync with %s\n", g.url.canonical); | |
| 134 | 134 | }else if( (*pSyncFlags) & SYNC_PUSH ){ |
| 135 | - fossil_print("Push to %s\n", g.urlCanonical); | |
| 135 | + fossil_print("Push to %s\n", g.url.canonical); | |
| 136 | 136 | }else if( (*pSyncFlags) & SYNC_PULL ){ |
| 137 | - fossil_print("Pull from %s\n", g.urlCanonical); | |
| 137 | + fossil_print("Pull from %s\n", g.url.canonical); | |
| 138 | 138 | } |
| 139 | 139 | } |
| 140 | 140 | url_enable_proxy("via proxy: "); |
| 141 | 141 | *pConfigFlags |= configSync; |
| 142 | 142 | } |
| @@ -278,8 +278,8 @@ | ||
| 278 | 278 | if( zUrl==0 ){ |
| 279 | 279 | fossil_print("off\n"); |
| 280 | 280 | return; |
| 281 | 281 | }else{ |
| 282 | 282 | url_parse(zUrl, 0); |
| 283 | - fossil_print("%s\n", g.urlCanonical); | |
| 283 | + fossil_print("%s\n", g.url.canonical); | |
| 284 | 284 | } |
| 285 | 285 | } |
| 286 | 286 |
| --- src/sync.c | |
| +++ src/sync.c | |
| @@ -48,14 +48,14 @@ | |
| 48 | } |
| 49 | }else{ |
| 50 | /* Autosync defaults on. To make it default off, "return" here. */ |
| 51 | } |
| 52 | url_parse(0, URL_REMEMBER); |
| 53 | if( g.urlProtocol==0 ) return 0; |
| 54 | if( g.urlUser!=0 && g.urlPasswd==0 ){ |
| 55 | g.urlPasswd = unobscure(db_get("last-sync-pw", 0)); |
| 56 | g.urlFlags |= URL_PROMPT_PW; |
| 57 | url_prompt_for_password(); |
| 58 | } |
| 59 | g.zHttpAuth = get_httpauth(); |
| 60 | url_remember(); |
| 61 | #if 0 /* Disabled for now */ |
| @@ -69,11 +69,11 @@ | |
| 69 | */ |
| 70 | configSync = CONFIGSET_SHUN; |
| 71 | } |
| 72 | #endif |
| 73 | if( find_option("verbose","v",0)!=0 ) flags |= SYNC_VERBOSE; |
| 74 | fossil_print("Autosync: %s\n", g.urlCanonical); |
| 75 | url_enable_proxy("via proxy: "); |
| 76 | rc = client_sync(flags, configSync, 0); |
| 77 | if( rc ) fossil_warning("Autosync failed"); |
| 78 | return rc; |
| 79 | } |
| @@ -121,22 +121,22 @@ | |
| 121 | clone_ssh_db_set_options(); |
| 122 | } |
| 123 | url_parse(zUrl, urlFlags); |
| 124 | remember_or_get_http_auth(zHttpAuth, urlFlags & URL_REMEMBER, zUrl); |
| 125 | url_remember(); |
| 126 | if( g.urlProtocol==0 ){ |
| 127 | if( urlOptional ) fossil_exit(0); |
| 128 | usage("URL"); |
| 129 | } |
| 130 | user_select(); |
| 131 | if( g.argc==2 ){ |
| 132 | if( ((*pSyncFlags) & (SYNC_PUSH|SYNC_PULL))==(SYNC_PUSH|SYNC_PULL) ){ |
| 133 | fossil_print("Sync with %s\n", g.urlCanonical); |
| 134 | }else if( (*pSyncFlags) & SYNC_PUSH ){ |
| 135 | fossil_print("Push to %s\n", g.urlCanonical); |
| 136 | }else if( (*pSyncFlags) & SYNC_PULL ){ |
| 137 | fossil_print("Pull from %s\n", g.urlCanonical); |
| 138 | } |
| 139 | } |
| 140 | url_enable_proxy("via proxy: "); |
| 141 | *pConfigFlags |= configSync; |
| 142 | } |
| @@ -278,8 +278,8 @@ | |
| 278 | if( zUrl==0 ){ |
| 279 | fossil_print("off\n"); |
| 280 | return; |
| 281 | }else{ |
| 282 | url_parse(zUrl, 0); |
| 283 | fossil_print("%s\n", g.urlCanonical); |
| 284 | } |
| 285 | } |
| 286 |
| --- src/sync.c | |
| +++ src/sync.c | |
| @@ -48,14 +48,14 @@ | |
| 48 | } |
| 49 | }else{ |
| 50 | /* Autosync defaults on. To make it default off, "return" here. */ |
| 51 | } |
| 52 | url_parse(0, URL_REMEMBER); |
| 53 | if( g.url.protocol==0 ) return 0; |
| 54 | if( g.url.user!=0 && g.url.passwd==0 ){ |
| 55 | g.url.passwd = unobscure(db_get("last-sync-pw", 0)); |
| 56 | g.url.flags |= URL_PROMPT_PW; |
| 57 | url_prompt_for_password(); |
| 58 | } |
| 59 | g.zHttpAuth = get_httpauth(); |
| 60 | url_remember(); |
| 61 | #if 0 /* Disabled for now */ |
| @@ -69,11 +69,11 @@ | |
| 69 | */ |
| 70 | configSync = CONFIGSET_SHUN; |
| 71 | } |
| 72 | #endif |
| 73 | if( find_option("verbose","v",0)!=0 ) flags |= SYNC_VERBOSE; |
| 74 | fossil_print("Autosync: %s\n", g.url.canonical); |
| 75 | url_enable_proxy("via proxy: "); |
| 76 | rc = client_sync(flags, configSync, 0); |
| 77 | if( rc ) fossil_warning("Autosync failed"); |
| 78 | return rc; |
| 79 | } |
| @@ -121,22 +121,22 @@ | |
| 121 | clone_ssh_db_set_options(); |
| 122 | } |
| 123 | url_parse(zUrl, urlFlags); |
| 124 | remember_or_get_http_auth(zHttpAuth, urlFlags & URL_REMEMBER, zUrl); |
| 125 | url_remember(); |
| 126 | if( g.url.protocol==0 ){ |
| 127 | if( urlOptional ) fossil_exit(0); |
| 128 | usage("URL"); |
| 129 | } |
| 130 | user_select(); |
| 131 | if( g.argc==2 ){ |
| 132 | if( ((*pSyncFlags) & (SYNC_PUSH|SYNC_PULL))==(SYNC_PUSH|SYNC_PULL) ){ |
| 133 | fossil_print("Sync with %s\n", g.url.canonical); |
| 134 | }else if( (*pSyncFlags) & SYNC_PUSH ){ |
| 135 | fossil_print("Push to %s\n", g.url.canonical); |
| 136 | }else if( (*pSyncFlags) & SYNC_PULL ){ |
| 137 | fossil_print("Pull from %s\n", g.url.canonical); |
| 138 | } |
| 139 | } |
| 140 | url_enable_proxy("via proxy: "); |
| 141 | *pConfigFlags |= configSync; |
| 142 | } |
| @@ -278,8 +278,8 @@ | |
| 278 | if( zUrl==0 ){ |
| 279 | fossil_print("off\n"); |
| 280 | return; |
| 281 | }else{ |
| 282 | url_parse(zUrl, 0); |
| 283 | fossil_print("%s\n", g.url.canonical); |
| 284 | } |
| 285 | } |
| 286 |
+6
-19
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -54,23 +54,10 @@ | ||
| 54 | 54 | }else{ |
| 55 | 55 | @ <span class="timelineHistDsp">[%s(z)]</span> |
| 56 | 56 | } |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | -/* | |
| 60 | -** Generate a hyperlink to a diff between two versions. | |
| 61 | -*/ | |
| 62 | -void hyperlink_to_diff(const char *zV1, const char *zV2){ | |
| 63 | - if( g.perm.Hyperlink ){ | |
| 64 | - if( zV2==0 ){ | |
| 65 | - @ %z(href("%R/diff?v2=%s",zV1))[diff]</a> | |
| 66 | - }else{ | |
| 67 | - @ %z(href("%R/diff?v1=%s&v2=%s",zV1,zV2))[diff]</a> | |
| 68 | - } | |
| 69 | - } | |
| 70 | -} | |
| 71 | - | |
| 72 | 59 | /* |
| 73 | 60 | ** Generate a hyperlink to a date & time. |
| 74 | 61 | */ |
| 75 | 62 | void hyperlink_to_date(const char *zDate, const char *zSuffix){ |
| 76 | 63 | if( zSuffix==0 ) zSuffix = ""; |
| @@ -448,11 +435,11 @@ | ||
| 448 | 435 | @ (user: %h(zDispUser)%s(zTagList?",":"\051") |
| 449 | 436 | } |
| 450 | 437 | |
| 451 | 438 | /* Generate a "detail" link for tags. */ |
| 452 | 439 | if( (zType[0]=='g' || zType[0]=='w' || zType[0]=='t') && g.perm.Hyperlink ){ |
| 453 | - @ [%z(href("%R/info/%S",zUuid))details</a>] | |
| 440 | + @ [%z(href("%R/info/%s",zUuid))details</a>] | |
| 454 | 441 | } |
| 455 | 442 | |
| 456 | 443 | /* Generate the "tags: TAGLIST" at the end of the comment, together |
| 457 | 444 | ** with hyperlinks to the tag list. |
| 458 | 445 | */ |
| @@ -527,23 +514,23 @@ | ||
| 527 | 514 | } |
| 528 | 515 | continue; |
| 529 | 516 | } |
| 530 | 517 | if( isNew ){ |
| 531 | 518 | @ <li> %h(zFilename) (new file) |
| 532 | - @ %z(href("%R/artifact/%S",zNew))[view]</a></li> | |
| 519 | + @ %z(href("%R/artifact/%s",zNew))[view]</a></li> | |
| 533 | 520 | }else if( isDel ){ |
| 534 | 521 | @ <li> %h(zFilename) (deleted)</li> |
| 535 | 522 | }else if( fossil_strcmp(zOld,zNew)==0 && zOldName!=0 ){ |
| 536 | 523 | @ <li> %h(zOldName) → %h(zFilename) |
| 537 | - @ %z(href("%R/artifact/%S",zNew))[view]</a></li> | |
| 524 | + @ %z(href("%R/artifact/%s",zNew))[view]</a></li> | |
| 538 | 525 | }else{ |
| 539 | 526 | if( zOldName!=0 ){ |
| 540 | 527 | @ <li> %h(zOldName) → %h(zFilename) |
| 541 | 528 | }else{ |
| 542 | 529 | @ <li> %h(zFilename) |
| 543 | 530 | } |
| 544 | - @ %z(href("%R/fdiff?v1=%S&v2=%S&sbs=1",zOld,zNew))[diff]</a></li> | |
| 531 | + @ %z(href("%R/fdiff?sbs=1&v1=%s&v2=%s",zOld,zNew))[diff]</a></li> | |
| 545 | 532 | } |
| 546 | 533 | } |
| 547 | 534 | db_reset(&fchngQuery); |
| 548 | 535 | if( inUl ){ |
| 549 | 536 | @ </ul> |
| @@ -1442,11 +1429,11 @@ | ||
| 1442 | 1429 | blob_appendf(&desc, "%d %ss", n, zEType); |
| 1443 | 1430 | } |
| 1444 | 1431 | if( zUses ){ |
| 1445 | 1432 | char *zFilenames = names_of_file(zUses); |
| 1446 | 1433 | blob_appendf(&desc, " using file %s version %z%S</a>", zFilenames, |
| 1447 | - href("%R/artifact/%S",zUses), zUses); | |
| 1434 | + href("%R/artifact/%s",zUses), zUses); | |
| 1448 | 1435 | tmFlags |= TIMELINE_DISJOINT; |
| 1449 | 1436 | } |
| 1450 | 1437 | if( renameOnly ){ |
| 1451 | 1438 | blob_appendf(&desc, " that contain filename changes"); |
| 1452 | 1439 | tmFlags |= TIMELINE_DISJOINT|TIMELINE_FRENAMES; |
| @@ -1963,11 +1950,11 @@ | ||
| 1963 | 1950 | " AND blob.rid=c.cid" |
| 1964 | 1951 | ); |
| 1965 | 1952 | while( db_step(&q)==SQLITE_ROW ){ |
| 1966 | 1953 | const char *zUuid = db_column_text(&q, 0); |
| 1967 | 1954 | @ <li> |
| 1968 | - @ <a href="%s(g.zTop)/timeline?p=%S(zUuid)&d=%S(zUuid)&unhide">%S(zUuid)</a> | |
| 1955 | + @ <a href="%s(g.zTop)/timeline?p=%s(zUuid)&d=%s(zUuid)&unhide">%S(zUuid)</a> | |
| 1969 | 1956 | } |
| 1970 | 1957 | db_finalize(&q); |
| 1971 | 1958 | style_footer(); |
| 1972 | 1959 | } |
| 1973 | 1960 | |
| 1974 | 1961 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -54,23 +54,10 @@ | |
| 54 | }else{ |
| 55 | @ <span class="timelineHistDsp">[%s(z)]</span> |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | /* |
| 60 | ** Generate a hyperlink to a diff between two versions. |
| 61 | */ |
| 62 | void hyperlink_to_diff(const char *zV1, const char *zV2){ |
| 63 | if( g.perm.Hyperlink ){ |
| 64 | if( zV2==0 ){ |
| 65 | @ %z(href("%R/diff?v2=%s",zV1))[diff]</a> |
| 66 | }else{ |
| 67 | @ %z(href("%R/diff?v1=%s&v2=%s",zV1,zV2))[diff]</a> |
| 68 | } |
| 69 | } |
| 70 | } |
| 71 | |
| 72 | /* |
| 73 | ** Generate a hyperlink to a date & time. |
| 74 | */ |
| 75 | void hyperlink_to_date(const char *zDate, const char *zSuffix){ |
| 76 | if( zSuffix==0 ) zSuffix = ""; |
| @@ -448,11 +435,11 @@ | |
| 448 | @ (user: %h(zDispUser)%s(zTagList?",":"\051") |
| 449 | } |
| 450 | |
| 451 | /* Generate a "detail" link for tags. */ |
| 452 | if( (zType[0]=='g' || zType[0]=='w' || zType[0]=='t') && g.perm.Hyperlink ){ |
| 453 | @ [%z(href("%R/info/%S",zUuid))details</a>] |
| 454 | } |
| 455 | |
| 456 | /* Generate the "tags: TAGLIST" at the end of the comment, together |
| 457 | ** with hyperlinks to the tag list. |
| 458 | */ |
| @@ -527,23 +514,23 @@ | |
| 527 | } |
| 528 | continue; |
| 529 | } |
| 530 | if( isNew ){ |
| 531 | @ <li> %h(zFilename) (new file) |
| 532 | @ %z(href("%R/artifact/%S",zNew))[view]</a></li> |
| 533 | }else if( isDel ){ |
| 534 | @ <li> %h(zFilename) (deleted)</li> |
| 535 | }else if( fossil_strcmp(zOld,zNew)==0 && zOldName!=0 ){ |
| 536 | @ <li> %h(zOldName) → %h(zFilename) |
| 537 | @ %z(href("%R/artifact/%S",zNew))[view]</a></li> |
| 538 | }else{ |
| 539 | if( zOldName!=0 ){ |
| 540 | @ <li> %h(zOldName) → %h(zFilename) |
| 541 | }else{ |
| 542 | @ <li> %h(zFilename) |
| 543 | } |
| 544 | @ %z(href("%R/fdiff?v1=%S&v2=%S&sbs=1",zOld,zNew))[diff]</a></li> |
| 545 | } |
| 546 | } |
| 547 | db_reset(&fchngQuery); |
| 548 | if( inUl ){ |
| 549 | @ </ul> |
| @@ -1442,11 +1429,11 @@ | |
| 1442 | blob_appendf(&desc, "%d %ss", n, zEType); |
| 1443 | } |
| 1444 | if( zUses ){ |
| 1445 | char *zFilenames = names_of_file(zUses); |
| 1446 | blob_appendf(&desc, " using file %s version %z%S</a>", zFilenames, |
| 1447 | href("%R/artifact/%S",zUses), zUses); |
| 1448 | tmFlags |= TIMELINE_DISJOINT; |
| 1449 | } |
| 1450 | if( renameOnly ){ |
| 1451 | blob_appendf(&desc, " that contain filename changes"); |
| 1452 | tmFlags |= TIMELINE_DISJOINT|TIMELINE_FRENAMES; |
| @@ -1963,11 +1950,11 @@ | |
| 1963 | " AND blob.rid=c.cid" |
| 1964 | ); |
| 1965 | while( db_step(&q)==SQLITE_ROW ){ |
| 1966 | const char *zUuid = db_column_text(&q, 0); |
| 1967 | @ <li> |
| 1968 | @ <a href="%s(g.zTop)/timeline?p=%S(zUuid)&d=%S(zUuid)&unhide">%S(zUuid)</a> |
| 1969 | } |
| 1970 | db_finalize(&q); |
| 1971 | style_footer(); |
| 1972 | } |
| 1973 | |
| 1974 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -54,23 +54,10 @@ | |
| 54 | }else{ |
| 55 | @ <span class="timelineHistDsp">[%s(z)]</span> |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | /* |
| 60 | ** Generate a hyperlink to a date & time. |
| 61 | */ |
| 62 | void hyperlink_to_date(const char *zDate, const char *zSuffix){ |
| 63 | if( zSuffix==0 ) zSuffix = ""; |
| @@ -448,11 +435,11 @@ | |
| 435 | @ (user: %h(zDispUser)%s(zTagList?",":"\051") |
| 436 | } |
| 437 | |
| 438 | /* Generate a "detail" link for tags. */ |
| 439 | if( (zType[0]=='g' || zType[0]=='w' || zType[0]=='t') && g.perm.Hyperlink ){ |
| 440 | @ [%z(href("%R/info/%s",zUuid))details</a>] |
| 441 | } |
| 442 | |
| 443 | /* Generate the "tags: TAGLIST" at the end of the comment, together |
| 444 | ** with hyperlinks to the tag list. |
| 445 | */ |
| @@ -527,23 +514,23 @@ | |
| 514 | } |
| 515 | continue; |
| 516 | } |
| 517 | if( isNew ){ |
| 518 | @ <li> %h(zFilename) (new file) |
| 519 | @ %z(href("%R/artifact/%s",zNew))[view]</a></li> |
| 520 | }else if( isDel ){ |
| 521 | @ <li> %h(zFilename) (deleted)</li> |
| 522 | }else if( fossil_strcmp(zOld,zNew)==0 && zOldName!=0 ){ |
| 523 | @ <li> %h(zOldName) → %h(zFilename) |
| 524 | @ %z(href("%R/artifact/%s",zNew))[view]</a></li> |
| 525 | }else{ |
| 526 | if( zOldName!=0 ){ |
| 527 | @ <li> %h(zOldName) → %h(zFilename) |
| 528 | }else{ |
| 529 | @ <li> %h(zFilename) |
| 530 | } |
| 531 | @ %z(href("%R/fdiff?sbs=1&v1=%s&v2=%s",zOld,zNew))[diff]</a></li> |
| 532 | } |
| 533 | } |
| 534 | db_reset(&fchngQuery); |
| 535 | if( inUl ){ |
| 536 | @ </ul> |
| @@ -1442,11 +1429,11 @@ | |
| 1429 | blob_appendf(&desc, "%d %ss", n, zEType); |
| 1430 | } |
| 1431 | if( zUses ){ |
| 1432 | char *zFilenames = names_of_file(zUses); |
| 1433 | blob_appendf(&desc, " using file %s version %z%S</a>", zFilenames, |
| 1434 | href("%R/artifact/%s",zUses), zUses); |
| 1435 | tmFlags |= TIMELINE_DISJOINT; |
| 1436 | } |
| 1437 | if( renameOnly ){ |
| 1438 | blob_appendf(&desc, " that contain filename changes"); |
| 1439 | tmFlags |= TIMELINE_DISJOINT|TIMELINE_FRENAMES; |
| @@ -1963,11 +1950,11 @@ | |
| 1950 | " AND blob.rid=c.cid" |
| 1951 | ); |
| 1952 | while( db_step(&q)==SQLITE_ROW ){ |
| 1953 | const char *zUuid = db_column_text(&q, 0); |
| 1954 | @ <li> |
| 1955 | @ <a href="%s(g.zTop)/timeline?p=%s(zUuid)&d=%s(zUuid)&unhide">%S(zUuid)</a> |
| 1956 | } |
| 1957 | db_finalize(&q); |
| 1958 | style_footer(); |
| 1959 | } |
| 1960 | |
| 1961 |
+61
-61
| --- src/url.c | ||
| +++ src/url.c | ||
| @@ -275,22 +275,22 @@ | ||
| 275 | 275 | |
| 276 | 276 | /* |
| 277 | 277 | ** Parse the given URL, which describes a sync server. Populate variables |
| 278 | 278 | ** in the global "g" structure as follows: |
| 279 | 279 | ** |
| 280 | -** g.urlIsFile True if FILE: | |
| 281 | -** g.urlIsHttps True if HTTPS: | |
| 282 | -** g.urlIsSsh True if SSH: | |
| 283 | -** g.urlProtocol "http" or "https" or "file" | |
| 284 | -** g.urlName Hostname for HTTP:, HTTPS:, SSH:. Filename for FILE: | |
| 285 | -** g.urlPort TCP port number for HTTP or HTTPS. | |
| 286 | -** g.urlDfltPort Default TCP port number (80 or 443). | |
| 287 | -** g.urlPath Path name for HTTP or HTTPS. | |
| 288 | -** g.urlUser Userid. | |
| 289 | -** g.urlPasswd Password. | |
| 290 | -** g.urlHostname HOST:PORT or just HOST if port is the default. | |
| 291 | -** g.urlCanonical The URL in canonical form, omitting the password | |
| 280 | +** g.url.isFile True if FILE: | |
| 281 | +** g.url.isHttps True if HTTPS: | |
| 282 | +** g.url.isSsh True if SSH: | |
| 283 | +** g.url.protocol "http" or "https" or "file" | |
| 284 | +** g.url.name Hostname for HTTP:, HTTPS:, SSH:. Filename for FILE: | |
| 285 | +** g.url.port TCP port number for HTTP or HTTPS. | |
| 286 | +** g.url.dfltPort Default TCP port number (80 or 443). | |
| 287 | +** g.url.path Path name for HTTP or HTTPS. | |
| 288 | +** g.url.user Userid. | |
| 289 | +** g.url.passwd Password. | |
| 290 | +** g.url.hostname HOST:PORT or just HOST if port is the default. | |
| 291 | +** g.url.canonical The URL in canonical form, omitting the password | |
| 292 | 292 | ** |
| 293 | 293 | ** HTTP url format as follows (HTTPS is the same with a different scheme): |
| 294 | 294 | ** |
| 295 | 295 | ** http://userid:password@host:port/path |
| 296 | 296 | ** |
| @@ -298,11 +298,11 @@ | ||
| 298 | 298 | ** |
| 299 | 299 | ** ssh://userid@host:port/path?fossil=path/to/fossil.exe |
| 300 | 300 | ** |
| 301 | 301 | */ |
| 302 | 302 | void url_parse(const char *zUrl, unsigned int urlFlags){ |
| 303 | - url_parse_local(zUrl, urlFlags, GLOBAL_URL()); | |
| 303 | + url_parse_local(zUrl, urlFlags, &g.url); | |
| 304 | 304 | } |
| 305 | 305 | |
| 306 | 306 | /* |
| 307 | 307 | ** COMMAND: test-urlparser |
| 308 | 308 | ** |
| @@ -323,25 +323,25 @@ | ||
| 323 | 323 | if( g.argc!=3 && g.argc!=4 ){ |
| 324 | 324 | usage("URL"); |
| 325 | 325 | } |
| 326 | 326 | url_parse(g.argv[2], fg); |
| 327 | 327 | for(i=0; i<2; i++){ |
| 328 | - fossil_print("g.urlIsFile = %d\n", g.urlIsFile); | |
| 329 | - fossil_print("g.urlIsHttps = %d\n", g.urlIsHttps); | |
| 330 | - fossil_print("g.urlIsSsh = %d\n", g.urlIsSsh); | |
| 331 | - fossil_print("g.urlProtocol = %s\n", g.urlProtocol); | |
| 332 | - fossil_print("g.urlName = %s\n", g.urlName); | |
| 333 | - fossil_print("g.urlPort = %d\n", g.urlPort); | |
| 334 | - fossil_print("g.urlDfltPort = %d\n", g.urlDfltPort); | |
| 335 | - fossil_print("g.urlHostname = %s\n", g.urlHostname); | |
| 336 | - fossil_print("g.urlPath = %s\n", g.urlPath); | |
| 337 | - fossil_print("g.urlUser = %s\n", g.urlUser); | |
| 338 | - fossil_print("g.urlPasswd = %s\n", g.urlPasswd); | |
| 339 | - fossil_print("g.urlCanonical = %s\n", g.urlCanonical); | |
| 340 | - fossil_print("g.urlFossil = %s\n", g.urlFossil); | |
| 341 | - fossil_print("g.urlFlags = 0x%02x\n", g.urlFlags); | |
| 342 | - if( g.urlIsFile || g.urlIsSsh ) break; | |
| 328 | + fossil_print("g.url.isFile = %d\n", g.url.isFile); | |
| 329 | + fossil_print("g.url.isHttps = %d\n", g.url.isHttps); | |
| 330 | + fossil_print("g.url.isSsh = %d\n", g.url.isSsh); | |
| 331 | + fossil_print("g.url.protocol = %s\n", g.url.protocol); | |
| 332 | + fossil_print("g.url.name = %s\n", g.url.name); | |
| 333 | + fossil_print("g.url.port = %d\n", g.url.port); | |
| 334 | + fossil_print("g.url.dfltPort = %d\n", g.url.dfltPort); | |
| 335 | + fossil_print("g.url.hostname = %s\n", g.url.hostname); | |
| 336 | + fossil_print("g.url.path = %s\n", g.url.path); | |
| 337 | + fossil_print("g.url.user = %s\n", g.url.user); | |
| 338 | + fossil_print("g.url.passwd = %s\n", g.url.passwd); | |
| 339 | + fossil_print("g.url.canonical = %s\n", g.url.canonical); | |
| 340 | + fossil_print("g.url.fossil = %s\n", g.url.fossil); | |
| 341 | + fossil_print("g.url.flags = 0x%02x\n", g.url.flags); | |
| 342 | + if( g.url.isFile || g.url.isSsh ) break; | |
| 343 | 343 | if( i==0 ){ |
| 344 | 344 | fossil_print("********\n"); |
| 345 | 345 | url_enable_proxy("Using proxy: "); |
| 346 | 346 | } |
| 347 | 347 | } |
| @@ -385,38 +385,38 @@ | ||
| 385 | 385 | if( zProxy==0 || zProxy[0]==0 || is_truth(zProxy) ){ |
| 386 | 386 | zProxy = fossil_getenv("http_proxy"); |
| 387 | 387 | } |
| 388 | 388 | } |
| 389 | 389 | if( zProxy && zProxy[0] && !is_false(zProxy) |
| 390 | - && !g.urlIsSsh && !g.urlIsFile ){ | |
| 391 | - char *zOriginalUrl = g.urlCanonical; | |
| 392 | - char *zOriginalHost = g.urlHostname; | |
| 393 | - int fOriginalIsHttps = g.urlIsHttps; | |
| 394 | - char *zOriginalUser = g.urlUser; | |
| 395 | - char *zOriginalPasswd = g.urlPasswd; | |
| 396 | - char *zOriginalUrlPath = g.urlPath; | |
| 397 | - int iOriginalPort = g.urlPort; | |
| 398 | - unsigned uOriginalFlags = g.urlFlags; | |
| 399 | - g.urlUser = 0; | |
| 400 | - g.urlPasswd = ""; | |
| 390 | + && !g.url.isSsh && !g.url.isFile ){ | |
| 391 | + char *zOriginalUrl = g.url.canonical; | |
| 392 | + char *zOriginalHost = g.url.hostname; | |
| 393 | + int fOriginalIsHttps = g.url.isHttps; | |
| 394 | + char *zOriginalUser = g.url.user; | |
| 395 | + char *zOriginalPasswd = g.url.passwd; | |
| 396 | + char *zOriginalUrlPath = g.url.path; | |
| 397 | + int iOriginalPort = g.url.port; | |
| 398 | + unsigned uOriginalFlags = g.url.flags; | |
| 399 | + g.url.user = 0; | |
| 400 | + g.url.passwd = ""; | |
| 401 | 401 | url_parse(zProxy, 0); |
| 402 | - if( zMsg ) fossil_print("%s%s\n", zMsg, g.urlCanonical); | |
| 403 | - g.urlPath = zOriginalUrl; | |
| 404 | - g.urlHostname = zOriginalHost; | |
| 405 | - if( g.urlUser ){ | |
| 406 | - char *zCredentials1 = mprintf("%s:%s", g.urlUser, g.urlPasswd); | |
| 402 | + if( zMsg ) fossil_print("%s%s\n", zMsg, g.url.canonical); | |
| 403 | + g.url.path = zOriginalUrl; | |
| 404 | + g.url.hostname = zOriginalHost; | |
| 405 | + if( g.url.user ){ | |
| 406 | + char *zCredentials1 = mprintf("%s:%s", g.url.user, g.url.passwd); | |
| 407 | 407 | char *zCredentials2 = encode64(zCredentials1, -1); |
| 408 | - g.urlProxyAuth = mprintf("Basic %z", zCredentials2); | |
| 408 | + g.url.proxyAuth = mprintf("Basic %z", zCredentials2); | |
| 409 | 409 | free(zCredentials1); |
| 410 | 410 | } |
| 411 | - g.urlUser = zOriginalUser; | |
| 412 | - g.urlPasswd = zOriginalPasswd; | |
| 413 | - g.urlIsHttps = fOriginalIsHttps; | |
| 414 | - g.useProxy = 1; | |
| 415 | - g.proxyUrlPath = zOriginalUrlPath; | |
| 416 | - g.proxyOrigPort = iOriginalPort; | |
| 417 | - g.urlFlags = uOriginalFlags; | |
| 411 | + g.url.user = zOriginalUser; | |
| 412 | + g.url.passwd = zOriginalPasswd; | |
| 413 | + g.url.isHttps = fOriginalIsHttps; | |
| 414 | + g.url.useProxy = 1; | |
| 415 | + g.url.proxyUrlPath = zOriginalUrlPath; | |
| 416 | + g.url.proxyOrigPort = iOriginalPort; | |
| 417 | + g.url.flags = uOriginalFlags; | |
| 418 | 418 | } |
| 419 | 419 | } |
| 420 | 420 | |
| 421 | 421 | #if INTERFACE |
| 422 | 422 | /* |
| @@ -529,35 +529,35 @@ | ||
| 529 | 529 | pUrlData->user); |
| 530 | 530 | } |
| 531 | 531 | } |
| 532 | 532 | |
| 533 | 533 | /* |
| 534 | -** Prompt the user for the password for g.urlUser. Store the result | |
| 535 | -** in g.urlPasswd. | |
| 534 | +** Prompt the user for the password for g.url.user. Store the result | |
| 535 | +** in g.url.passwd. | |
| 536 | 536 | */ |
| 537 | 537 | void url_prompt_for_password(void){ |
| 538 | - url_prompt_for_password_local(GLOBAL_URL()); | |
| 538 | + url_prompt_for_password_local(&g.url); | |
| 539 | 539 | } |
| 540 | 540 | |
| 541 | 541 | /* |
| 542 | 542 | ** Remember the URL and password if requested. |
| 543 | 543 | */ |
| 544 | 544 | void url_remember(void){ |
| 545 | - if( g.urlFlags & URL_REMEMBER ){ | |
| 546 | - db_set("last-sync-url", g.urlCanonical, 0); | |
| 547 | - if( g.urlUser!=0 && g.urlPasswd!=0 && ( g.urlFlags & URL_REMEMBER_PW ) ){ | |
| 548 | - db_set("last-sync-pw", obscure(g.urlPasswd), 0); | |
| 545 | + if( g.url.flags & URL_REMEMBER ){ | |
| 546 | + db_set("last-sync-url", g.url.canonical, 0); | |
| 547 | + if( g.url.user!=0 && g.url.passwd!=0 && ( g.url.flags & URL_REMEMBER_PW ) ){ | |
| 548 | + db_set("last-sync-pw", obscure(g.url.passwd), 0); | |
| 549 | 549 | } |
| 550 | 550 | } |
| 551 | 551 | } |
| 552 | 552 | |
| 553 | 553 | /* Preemptively prompt for a password if a username is given in the |
| 554 | 554 | ** URL but no password. |
| 555 | 555 | */ |
| 556 | 556 | void url_get_password_if_needed(void){ |
| 557 | - if( (g.urlUser && g.urlUser[0]) | |
| 558 | - && (g.urlPasswd==0 || g.urlPasswd[0]==0) | |
| 557 | + if( (g.url.user && g.url.user[0]) | |
| 558 | + && (g.url.passwd==0 || g.url.passwd[0]==0) | |
| 559 | 559 | && isatty(fileno(stdin)) |
| 560 | 560 | ){ |
| 561 | 561 | url_prompt_for_password(); |
| 562 | 562 | } |
| 563 | 563 | } |
| 564 | 564 |
| --- src/url.c | |
| +++ src/url.c | |
| @@ -275,22 +275,22 @@ | |
| 275 | |
| 276 | /* |
| 277 | ** Parse the given URL, which describes a sync server. Populate variables |
| 278 | ** in the global "g" structure as follows: |
| 279 | ** |
| 280 | ** g.urlIsFile True if FILE: |
| 281 | ** g.urlIsHttps True if HTTPS: |
| 282 | ** g.urlIsSsh True if SSH: |
| 283 | ** g.urlProtocol "http" or "https" or "file" |
| 284 | ** g.urlName Hostname for HTTP:, HTTPS:, SSH:. Filename for FILE: |
| 285 | ** g.urlPort TCP port number for HTTP or HTTPS. |
| 286 | ** g.urlDfltPort Default TCP port number (80 or 443). |
| 287 | ** g.urlPath Path name for HTTP or HTTPS. |
| 288 | ** g.urlUser Userid. |
| 289 | ** g.urlPasswd Password. |
| 290 | ** g.urlHostname HOST:PORT or just HOST if port is the default. |
| 291 | ** g.urlCanonical The URL in canonical form, omitting the password |
| 292 | ** |
| 293 | ** HTTP url format as follows (HTTPS is the same with a different scheme): |
| 294 | ** |
| 295 | ** http://userid:password@host:port/path |
| 296 | ** |
| @@ -298,11 +298,11 @@ | |
| 298 | ** |
| 299 | ** ssh://userid@host:port/path?fossil=path/to/fossil.exe |
| 300 | ** |
| 301 | */ |
| 302 | void url_parse(const char *zUrl, unsigned int urlFlags){ |
| 303 | url_parse_local(zUrl, urlFlags, GLOBAL_URL()); |
| 304 | } |
| 305 | |
| 306 | /* |
| 307 | ** COMMAND: test-urlparser |
| 308 | ** |
| @@ -323,25 +323,25 @@ | |
| 323 | if( g.argc!=3 && g.argc!=4 ){ |
| 324 | usage("URL"); |
| 325 | } |
| 326 | url_parse(g.argv[2], fg); |
| 327 | for(i=0; i<2; i++){ |
| 328 | fossil_print("g.urlIsFile = %d\n", g.urlIsFile); |
| 329 | fossil_print("g.urlIsHttps = %d\n", g.urlIsHttps); |
| 330 | fossil_print("g.urlIsSsh = %d\n", g.urlIsSsh); |
| 331 | fossil_print("g.urlProtocol = %s\n", g.urlProtocol); |
| 332 | fossil_print("g.urlName = %s\n", g.urlName); |
| 333 | fossil_print("g.urlPort = %d\n", g.urlPort); |
| 334 | fossil_print("g.urlDfltPort = %d\n", g.urlDfltPort); |
| 335 | fossil_print("g.urlHostname = %s\n", g.urlHostname); |
| 336 | fossil_print("g.urlPath = %s\n", g.urlPath); |
| 337 | fossil_print("g.urlUser = %s\n", g.urlUser); |
| 338 | fossil_print("g.urlPasswd = %s\n", g.urlPasswd); |
| 339 | fossil_print("g.urlCanonical = %s\n", g.urlCanonical); |
| 340 | fossil_print("g.urlFossil = %s\n", g.urlFossil); |
| 341 | fossil_print("g.urlFlags = 0x%02x\n", g.urlFlags); |
| 342 | if( g.urlIsFile || g.urlIsSsh ) break; |
| 343 | if( i==0 ){ |
| 344 | fossil_print("********\n"); |
| 345 | url_enable_proxy("Using proxy: "); |
| 346 | } |
| 347 | } |
| @@ -385,38 +385,38 @@ | |
| 385 | if( zProxy==0 || zProxy[0]==0 || is_truth(zProxy) ){ |
| 386 | zProxy = fossil_getenv("http_proxy"); |
| 387 | } |
| 388 | } |
| 389 | if( zProxy && zProxy[0] && !is_false(zProxy) |
| 390 | && !g.urlIsSsh && !g.urlIsFile ){ |
| 391 | char *zOriginalUrl = g.urlCanonical; |
| 392 | char *zOriginalHost = g.urlHostname; |
| 393 | int fOriginalIsHttps = g.urlIsHttps; |
| 394 | char *zOriginalUser = g.urlUser; |
| 395 | char *zOriginalPasswd = g.urlPasswd; |
| 396 | char *zOriginalUrlPath = g.urlPath; |
| 397 | int iOriginalPort = g.urlPort; |
| 398 | unsigned uOriginalFlags = g.urlFlags; |
| 399 | g.urlUser = 0; |
| 400 | g.urlPasswd = ""; |
| 401 | url_parse(zProxy, 0); |
| 402 | if( zMsg ) fossil_print("%s%s\n", zMsg, g.urlCanonical); |
| 403 | g.urlPath = zOriginalUrl; |
| 404 | g.urlHostname = zOriginalHost; |
| 405 | if( g.urlUser ){ |
| 406 | char *zCredentials1 = mprintf("%s:%s", g.urlUser, g.urlPasswd); |
| 407 | char *zCredentials2 = encode64(zCredentials1, -1); |
| 408 | g.urlProxyAuth = mprintf("Basic %z", zCredentials2); |
| 409 | free(zCredentials1); |
| 410 | } |
| 411 | g.urlUser = zOriginalUser; |
| 412 | g.urlPasswd = zOriginalPasswd; |
| 413 | g.urlIsHttps = fOriginalIsHttps; |
| 414 | g.useProxy = 1; |
| 415 | g.proxyUrlPath = zOriginalUrlPath; |
| 416 | g.proxyOrigPort = iOriginalPort; |
| 417 | g.urlFlags = uOriginalFlags; |
| 418 | } |
| 419 | } |
| 420 | |
| 421 | #if INTERFACE |
| 422 | /* |
| @@ -529,35 +529,35 @@ | |
| 529 | pUrlData->user); |
| 530 | } |
| 531 | } |
| 532 | |
| 533 | /* |
| 534 | ** Prompt the user for the password for g.urlUser. Store the result |
| 535 | ** in g.urlPasswd. |
| 536 | */ |
| 537 | void url_prompt_for_password(void){ |
| 538 | url_prompt_for_password_local(GLOBAL_URL()); |
| 539 | } |
| 540 | |
| 541 | /* |
| 542 | ** Remember the URL and password if requested. |
| 543 | */ |
| 544 | void url_remember(void){ |
| 545 | if( g.urlFlags & URL_REMEMBER ){ |
| 546 | db_set("last-sync-url", g.urlCanonical, 0); |
| 547 | if( g.urlUser!=0 && g.urlPasswd!=0 && ( g.urlFlags & URL_REMEMBER_PW ) ){ |
| 548 | db_set("last-sync-pw", obscure(g.urlPasswd), 0); |
| 549 | } |
| 550 | } |
| 551 | } |
| 552 | |
| 553 | /* Preemptively prompt for a password if a username is given in the |
| 554 | ** URL but no password. |
| 555 | */ |
| 556 | void url_get_password_if_needed(void){ |
| 557 | if( (g.urlUser && g.urlUser[0]) |
| 558 | && (g.urlPasswd==0 || g.urlPasswd[0]==0) |
| 559 | && isatty(fileno(stdin)) |
| 560 | ){ |
| 561 | url_prompt_for_password(); |
| 562 | } |
| 563 | } |
| 564 |
| --- src/url.c | |
| +++ src/url.c | |
| @@ -275,22 +275,22 @@ | |
| 275 | |
| 276 | /* |
| 277 | ** Parse the given URL, which describes a sync server. Populate variables |
| 278 | ** in the global "g" structure as follows: |
| 279 | ** |
| 280 | ** g.url.isFile True if FILE: |
| 281 | ** g.url.isHttps True if HTTPS: |
| 282 | ** g.url.isSsh True if SSH: |
| 283 | ** g.url.protocol "http" or "https" or "file" |
| 284 | ** g.url.name Hostname for HTTP:, HTTPS:, SSH:. Filename for FILE: |
| 285 | ** g.url.port TCP port number for HTTP or HTTPS. |
| 286 | ** g.url.dfltPort Default TCP port number (80 or 443). |
| 287 | ** g.url.path Path name for HTTP or HTTPS. |
| 288 | ** g.url.user Userid. |
| 289 | ** g.url.passwd Password. |
| 290 | ** g.url.hostname HOST:PORT or just HOST if port is the default. |
| 291 | ** g.url.canonical The URL in canonical form, omitting the password |
| 292 | ** |
| 293 | ** HTTP url format as follows (HTTPS is the same with a different scheme): |
| 294 | ** |
| 295 | ** http://userid:password@host:port/path |
| 296 | ** |
| @@ -298,11 +298,11 @@ | |
| 298 | ** |
| 299 | ** ssh://userid@host:port/path?fossil=path/to/fossil.exe |
| 300 | ** |
| 301 | */ |
| 302 | void url_parse(const char *zUrl, unsigned int urlFlags){ |
| 303 | url_parse_local(zUrl, urlFlags, &g.url); |
| 304 | } |
| 305 | |
| 306 | /* |
| 307 | ** COMMAND: test-urlparser |
| 308 | ** |
| @@ -323,25 +323,25 @@ | |
| 323 | if( g.argc!=3 && g.argc!=4 ){ |
| 324 | usage("URL"); |
| 325 | } |
| 326 | url_parse(g.argv[2], fg); |
| 327 | for(i=0; i<2; i++){ |
| 328 | fossil_print("g.url.isFile = %d\n", g.url.isFile); |
| 329 | fossil_print("g.url.isHttps = %d\n", g.url.isHttps); |
| 330 | fossil_print("g.url.isSsh = %d\n", g.url.isSsh); |
| 331 | fossil_print("g.url.protocol = %s\n", g.url.protocol); |
| 332 | fossil_print("g.url.name = %s\n", g.url.name); |
| 333 | fossil_print("g.url.port = %d\n", g.url.port); |
| 334 | fossil_print("g.url.dfltPort = %d\n", g.url.dfltPort); |
| 335 | fossil_print("g.url.hostname = %s\n", g.url.hostname); |
| 336 | fossil_print("g.url.path = %s\n", g.url.path); |
| 337 | fossil_print("g.url.user = %s\n", g.url.user); |
| 338 | fossil_print("g.url.passwd = %s\n", g.url.passwd); |
| 339 | fossil_print("g.url.canonical = %s\n", g.url.canonical); |
| 340 | fossil_print("g.url.fossil = %s\n", g.url.fossil); |
| 341 | fossil_print("g.url.flags = 0x%02x\n", g.url.flags); |
| 342 | if( g.url.isFile || g.url.isSsh ) break; |
| 343 | if( i==0 ){ |
| 344 | fossil_print("********\n"); |
| 345 | url_enable_proxy("Using proxy: "); |
| 346 | } |
| 347 | } |
| @@ -385,38 +385,38 @@ | |
| 385 | if( zProxy==0 || zProxy[0]==0 || is_truth(zProxy) ){ |
| 386 | zProxy = fossil_getenv("http_proxy"); |
| 387 | } |
| 388 | } |
| 389 | if( zProxy && zProxy[0] && !is_false(zProxy) |
| 390 | && !g.url.isSsh && !g.url.isFile ){ |
| 391 | char *zOriginalUrl = g.url.canonical; |
| 392 | char *zOriginalHost = g.url.hostname; |
| 393 | int fOriginalIsHttps = g.url.isHttps; |
| 394 | char *zOriginalUser = g.url.user; |
| 395 | char *zOriginalPasswd = g.url.passwd; |
| 396 | char *zOriginalUrlPath = g.url.path; |
| 397 | int iOriginalPort = g.url.port; |
| 398 | unsigned uOriginalFlags = g.url.flags; |
| 399 | g.url.user = 0; |
| 400 | g.url.passwd = ""; |
| 401 | url_parse(zProxy, 0); |
| 402 | if( zMsg ) fossil_print("%s%s\n", zMsg, g.url.canonical); |
| 403 | g.url.path = zOriginalUrl; |
| 404 | g.url.hostname = zOriginalHost; |
| 405 | if( g.url.user ){ |
| 406 | char *zCredentials1 = mprintf("%s:%s", g.url.user, g.url.passwd); |
| 407 | char *zCredentials2 = encode64(zCredentials1, -1); |
| 408 | g.url.proxyAuth = mprintf("Basic %z", zCredentials2); |
| 409 | free(zCredentials1); |
| 410 | } |
| 411 | g.url.user = zOriginalUser; |
| 412 | g.url.passwd = zOriginalPasswd; |
| 413 | g.url.isHttps = fOriginalIsHttps; |
| 414 | g.url.useProxy = 1; |
| 415 | g.url.proxyUrlPath = zOriginalUrlPath; |
| 416 | g.url.proxyOrigPort = iOriginalPort; |
| 417 | g.url.flags = uOriginalFlags; |
| 418 | } |
| 419 | } |
| 420 | |
| 421 | #if INTERFACE |
| 422 | /* |
| @@ -529,35 +529,35 @@ | |
| 529 | pUrlData->user); |
| 530 | } |
| 531 | } |
| 532 | |
| 533 | /* |
| 534 | ** Prompt the user for the password for g.url.user. Store the result |
| 535 | ** in g.url.passwd. |
| 536 | */ |
| 537 | void url_prompt_for_password(void){ |
| 538 | url_prompt_for_password_local(&g.url); |
| 539 | } |
| 540 | |
| 541 | /* |
| 542 | ** Remember the URL and password if requested. |
| 543 | */ |
| 544 | void url_remember(void){ |
| 545 | if( g.url.flags & URL_REMEMBER ){ |
| 546 | db_set("last-sync-url", g.url.canonical, 0); |
| 547 | if( g.url.user!=0 && g.url.passwd!=0 && ( g.url.flags & URL_REMEMBER_PW ) ){ |
| 548 | db_set("last-sync-pw", obscure(g.url.passwd), 0); |
| 549 | } |
| 550 | } |
| 551 | } |
| 552 | |
| 553 | /* Preemptively prompt for a password if a username is given in the |
| 554 | ** URL but no password. |
| 555 | */ |
| 556 | void url_get_password_if_needed(void){ |
| 557 | if( (g.url.user && g.url.user[0]) |
| 558 | && (g.url.passwd==0 || g.url.passwd[0]==0) |
| 559 | && isatty(fileno(stdin)) |
| 560 | ){ |
| 561 | url_prompt_for_password(); |
| 562 | } |
| 563 | } |
| 564 |
+1
-1
| --- src/user.c | ||
| +++ src/user.c | ||
| @@ -375,11 +375,11 @@ | ||
| 375 | 375 | if( attempt_user(fossil_getenv("LOGNAME")) ) return; |
| 376 | 376 | |
| 377 | 377 | if( attempt_user(fossil_getenv("USERNAME")) ) return; |
| 378 | 378 | |
| 379 | 379 | url_parse(0, 0); |
| 380 | - if( g.urlUser && attempt_user(g.urlUser) ) return; | |
| 380 | + if( g.url.user && attempt_user(g.url.user) ) return; | |
| 381 | 381 | |
| 382 | 382 | fossil_print( |
| 383 | 383 | "Cannot figure out who you are! Consider using the --user\n" |
| 384 | 384 | "command line option, setting your USER environment variable,\n" |
| 385 | 385 | "or setting a default user with \"fossil user default USER\".\n" |
| 386 | 386 |
| --- src/user.c | |
| +++ src/user.c | |
| @@ -375,11 +375,11 @@ | |
| 375 | if( attempt_user(fossil_getenv("LOGNAME")) ) return; |
| 376 | |
| 377 | if( attempt_user(fossil_getenv("USERNAME")) ) return; |
| 378 | |
| 379 | url_parse(0, 0); |
| 380 | if( g.urlUser && attempt_user(g.urlUser) ) return; |
| 381 | |
| 382 | fossil_print( |
| 383 | "Cannot figure out who you are! Consider using the --user\n" |
| 384 | "command line option, setting your USER environment variable,\n" |
| 385 | "or setting a default user with \"fossil user default USER\".\n" |
| 386 |
| --- src/user.c | |
| +++ src/user.c | |
| @@ -375,11 +375,11 @@ | |
| 375 | if( attempt_user(fossil_getenv("LOGNAME")) ) return; |
| 376 | |
| 377 | if( attempt_user(fossil_getenv("USERNAME")) ) return; |
| 378 | |
| 379 | url_parse(0, 0); |
| 380 | if( g.url.user && attempt_user(g.url.user) ) return; |
| 381 | |
| 382 | fossil_print( |
| 383 | "Cannot figure out who you are! Consider using the --user\n" |
| 384 | "command line option, setting your USER environment variable,\n" |
| 385 | "or setting a default user with \"fossil user default USER\".\n" |
| 386 |
+6
-6
| --- src/xfer.c | ||
| +++ src/xfer.c | ||
| @@ -1375,11 +1375,11 @@ | ||
| 1375 | 1375 | static double fossil_fabs(double x){ |
| 1376 | 1376 | return x>0.0 ? x : -x; |
| 1377 | 1377 | } |
| 1378 | 1378 | |
| 1379 | 1379 | /* |
| 1380 | -** Sync to the host identified in g.urlName and g.urlPath. This | |
| 1380 | +** Sync to the host identified in g.url.name and g.url.path. This | |
| 1381 | 1381 | ** routine is called by the client. |
| 1382 | 1382 | ** |
| 1383 | 1383 | ** Records are pushed to the server if pushFlag is true. Records |
| 1384 | 1384 | ** are pulled if pullFlag is true. A full sync occurs if both are |
| 1385 | 1385 | ** true. |
| @@ -1823,15 +1823,15 @@ | ||
| 1823 | 1823 | defossilize(zMsg); |
| 1824 | 1824 | fossil_force_newline(); |
| 1825 | 1825 | fossil_print("Error: %s\n", zMsg); |
| 1826 | 1826 | if( fossil_strcmp(zMsg, "login failed")==0 ){ |
| 1827 | 1827 | if( nCycle<2 ){ |
| 1828 | - g.urlPasswd = 0; | |
| 1828 | + g.url.passwd = 0; | |
| 1829 | 1829 | go = 1; |
| 1830 | 1830 | if( g.cgiOutput==0 ){ |
| 1831 | - g.urlFlags |= URL_PROMPT_PW; | |
| 1832 | - g.urlFlags &= ~URL_PROMPTED; | |
| 1831 | + g.url.flags |= URL_PROMPT_PW; | |
| 1832 | + g.url.flags &= ~URL_PROMPTED; | |
| 1833 | 1833 | url_prompt_for_password(); |
| 1834 | 1834 | url_remember(); |
| 1835 | 1835 | } |
| 1836 | 1836 | } |
| 1837 | 1837 | }else{ |
| @@ -1926,13 +1926,13 @@ | ||
| 1926 | 1926 | |
| 1927 | 1927 | fossil_force_newline(); |
| 1928 | 1928 | fossil_print( |
| 1929 | 1929 | "%s finished with %lld bytes sent, %lld bytes received\n", |
| 1930 | 1930 | zOpType, nSent, nRcvd); |
| 1931 | - transport_close(GLOBAL_URL()); | |
| 1932 | - transport_global_shutdown(GLOBAL_URL()); | |
| 1931 | + transport_close(&g.url); | |
| 1932 | + transport_global_shutdown(&g.url); | |
| 1933 | 1933 | db_multi_exec("DROP TABLE onremote"); |
| 1934 | 1934 | manifest_crosslink_end(MC_PERMIT_HOOKS); |
| 1935 | 1935 | content_enable_dephantomize(1); |
| 1936 | 1936 | db_end_transaction(0); |
| 1937 | 1937 | return nErr; |
| 1938 | 1938 | } |
| 1939 | 1939 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -1375,11 +1375,11 @@ | |
| 1375 | static double fossil_fabs(double x){ |
| 1376 | return x>0.0 ? x : -x; |
| 1377 | } |
| 1378 | |
| 1379 | /* |
| 1380 | ** Sync to the host identified in g.urlName and g.urlPath. This |
| 1381 | ** routine is called by the client. |
| 1382 | ** |
| 1383 | ** Records are pushed to the server if pushFlag is true. Records |
| 1384 | ** are pulled if pullFlag is true. A full sync occurs if both are |
| 1385 | ** true. |
| @@ -1823,15 +1823,15 @@ | |
| 1823 | defossilize(zMsg); |
| 1824 | fossil_force_newline(); |
| 1825 | fossil_print("Error: %s\n", zMsg); |
| 1826 | if( fossil_strcmp(zMsg, "login failed")==0 ){ |
| 1827 | if( nCycle<2 ){ |
| 1828 | g.urlPasswd = 0; |
| 1829 | go = 1; |
| 1830 | if( g.cgiOutput==0 ){ |
| 1831 | g.urlFlags |= URL_PROMPT_PW; |
| 1832 | g.urlFlags &= ~URL_PROMPTED; |
| 1833 | url_prompt_for_password(); |
| 1834 | url_remember(); |
| 1835 | } |
| 1836 | } |
| 1837 | }else{ |
| @@ -1926,13 +1926,13 @@ | |
| 1926 | |
| 1927 | fossil_force_newline(); |
| 1928 | fossil_print( |
| 1929 | "%s finished with %lld bytes sent, %lld bytes received\n", |
| 1930 | zOpType, nSent, nRcvd); |
| 1931 | transport_close(GLOBAL_URL()); |
| 1932 | transport_global_shutdown(GLOBAL_URL()); |
| 1933 | db_multi_exec("DROP TABLE onremote"); |
| 1934 | manifest_crosslink_end(MC_PERMIT_HOOKS); |
| 1935 | content_enable_dephantomize(1); |
| 1936 | db_end_transaction(0); |
| 1937 | return nErr; |
| 1938 | } |
| 1939 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -1375,11 +1375,11 @@ | |
| 1375 | static double fossil_fabs(double x){ |
| 1376 | return x>0.0 ? x : -x; |
| 1377 | } |
| 1378 | |
| 1379 | /* |
| 1380 | ** Sync to the host identified in g.url.name and g.url.path. This |
| 1381 | ** routine is called by the client. |
| 1382 | ** |
| 1383 | ** Records are pushed to the server if pushFlag is true. Records |
| 1384 | ** are pulled if pullFlag is true. A full sync occurs if both are |
| 1385 | ** true. |
| @@ -1823,15 +1823,15 @@ | |
| 1823 | defossilize(zMsg); |
| 1824 | fossil_force_newline(); |
| 1825 | fossil_print("Error: %s\n", zMsg); |
| 1826 | if( fossil_strcmp(zMsg, "login failed")==0 ){ |
| 1827 | if( nCycle<2 ){ |
| 1828 | g.url.passwd = 0; |
| 1829 | go = 1; |
| 1830 | if( g.cgiOutput==0 ){ |
| 1831 | g.url.flags |= URL_PROMPT_PW; |
| 1832 | g.url.flags &= ~URL_PROMPTED; |
| 1833 | url_prompt_for_password(); |
| 1834 | url_remember(); |
| 1835 | } |
| 1836 | } |
| 1837 | }else{ |
| @@ -1926,13 +1926,13 @@ | |
| 1926 | |
| 1927 | fossil_force_newline(); |
| 1928 | fossil_print( |
| 1929 | "%s finished with %lld bytes sent, %lld bytes received\n", |
| 1930 | zOpType, nSent, nRcvd); |
| 1931 | transport_close(&g.url); |
| 1932 | transport_global_shutdown(&g.url); |
| 1933 | db_multi_exec("DROP TABLE onremote"); |
| 1934 | manifest_crosslink_end(MC_PERMIT_HOOKS); |
| 1935 | content_enable_dephantomize(1); |
| 1936 | db_end_transaction(0); |
| 1937 | return nErr; |
| 1938 | } |
| 1939 |
+3
-3
| --- src/xfersetup.c | ||
| +++ src/xfersetup.c | ||
| @@ -44,11 +44,11 @@ | ||
| 44 | 44 | setup_menu_entry("Ticket", "xfersetup_ticket", |
| 45 | 45 | "Specific TH1 code to run after processing a ticket change."); |
| 46 | 46 | @ </table> |
| 47 | 47 | |
| 48 | 48 | url_parse(0, 0); |
| 49 | - if( g.urlProtocol ){ | |
| 49 | + if( g.url.protocol ){ | |
| 50 | 50 | unsigned syncFlags; |
| 51 | 51 | const char *zButton; |
| 52 | 52 | char *zWarning; |
| 53 | 53 | |
| 54 | 54 | if( db_get_boolean("dont-push", 0) ){ |
| @@ -57,19 +57,19 @@ | ||
| 57 | 57 | zWarning = 0; |
| 58 | 58 | }else{ |
| 59 | 59 | syncFlags = SYNC_PUSH | SYNC_PULL; |
| 60 | 60 | zButton = "Synchronize"; |
| 61 | 61 | zWarning = mprintf("WARNING: Pushing to \"%s\" is enabled.", |
| 62 | - g.urlCanonical); | |
| 62 | + g.url.canonical); | |
| 63 | 63 | } |
| 64 | 64 | if( P("sync") ){ |
| 65 | 65 | user_select(); |
| 66 | 66 | url_enable_proxy(0); |
| 67 | 67 | client_sync(syncFlags, 0, 0); |
| 68 | 68 | } |
| 69 | 69 | @ <p>Press the %h(zButton) button below to synchronize with the |
| 70 | - @ "%h(g.urlCanonical)" repository now. This may be useful when | |
| 70 | + @ "%h(g.url.canonical)" repository now. This may be useful when | |
| 71 | 71 | @ testing the various transfer scripts.</p> |
| 72 | 72 | @ <p>You can use the "http -async" command in your scripts, but |
| 73 | 73 | @ make sure the "th1-uri-regexp" setting is set first.</p> |
| 74 | 74 | if( zWarning ){ |
| 75 | 75 | @ |
| 76 | 76 |
| --- src/xfersetup.c | |
| +++ src/xfersetup.c | |
| @@ -44,11 +44,11 @@ | |
| 44 | setup_menu_entry("Ticket", "xfersetup_ticket", |
| 45 | "Specific TH1 code to run after processing a ticket change."); |
| 46 | @ </table> |
| 47 | |
| 48 | url_parse(0, 0); |
| 49 | if( g.urlProtocol ){ |
| 50 | unsigned syncFlags; |
| 51 | const char *zButton; |
| 52 | char *zWarning; |
| 53 | |
| 54 | if( db_get_boolean("dont-push", 0) ){ |
| @@ -57,19 +57,19 @@ | |
| 57 | zWarning = 0; |
| 58 | }else{ |
| 59 | syncFlags = SYNC_PUSH | SYNC_PULL; |
| 60 | zButton = "Synchronize"; |
| 61 | zWarning = mprintf("WARNING: Pushing to \"%s\" is enabled.", |
| 62 | g.urlCanonical); |
| 63 | } |
| 64 | if( P("sync") ){ |
| 65 | user_select(); |
| 66 | url_enable_proxy(0); |
| 67 | client_sync(syncFlags, 0, 0); |
| 68 | } |
| 69 | @ <p>Press the %h(zButton) button below to synchronize with the |
| 70 | @ "%h(g.urlCanonical)" repository now. This may be useful when |
| 71 | @ testing the various transfer scripts.</p> |
| 72 | @ <p>You can use the "http -async" command in your scripts, but |
| 73 | @ make sure the "th1-uri-regexp" setting is set first.</p> |
| 74 | if( zWarning ){ |
| 75 | @ |
| 76 |
| --- src/xfersetup.c | |
| +++ src/xfersetup.c | |
| @@ -44,11 +44,11 @@ | |
| 44 | setup_menu_entry("Ticket", "xfersetup_ticket", |
| 45 | "Specific TH1 code to run after processing a ticket change."); |
| 46 | @ </table> |
| 47 | |
| 48 | url_parse(0, 0); |
| 49 | if( g.url.protocol ){ |
| 50 | unsigned syncFlags; |
| 51 | const char *zButton; |
| 52 | char *zWarning; |
| 53 | |
| 54 | if( db_get_boolean("dont-push", 0) ){ |
| @@ -57,19 +57,19 @@ | |
| 57 | zWarning = 0; |
| 58 | }else{ |
| 59 | syncFlags = SYNC_PUSH | SYNC_PULL; |
| 60 | zButton = "Synchronize"; |
| 61 | zWarning = mprintf("WARNING: Pushing to \"%s\" is enabled.", |
| 62 | g.url.canonical); |
| 63 | } |
| 64 | if( P("sync") ){ |
| 65 | user_select(); |
| 66 | url_enable_proxy(0); |
| 67 | client_sync(syncFlags, 0, 0); |
| 68 | } |
| 69 | @ <p>Press the %h(zButton) button below to synchronize with the |
| 70 | @ "%h(g.url.canonical)" repository now. This may be useful when |
| 71 | @ testing the various transfer scripts.</p> |
| 72 | @ <p>You can use the "http -async" command in your scripts, but |
| 73 | @ make sure the "th1-uri-regexp" setting is set first.</p> |
| 74 | if( zWarning ){ |
| 75 | @ |
| 76 |