Fossil SCM
Merge with trunk
Commit
96c0c68a86f5847d313ad7f6e08623d8ce656e0b
Parent
a9407bc82f35033…
10 files changed
+1
-1
+2
+2
+2
+1
-1
+8
-15
+22
-2
+2
+19
-9
+2
-5
M
Makefile
+1
-1
| --- Makefile | ||
| +++ Makefile | ||
| @@ -7,11 +7,11 @@ | ||
| 7 | 7 | SRCDIR = ./src |
| 8 | 8 | |
| 9 | 9 | #### The directory into which object code files should be written. |
| 10 | 10 | # |
| 11 | 11 | # |
| 12 | -OBJDIR = ./obj | |
| 12 | +OBJDIR = ./bld | |
| 13 | 13 | |
| 14 | 14 | #### C Compiler and options for use in building executables that |
| 15 | 15 | # will run on the platform that is doing the build. This is used |
| 16 | 16 | # to compile code-generator programs as part of the build process. |
| 17 | 17 | # See TCC below for the C compiler for building the finished binary. |
| 18 | 18 |
| --- Makefile | |
| +++ Makefile | |
| @@ -7,11 +7,11 @@ | |
| 7 | SRCDIR = ./src |
| 8 | |
| 9 | #### The directory into which object code files should be written. |
| 10 | # |
| 11 | # |
| 12 | OBJDIR = ./obj |
| 13 | |
| 14 | #### C Compiler and options for use in building executables that |
| 15 | # will run on the platform that is doing the build. This is used |
| 16 | # to compile code-generator programs as part of the build process. |
| 17 | # See TCC below for the C compiler for building the finished binary. |
| 18 |
| --- Makefile | |
| +++ Makefile | |
| @@ -7,11 +7,11 @@ | |
| 7 | SRCDIR = ./src |
| 8 | |
| 9 | #### The directory into which object code files should be written. |
| 10 | # |
| 11 | # |
| 12 | OBJDIR = ./bld |
| 13 | |
| 14 | #### C Compiler and options for use in building executables that |
| 15 | # will run on the platform that is doing the build. This is used |
| 16 | # to compile code-generator programs as part of the build process. |
| 17 | # See TCC below for the C compiler for building the finished binary. |
| 18 |
M
src/db.c
+2
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -1031,12 +1031,14 @@ | ||
| 1031 | 1031 | } |
| 1032 | 1032 | } |
| 1033 | 1033 | |
| 1034 | 1034 | /* |
| 1035 | 1035 | ** COMMAND: new |
| 1036 | +** COMMAND: init | |
| 1036 | 1037 | ** |
| 1037 | 1038 | ** Usage: %fossil new ?OPTIONS? FILENAME |
| 1039 | +** Or: %fossil init ?OPTIONS? FILENAME | |
| 1038 | 1040 | ** |
| 1039 | 1041 | ** Create a repository for a new project in the file named FILENAME. |
| 1040 | 1042 | ** This command is distinct from "clone". The "clone" command makes |
| 1041 | 1043 | ** a copy of an existing project. This command starts a new project. |
| 1042 | 1044 | ** |
| 1043 | 1045 | |
| 1044 | 1046 | ADDED src/export.c |
| 1045 | 1047 | ADDED src/import.c |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -1031,12 +1031,14 @@ | |
| 1031 | } |
| 1032 | } |
| 1033 | |
| 1034 | /* |
| 1035 | ** COMMAND: new |
| 1036 | ** |
| 1037 | ** Usage: %fossil new ?OPTIONS? FILENAME |
| 1038 | ** |
| 1039 | ** Create a repository for a new project in the file named FILENAME. |
| 1040 | ** This command is distinct from "clone". The "clone" command makes |
| 1041 | ** a copy of an existing project. This command starts a new project. |
| 1042 | ** |
| 1043 | |
| 1044 | DDED src/export.c |
| 1045 | DDED src/import.c |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -1031,12 +1031,14 @@ | |
| 1031 | } |
| 1032 | } |
| 1033 | |
| 1034 | /* |
| 1035 | ** COMMAND: new |
| 1036 | ** COMMAND: init |
| 1037 | ** |
| 1038 | ** Usage: %fossil new ?OPTIONS? FILENAME |
| 1039 | ** Or: %fossil init ?OPTIONS? FILENAME |
| 1040 | ** |
| 1041 | ** Create a repository for a new project in the file named FILENAME. |
| 1042 | ** This command is distinct from "clone". The "clone" command makes |
| 1043 | ** a copy of an existing project. This command starts a new project. |
| 1044 | ** |
| 1045 | |
| 1046 | DDED src/export.c |
| 1047 | DDED src/import.c |
+2
| --- a/src/export.c | ||
| +++ b/src/export.c | ||
| @@ -0,0 +1,2 @@ | ||
| 1 | + destroy Git "fast-import" formator wiki | |
| 2 | +**at is0);1 |
| --- a/src/export.c | |
| +++ b/src/export.c | |
| @@ -0,0 +1,2 @@ | |
| --- a/src/export.c | |
| +++ b/src/export.c | |
| @@ -0,0 +1,2 @@ | |
| 1 | destroy Git "fast-import" formator wiki |
| 2 | **at is0);1 |
+2
| --- a/src/import.c | ||
| +++ b/src/import.c | ||
| @@ -0,0 +1,2 @@ | ||
| 1 | +gsvz/* TBD... */char zLine[1000]; | |
| 2 | +mprintf("%s", mprintf("%s", fossil_fatal("no |
| --- a/src/import.c | |
| +++ b/src/import.c | |
| @@ -0,0 +1,2 @@ | |
| --- a/src/import.c | |
| +++ b/src/import.c | |
| @@ -0,0 +1,2 @@ | |
| 1 | gsvz/* TBD... */char zLine[1000]; |
| 2 | mprintf("%s", mprintf("%s", fossil_fatal("no |
+1
-1
| --- src/login.c | ||
| +++ src/login.c | ||
| @@ -458,11 +458,11 @@ | ||
| 458 | 458 | if( g.zLogin && once ){ |
| 459 | 459 | const char *zCap; |
| 460 | 460 | /* All logged-in users inherit privileges from "nobody" */ |
| 461 | 461 | zCap = db_text("", "SELECT cap FROM user WHERE login = 'nobody'"); |
| 462 | 462 | login_set_capabilities(zCap); |
| 463 | - if( strcmp(g.zLogin, "anonymous")!=0 ){ | |
| 463 | + if( strcmp(g.zLogin, "nobody")!=0 ){ | |
| 464 | 464 | /* All logged-in users inherit privileges from "anonymous" */ |
| 465 | 465 | zCap = db_text("", "SELECT cap FROM user WHERE login = 'anonymous'"); |
| 466 | 466 | login_set_capabilities(zCap); |
| 467 | 467 | } |
| 468 | 468 | once = 0; |
| 469 | 469 |
| --- src/login.c | |
| +++ src/login.c | |
| @@ -458,11 +458,11 @@ | |
| 458 | if( g.zLogin && once ){ |
| 459 | const char *zCap; |
| 460 | /* All logged-in users inherit privileges from "nobody" */ |
| 461 | zCap = db_text("", "SELECT cap FROM user WHERE login = 'nobody'"); |
| 462 | login_set_capabilities(zCap); |
| 463 | if( strcmp(g.zLogin, "anonymous")!=0 ){ |
| 464 | /* All logged-in users inherit privileges from "anonymous" */ |
| 465 | zCap = db_text("", "SELECT cap FROM user WHERE login = 'anonymous'"); |
| 466 | login_set_capabilities(zCap); |
| 467 | } |
| 468 | once = 0; |
| 469 |
| --- src/login.c | |
| +++ src/login.c | |
| @@ -458,11 +458,11 @@ | |
| 458 | if( g.zLogin && once ){ |
| 459 | const char *zCap; |
| 460 | /* All logged-in users inherit privileges from "nobody" */ |
| 461 | zCap = db_text("", "SELECT cap FROM user WHERE login = 'nobody'"); |
| 462 | login_set_capabilities(zCap); |
| 463 | if( strcmp(g.zLogin, "nobody")!=0 ){ |
| 464 | /* All logged-in users inherit privileges from "anonymous" */ |
| 465 | zCap = db_text("", "SELECT cap FROM user WHERE login = 'anonymous'"); |
| 466 | login_set_capabilities(zCap); |
| 467 | } |
| 468 | once = 0; |
| 469 |
+8
-15
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -223,39 +223,32 @@ | ||
| 223 | 223 | */ |
| 224 | 224 | int main(int argc, char **argv){ |
| 225 | 225 | const char *zCmdName = "unknown"; |
| 226 | 226 | int idx; |
| 227 | 227 | int rc; |
| 228 | - int mightBeCgi; | |
| 229 | 228 | |
| 230 | 229 | sqlite3_config(SQLITE_CONFIG_LOG, fossil_sqlite_log, 0); |
| 231 | 230 | g.now = time(0); |
| 232 | 231 | g.argc = argc; |
| 233 | 232 | g.argv = argv; |
| 234 | - mightBeCgi = getenv("GATEWAY_INTERFACE")!=0; | |
| 235 | - if( argc<2 ){ | |
| 236 | - if( mightBeCgi ){ | |
| 237 | - zCmdName = "cgi"; | |
| 238 | - }else{ | |
| 239 | - fprintf(stderr, "Usage: %s COMMAND ...\n" | |
| 240 | - "\"%s help\" for a list of available commands\n" | |
| 241 | - "\"%s help COMMAND\" for specific details\n", | |
| 242 | - argv[0], argv[0], argv[0]); | |
| 243 | - fossil_exit(1); | |
| 244 | - } | |
| 233 | + if( getenv("GATEWAY_INTERFACE")!=0 && !find_option("nocgi", 0, 0)){ | |
| 234 | + zCmdName = "cgi"; | |
| 235 | + }else if( argc<2 ){ | |
| 236 | + fprintf(stderr, "Usage: %s COMMAND ...\n" | |
| 237 | + "\"%s help\" for a list of available commands\n" | |
| 238 | + "\"%s help COMMAND\" for specific details\n", | |
| 239 | + argv[0], argv[0], argv[0]); | |
| 240 | + fossil_exit(1); | |
| 245 | 241 | }else{ |
| 246 | 242 | g.fQuiet = find_option("quiet", 0, 0)!=0; |
| 247 | 243 | g.fSqlTrace = find_option("sqltrace", 0, 0)!=0; |
| 248 | 244 | g.fSqlPrint = find_option("sqlprint", 0, 0)!=0; |
| 249 | 245 | g.fHttpTrace = find_option("httptrace", 0, 0)!=0; |
| 250 | 246 | g.zLogin = find_option("user", "U", 1); |
| 251 | 247 | zCmdName = argv[1]; |
| 252 | 248 | } |
| 253 | 249 | rc = name_search(zCmdName, aCommand, count(aCommand), &idx); |
| 254 | - if( rc==1 && mightBeCgi ){ | |
| 255 | - rc = name_search("cgi", aCommand, count(aCommand), &idx); | |
| 256 | - } | |
| 257 | 250 | if( rc==1 ){ |
| 258 | 251 | fprintf(stderr,"%s: unknown command: %s\n" |
| 259 | 252 | "%s: use \"help\" for more information\n", |
| 260 | 253 | argv[0], zCmdName, argv[0]); |
| 261 | 254 | fossil_exit(1); |
| 262 | 255 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -223,39 +223,32 @@ | |
| 223 | */ |
| 224 | int main(int argc, char **argv){ |
| 225 | const char *zCmdName = "unknown"; |
| 226 | int idx; |
| 227 | int rc; |
| 228 | int mightBeCgi; |
| 229 | |
| 230 | sqlite3_config(SQLITE_CONFIG_LOG, fossil_sqlite_log, 0); |
| 231 | g.now = time(0); |
| 232 | g.argc = argc; |
| 233 | g.argv = argv; |
| 234 | mightBeCgi = getenv("GATEWAY_INTERFACE")!=0; |
| 235 | if( argc<2 ){ |
| 236 | if( mightBeCgi ){ |
| 237 | zCmdName = "cgi"; |
| 238 | }else{ |
| 239 | fprintf(stderr, "Usage: %s COMMAND ...\n" |
| 240 | "\"%s help\" for a list of available commands\n" |
| 241 | "\"%s help COMMAND\" for specific details\n", |
| 242 | argv[0], argv[0], argv[0]); |
| 243 | fossil_exit(1); |
| 244 | } |
| 245 | }else{ |
| 246 | g.fQuiet = find_option("quiet", 0, 0)!=0; |
| 247 | g.fSqlTrace = find_option("sqltrace", 0, 0)!=0; |
| 248 | g.fSqlPrint = find_option("sqlprint", 0, 0)!=0; |
| 249 | g.fHttpTrace = find_option("httptrace", 0, 0)!=0; |
| 250 | g.zLogin = find_option("user", "U", 1); |
| 251 | zCmdName = argv[1]; |
| 252 | } |
| 253 | rc = name_search(zCmdName, aCommand, count(aCommand), &idx); |
| 254 | if( rc==1 && mightBeCgi ){ |
| 255 | rc = name_search("cgi", aCommand, count(aCommand), &idx); |
| 256 | } |
| 257 | if( rc==1 ){ |
| 258 | fprintf(stderr,"%s: unknown command: %s\n" |
| 259 | "%s: use \"help\" for more information\n", |
| 260 | argv[0], zCmdName, argv[0]); |
| 261 | fossil_exit(1); |
| 262 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -223,39 +223,32 @@ | |
| 223 | */ |
| 224 | int main(int argc, char **argv){ |
| 225 | const char *zCmdName = "unknown"; |
| 226 | int idx; |
| 227 | int rc; |
| 228 | |
| 229 | sqlite3_config(SQLITE_CONFIG_LOG, fossil_sqlite_log, 0); |
| 230 | g.now = time(0); |
| 231 | g.argc = argc; |
| 232 | g.argv = argv; |
| 233 | if( getenv("GATEWAY_INTERFACE")!=0 && !find_option("nocgi", 0, 0)){ |
| 234 | zCmdName = "cgi"; |
| 235 | }else if( argc<2 ){ |
| 236 | fprintf(stderr, "Usage: %s COMMAND ...\n" |
| 237 | "\"%s help\" for a list of available commands\n" |
| 238 | "\"%s help COMMAND\" for specific details\n", |
| 239 | argv[0], argv[0], argv[0]); |
| 240 | fossil_exit(1); |
| 241 | }else{ |
| 242 | g.fQuiet = find_option("quiet", 0, 0)!=0; |
| 243 | g.fSqlTrace = find_option("sqltrace", 0, 0)!=0; |
| 244 | g.fSqlPrint = find_option("sqlprint", 0, 0)!=0; |
| 245 | g.fHttpTrace = find_option("httptrace", 0, 0)!=0; |
| 246 | g.zLogin = find_option("user", "U", 1); |
| 247 | zCmdName = argv[1]; |
| 248 | } |
| 249 | rc = name_search(zCmdName, aCommand, count(aCommand), &idx); |
| 250 | if( rc==1 ){ |
| 251 | fprintf(stderr,"%s: unknown command: %s\n" |
| 252 | "%s: use \"help\" for more information\n", |
| 253 | argv[0], zCmdName, argv[0]); |
| 254 | fossil_exit(1); |
| 255 |
+22
-2
| --- src/main.mk | ||
| +++ src/main.mk | ||
| @@ -36,17 +36,19 @@ | ||
| 36 | 36 | $(SRCDIR)/diff.c \ |
| 37 | 37 | $(SRCDIR)/diffcmd.c \ |
| 38 | 38 | $(SRCDIR)/doc.c \ |
| 39 | 39 | $(SRCDIR)/encode.c \ |
| 40 | 40 | $(SRCDIR)/event.c \ |
| 41 | + $(SRCDIR)/export.c \ | |
| 41 | 42 | $(SRCDIR)/file.c \ |
| 42 | 43 | $(SRCDIR)/finfo.c \ |
| 43 | 44 | $(SRCDIR)/graph.c \ |
| 44 | 45 | $(SRCDIR)/http.c \ |
| 45 | 46 | $(SRCDIR)/http_socket.c \ |
| 46 | 47 | $(SRCDIR)/http_ssl.c \ |
| 47 | 48 | $(SRCDIR)/http_transport.c \ |
| 49 | + $(SRCDIR)/import.c \ | |
| 48 | 50 | $(SRCDIR)/info.c \ |
| 49 | 51 | $(SRCDIR)/login.c \ |
| 50 | 52 | $(SRCDIR)/main.c \ |
| 51 | 53 | $(SRCDIR)/manifest.c \ |
| 52 | 54 | $(SRCDIR)/md5.c \ |
| @@ -110,17 +112,19 @@ | ||
| 110 | 112 | diff_.c \ |
| 111 | 113 | diffcmd_.c \ |
| 112 | 114 | doc_.c \ |
| 113 | 115 | encode_.c \ |
| 114 | 116 | event_.c \ |
| 117 | + export_.c \ | |
| 115 | 118 | file_.c \ |
| 116 | 119 | finfo_.c \ |
| 117 | 120 | graph_.c \ |
| 118 | 121 | http_.c \ |
| 119 | 122 | http_socket_.c \ |
| 120 | 123 | http_ssl_.c \ |
| 121 | 124 | http_transport_.c \ |
| 125 | + import_.c \ | |
| 122 | 126 | info_.c \ |
| 123 | 127 | login_.c \ |
| 124 | 128 | main_.c \ |
| 125 | 129 | manifest_.c \ |
| 126 | 130 | md5_.c \ |
| @@ -184,17 +188,19 @@ | ||
| 184 | 188 | $(OBJDIR)/diff.o \ |
| 185 | 189 | $(OBJDIR)/diffcmd.o \ |
| 186 | 190 | $(OBJDIR)/doc.o \ |
| 187 | 191 | $(OBJDIR)/encode.o \ |
| 188 | 192 | $(OBJDIR)/event.o \ |
| 193 | + $(OBJDIR)/export.o \ | |
| 189 | 194 | $(OBJDIR)/file.o \ |
| 190 | 195 | $(OBJDIR)/finfo.o \ |
| 191 | 196 | $(OBJDIR)/graph.o \ |
| 192 | 197 | $(OBJDIR)/http.o \ |
| 193 | 198 | $(OBJDIR)/http_socket.o \ |
| 194 | 199 | $(OBJDIR)/http_ssl.o \ |
| 195 | 200 | $(OBJDIR)/http_transport.o \ |
| 201 | + $(OBJDIR)/import.o \ | |
| 196 | 202 | $(OBJDIR)/info.o \ |
| 197 | 203 | $(OBJDIR)/login.o \ |
| 198 | 204 | $(OBJDIR)/main.o \ |
| 199 | 205 | $(OBJDIR)/manifest.o \ |
| 200 | 206 | $(OBJDIR)/md5.o \ |
| @@ -278,16 +284,16 @@ | ||
| 278 | 284 | # noop |
| 279 | 285 | |
| 280 | 286 | clean: |
| 281 | 287 | rm -f $(OBJDIR)/*.o *_.c $(APPNAME) VERSION.h |
| 282 | 288 | rm -f translate makeheaders mkindex page_index.h headers |
| 283 | - rm -f add.h allrepo.h attach.h bag.h blob.h branch.h browse.h captcha.h cgi.h checkin.h checkout.h clearsign.h clone.h comformat.h configure.h content.h db.h delta.h deltacmd.h descendants.h diff.h diffcmd.h doc.h encode.h event.h file.h finfo.h graph.h http.h http_socket.h http_ssl.h http_transport.h info.h login.h main.h manifest.h md5.h merge.h merge3.h name.h pivot.h popen.h pqueue.h printf.h rebuild.h report.h rss.h schema.h search.h setup.h sha1.h shun.h skins.h stat.h style.h sync.h tag.h th_main.h timeline.h tkt.h tktsetup.h undo.h update.h url.h user.h verify.h vfile.h wiki.h wikiformat.h winhttp.h xfer.h zip.h | |
| 289 | + rm -f add.h allrepo.h attach.h bag.h blob.h branch.h browse.h captcha.h cgi.h checkin.h checkout.h clearsign.h clone.h comformat.h configure.h content.h db.h delta.h deltacmd.h descendants.h diff.h diffcmd.h doc.h encode.h event.h export.h file.h finfo.h graph.h http.h http_socket.h http_ssl.h http_transport.h import.h info.h login.h main.h manifest.h md5.h merge.h merge3.h name.h pivot.h popen.h pqueue.h printf.h rebuild.h report.h rss.h schema.h search.h setup.h sha1.h shun.h skins.h stat.h style.h sync.h tag.h th_main.h timeline.h tkt.h tktsetup.h undo.h update.h url.h user.h verify.h vfile.h wiki.h wikiformat.h winhttp.h xfer.h zip.h | |
| 284 | 290 | |
| 285 | 291 | page_index.h: $(TRANS_SRC) mkindex |
| 286 | 292 | ./mkindex $(TRANS_SRC) >$@ |
| 287 | 293 | headers: page_index.h makeheaders VERSION.h |
| 288 | - ./makeheaders add_.c:add.h allrepo_.c:allrepo.h attach_.c:attach.h bag_.c:bag.h blob_.c:blob.h branch_.c:branch.h browse_.c:browse.h captcha_.c:captcha.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h configure_.c:configure.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendants_.c:descendants.h diff_.c:diff.h diffcmd_.c:diffcmd.h doc_.c:doc.h encode_.c:encode.h event_.c:event.h file_.c:file.h finfo_.c:finfo.h graph_.c:graph.h http_.c:http.h http_socket_.c:http_socket.h http_ssl_.c:http_ssl.h http_transport_.c:http_transport.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h popen_.c:popen.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h report_.c:report.h rss_.c:rss.h schema_.c:schema.h search_.c:search.h setup_.c:setup.h sha1_.c:sha1.h shun_.c:shun.h skins_.c:skins.h stat_.c:stat.h style_.c:style.h sync_.c:sync.h tag_.c:tag.h th_main_.c:th_main.h timeline_.c:timeline.h tkt_.c:tkt.h tktsetup_.c:tktsetup.h undo_.c:undo.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h winhttp_.c:winhttp.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h $(SRCDIR)/th.h VERSION.h | |
| 294 | + ./makeheaders add_.c:add.h allrepo_.c:allrepo.h attach_.c:attach.h bag_.c:bag.h blob_.c:blob.h branch_.c:branch.h browse_.c:browse.h captcha_.c:captcha.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h configure_.c:configure.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendants_.c:descendants.h diff_.c:diff.h diffcmd_.c:diffcmd.h doc_.c:doc.h encode_.c:encode.h event_.c:event.h export_.c:export.h file_.c:file.h finfo_.c:finfo.h graph_.c:graph.h http_.c:http.h http_socket_.c:http_socket.h http_ssl_.c:http_ssl.h http_transport_.c:http_transport.h import_.c:import.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h popen_.c:popen.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h report_.c:report.h rss_.c:rss.h schema_.c:schema.h search_.c:search.h setup_.c:setup.h sha1_.c:sha1.h shun_.c:shun.h skins_.c:skins.h stat_.c:stat.h style_.c:style.h sync_.c:sync.h tag_.c:tag.h th_main_.c:th_main.h timeline_.c:timeline.h tkt_.c:tkt.h tktsetup_.c:tktsetup.h undo_.c:undo.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h winhttp_.c:winhttp.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h $(SRCDIR)/th.h VERSION.h | |
| 289 | 295 | touch headers |
| 290 | 296 | headers: Makefile |
| 291 | 297 | Makefile: |
| 292 | 298 | add_.c: $(SRCDIR)/add.c translate |
| 293 | 299 | ./translate $(SRCDIR)/add.c >add_.c |
| @@ -462,10 +468,17 @@ | ||
| 462 | 468 | |
| 463 | 469 | $(OBJDIR)/event.o: event_.c event.h $(SRCDIR)/config.h |
| 464 | 470 | $(XTCC) -o $(OBJDIR)/event.o -c event_.c |
| 465 | 471 | |
| 466 | 472 | event.h: headers |
| 473 | +export_.c: $(SRCDIR)/export.c translate | |
| 474 | + ./translate $(SRCDIR)/export.c >export_.c | |
| 475 | + | |
| 476 | +$(OBJDIR)/export.o: export_.c export.h $(SRCDIR)/config.h | |
| 477 | + $(XTCC) -o $(OBJDIR)/export.o -c export_.c | |
| 478 | + | |
| 479 | +export.h: headers | |
| 467 | 480 | file_.c: $(SRCDIR)/file.c translate |
| 468 | 481 | ./translate $(SRCDIR)/file.c >file_.c |
| 469 | 482 | |
| 470 | 483 | $(OBJDIR)/file.o: file_.c file.h $(SRCDIR)/config.h |
| 471 | 484 | $(XTCC) -o $(OBJDIR)/file.o -c file_.c |
| @@ -511,10 +524,17 @@ | ||
| 511 | 524 | |
| 512 | 525 | $(OBJDIR)/http_transport.o: http_transport_.c http_transport.h $(SRCDIR)/config.h |
| 513 | 526 | $(XTCC) -o $(OBJDIR)/http_transport.o -c http_transport_.c |
| 514 | 527 | |
| 515 | 528 | http_transport.h: headers |
| 529 | +import_.c: $(SRCDIR)/import.c translate | |
| 530 | + ./translate $(SRCDIR)/import.c >import_.c | |
| 531 | + | |
| 532 | +$(OBJDIR)/import.o: import_.c import.h $(SRCDIR)/config.h | |
| 533 | + $(XTCC) -o $(OBJDIR)/import.o -c import_.c | |
| 534 | + | |
| 535 | +import.h: headers | |
| 516 | 536 | info_.c: $(SRCDIR)/info.c translate |
| 517 | 537 | ./translate $(SRCDIR)/info.c >info_.c |
| 518 | 538 | |
| 519 | 539 | $(OBJDIR)/info.o: info_.c info.h $(SRCDIR)/config.h |
| 520 | 540 | $(XTCC) -o $(OBJDIR)/info.o -c info_.c |
| 521 | 541 |
| --- src/main.mk | |
| +++ src/main.mk | |
| @@ -36,17 +36,19 @@ | |
| 36 | $(SRCDIR)/diff.c \ |
| 37 | $(SRCDIR)/diffcmd.c \ |
| 38 | $(SRCDIR)/doc.c \ |
| 39 | $(SRCDIR)/encode.c \ |
| 40 | $(SRCDIR)/event.c \ |
| 41 | $(SRCDIR)/file.c \ |
| 42 | $(SRCDIR)/finfo.c \ |
| 43 | $(SRCDIR)/graph.c \ |
| 44 | $(SRCDIR)/http.c \ |
| 45 | $(SRCDIR)/http_socket.c \ |
| 46 | $(SRCDIR)/http_ssl.c \ |
| 47 | $(SRCDIR)/http_transport.c \ |
| 48 | $(SRCDIR)/info.c \ |
| 49 | $(SRCDIR)/login.c \ |
| 50 | $(SRCDIR)/main.c \ |
| 51 | $(SRCDIR)/manifest.c \ |
| 52 | $(SRCDIR)/md5.c \ |
| @@ -110,17 +112,19 @@ | |
| 110 | diff_.c \ |
| 111 | diffcmd_.c \ |
| 112 | doc_.c \ |
| 113 | encode_.c \ |
| 114 | event_.c \ |
| 115 | file_.c \ |
| 116 | finfo_.c \ |
| 117 | graph_.c \ |
| 118 | http_.c \ |
| 119 | http_socket_.c \ |
| 120 | http_ssl_.c \ |
| 121 | http_transport_.c \ |
| 122 | info_.c \ |
| 123 | login_.c \ |
| 124 | main_.c \ |
| 125 | manifest_.c \ |
| 126 | md5_.c \ |
| @@ -184,17 +188,19 @@ | |
| 184 | $(OBJDIR)/diff.o \ |
| 185 | $(OBJDIR)/diffcmd.o \ |
| 186 | $(OBJDIR)/doc.o \ |
| 187 | $(OBJDIR)/encode.o \ |
| 188 | $(OBJDIR)/event.o \ |
| 189 | $(OBJDIR)/file.o \ |
| 190 | $(OBJDIR)/finfo.o \ |
| 191 | $(OBJDIR)/graph.o \ |
| 192 | $(OBJDIR)/http.o \ |
| 193 | $(OBJDIR)/http_socket.o \ |
| 194 | $(OBJDIR)/http_ssl.o \ |
| 195 | $(OBJDIR)/http_transport.o \ |
| 196 | $(OBJDIR)/info.o \ |
| 197 | $(OBJDIR)/login.o \ |
| 198 | $(OBJDIR)/main.o \ |
| 199 | $(OBJDIR)/manifest.o \ |
| 200 | $(OBJDIR)/md5.o \ |
| @@ -278,16 +284,16 @@ | |
| 278 | # noop |
| 279 | |
| 280 | clean: |
| 281 | rm -f $(OBJDIR)/*.o *_.c $(APPNAME) VERSION.h |
| 282 | rm -f translate makeheaders mkindex page_index.h headers |
| 283 | rm -f add.h allrepo.h attach.h bag.h blob.h branch.h browse.h captcha.h cgi.h checkin.h checkout.h clearsign.h clone.h comformat.h configure.h content.h db.h delta.h deltacmd.h descendants.h diff.h diffcmd.h doc.h encode.h event.h file.h finfo.h graph.h http.h http_socket.h http_ssl.h http_transport.h info.h login.h main.h manifest.h md5.h merge.h merge3.h name.h pivot.h popen.h pqueue.h printf.h rebuild.h report.h rss.h schema.h search.h setup.h sha1.h shun.h skins.h stat.h style.h sync.h tag.h th_main.h timeline.h tkt.h tktsetup.h undo.h update.h url.h user.h verify.h vfile.h wiki.h wikiformat.h winhttp.h xfer.h zip.h |
| 284 | |
| 285 | page_index.h: $(TRANS_SRC) mkindex |
| 286 | ./mkindex $(TRANS_SRC) >$@ |
| 287 | headers: page_index.h makeheaders VERSION.h |
| 288 | ./makeheaders add_.c:add.h allrepo_.c:allrepo.h attach_.c:attach.h bag_.c:bag.h blob_.c:blob.h branch_.c:branch.h browse_.c:browse.h captcha_.c:captcha.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h configure_.c:configure.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendants_.c:descendants.h diff_.c:diff.h diffcmd_.c:diffcmd.h doc_.c:doc.h encode_.c:encode.h event_.c:event.h file_.c:file.h finfo_.c:finfo.h graph_.c:graph.h http_.c:http.h http_socket_.c:http_socket.h http_ssl_.c:http_ssl.h http_transport_.c:http_transport.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h popen_.c:popen.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h report_.c:report.h rss_.c:rss.h schema_.c:schema.h search_.c:search.h setup_.c:setup.h sha1_.c:sha1.h shun_.c:shun.h skins_.c:skins.h stat_.c:stat.h style_.c:style.h sync_.c:sync.h tag_.c:tag.h th_main_.c:th_main.h timeline_.c:timeline.h tkt_.c:tkt.h tktsetup_.c:tktsetup.h undo_.c:undo.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h winhttp_.c:winhttp.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h $(SRCDIR)/th.h VERSION.h |
| 289 | touch headers |
| 290 | headers: Makefile |
| 291 | Makefile: |
| 292 | add_.c: $(SRCDIR)/add.c translate |
| 293 | ./translate $(SRCDIR)/add.c >add_.c |
| @@ -462,10 +468,17 @@ | |
| 462 | |
| 463 | $(OBJDIR)/event.o: event_.c event.h $(SRCDIR)/config.h |
| 464 | $(XTCC) -o $(OBJDIR)/event.o -c event_.c |
| 465 | |
| 466 | event.h: headers |
| 467 | file_.c: $(SRCDIR)/file.c translate |
| 468 | ./translate $(SRCDIR)/file.c >file_.c |
| 469 | |
| 470 | $(OBJDIR)/file.o: file_.c file.h $(SRCDIR)/config.h |
| 471 | $(XTCC) -o $(OBJDIR)/file.o -c file_.c |
| @@ -511,10 +524,17 @@ | |
| 511 | |
| 512 | $(OBJDIR)/http_transport.o: http_transport_.c http_transport.h $(SRCDIR)/config.h |
| 513 | $(XTCC) -o $(OBJDIR)/http_transport.o -c http_transport_.c |
| 514 | |
| 515 | http_transport.h: headers |
| 516 | info_.c: $(SRCDIR)/info.c translate |
| 517 | ./translate $(SRCDIR)/info.c >info_.c |
| 518 | |
| 519 | $(OBJDIR)/info.o: info_.c info.h $(SRCDIR)/config.h |
| 520 | $(XTCC) -o $(OBJDIR)/info.o -c info_.c |
| 521 |
| --- src/main.mk | |
| +++ src/main.mk | |
| @@ -36,17 +36,19 @@ | |
| 36 | $(SRCDIR)/diff.c \ |
| 37 | $(SRCDIR)/diffcmd.c \ |
| 38 | $(SRCDIR)/doc.c \ |
| 39 | $(SRCDIR)/encode.c \ |
| 40 | $(SRCDIR)/event.c \ |
| 41 | $(SRCDIR)/export.c \ |
| 42 | $(SRCDIR)/file.c \ |
| 43 | $(SRCDIR)/finfo.c \ |
| 44 | $(SRCDIR)/graph.c \ |
| 45 | $(SRCDIR)/http.c \ |
| 46 | $(SRCDIR)/http_socket.c \ |
| 47 | $(SRCDIR)/http_ssl.c \ |
| 48 | $(SRCDIR)/http_transport.c \ |
| 49 | $(SRCDIR)/import.c \ |
| 50 | $(SRCDIR)/info.c \ |
| 51 | $(SRCDIR)/login.c \ |
| 52 | $(SRCDIR)/main.c \ |
| 53 | $(SRCDIR)/manifest.c \ |
| 54 | $(SRCDIR)/md5.c \ |
| @@ -110,17 +112,19 @@ | |
| 112 | diff_.c \ |
| 113 | diffcmd_.c \ |
| 114 | doc_.c \ |
| 115 | encode_.c \ |
| 116 | event_.c \ |
| 117 | export_.c \ |
| 118 | file_.c \ |
| 119 | finfo_.c \ |
| 120 | graph_.c \ |
| 121 | http_.c \ |
| 122 | http_socket_.c \ |
| 123 | http_ssl_.c \ |
| 124 | http_transport_.c \ |
| 125 | import_.c \ |
| 126 | info_.c \ |
| 127 | login_.c \ |
| 128 | main_.c \ |
| 129 | manifest_.c \ |
| 130 | md5_.c \ |
| @@ -184,17 +188,19 @@ | |
| 188 | $(OBJDIR)/diff.o \ |
| 189 | $(OBJDIR)/diffcmd.o \ |
| 190 | $(OBJDIR)/doc.o \ |
| 191 | $(OBJDIR)/encode.o \ |
| 192 | $(OBJDIR)/event.o \ |
| 193 | $(OBJDIR)/export.o \ |
| 194 | $(OBJDIR)/file.o \ |
| 195 | $(OBJDIR)/finfo.o \ |
| 196 | $(OBJDIR)/graph.o \ |
| 197 | $(OBJDIR)/http.o \ |
| 198 | $(OBJDIR)/http_socket.o \ |
| 199 | $(OBJDIR)/http_ssl.o \ |
| 200 | $(OBJDIR)/http_transport.o \ |
| 201 | $(OBJDIR)/import.o \ |
| 202 | $(OBJDIR)/info.o \ |
| 203 | $(OBJDIR)/login.o \ |
| 204 | $(OBJDIR)/main.o \ |
| 205 | $(OBJDIR)/manifest.o \ |
| 206 | $(OBJDIR)/md5.o \ |
| @@ -278,16 +284,16 @@ | |
| 284 | # noop |
| 285 | |
| 286 | clean: |
| 287 | rm -f $(OBJDIR)/*.o *_.c $(APPNAME) VERSION.h |
| 288 | rm -f translate makeheaders mkindex page_index.h headers |
| 289 | rm -f add.h allrepo.h attach.h bag.h blob.h branch.h browse.h captcha.h cgi.h checkin.h checkout.h clearsign.h clone.h comformat.h configure.h content.h db.h delta.h deltacmd.h descendants.h diff.h diffcmd.h doc.h encode.h event.h export.h file.h finfo.h graph.h http.h http_socket.h http_ssl.h http_transport.h import.h info.h login.h main.h manifest.h md5.h merge.h merge3.h name.h pivot.h popen.h pqueue.h printf.h rebuild.h report.h rss.h schema.h search.h setup.h sha1.h shun.h skins.h stat.h style.h sync.h tag.h th_main.h timeline.h tkt.h tktsetup.h undo.h update.h url.h user.h verify.h vfile.h wiki.h wikiformat.h winhttp.h xfer.h zip.h |
| 290 | |
| 291 | page_index.h: $(TRANS_SRC) mkindex |
| 292 | ./mkindex $(TRANS_SRC) >$@ |
| 293 | headers: page_index.h makeheaders VERSION.h |
| 294 | ./makeheaders add_.c:add.h allrepo_.c:allrepo.h attach_.c:attach.h bag_.c:bag.h blob_.c:blob.h branch_.c:branch.h browse_.c:browse.h captcha_.c:captcha.h cgi_.c:cgi.h checkin_.c:checkin.h checkout_.c:checkout.h clearsign_.c:clearsign.h clone_.c:clone.h comformat_.c:comformat.h configure_.c:configure.h content_.c:content.h db_.c:db.h delta_.c:delta.h deltacmd_.c:deltacmd.h descendants_.c:descendants.h diff_.c:diff.h diffcmd_.c:diffcmd.h doc_.c:doc.h encode_.c:encode.h event_.c:event.h export_.c:export.h file_.c:file.h finfo_.c:finfo.h graph_.c:graph.h http_.c:http.h http_socket_.c:http_socket.h http_ssl_.c:http_ssl.h http_transport_.c:http_transport.h import_.c:import.h info_.c:info.h login_.c:login.h main_.c:main.h manifest_.c:manifest.h md5_.c:md5.h merge_.c:merge.h merge3_.c:merge3.h name_.c:name.h pivot_.c:pivot.h popen_.c:popen.h pqueue_.c:pqueue.h printf_.c:printf.h rebuild_.c:rebuild.h report_.c:report.h rss_.c:rss.h schema_.c:schema.h search_.c:search.h setup_.c:setup.h sha1_.c:sha1.h shun_.c:shun.h skins_.c:skins.h stat_.c:stat.h style_.c:style.h sync_.c:sync.h tag_.c:tag.h th_main_.c:th_main.h timeline_.c:timeline.h tkt_.c:tkt.h tktsetup_.c:tktsetup.h undo_.c:undo.h update_.c:update.h url_.c:url.h user_.c:user.h verify_.c:verify.h vfile_.c:vfile.h wiki_.c:wiki.h wikiformat_.c:wikiformat.h winhttp_.c:winhttp.h xfer_.c:xfer.h zip_.c:zip.h $(SRCDIR)/sqlite3.h $(SRCDIR)/th.h VERSION.h |
| 295 | touch headers |
| 296 | headers: Makefile |
| 297 | Makefile: |
| 298 | add_.c: $(SRCDIR)/add.c translate |
| 299 | ./translate $(SRCDIR)/add.c >add_.c |
| @@ -462,10 +468,17 @@ | |
| 468 | |
| 469 | $(OBJDIR)/event.o: event_.c event.h $(SRCDIR)/config.h |
| 470 | $(XTCC) -o $(OBJDIR)/event.o -c event_.c |
| 471 | |
| 472 | event.h: headers |
| 473 | export_.c: $(SRCDIR)/export.c translate |
| 474 | ./translate $(SRCDIR)/export.c >export_.c |
| 475 | |
| 476 | $(OBJDIR)/export.o: export_.c export.h $(SRCDIR)/config.h |
| 477 | $(XTCC) -o $(OBJDIR)/export.o -c export_.c |
| 478 | |
| 479 | export.h: headers |
| 480 | file_.c: $(SRCDIR)/file.c translate |
| 481 | ./translate $(SRCDIR)/file.c >file_.c |
| 482 | |
| 483 | $(OBJDIR)/file.o: file_.c file.h $(SRCDIR)/config.h |
| 484 | $(XTCC) -o $(OBJDIR)/file.o -c file_.c |
| @@ -511,10 +524,17 @@ | |
| 524 | |
| 525 | $(OBJDIR)/http_transport.o: http_transport_.c http_transport.h $(SRCDIR)/config.h |
| 526 | $(XTCC) -o $(OBJDIR)/http_transport.o -c http_transport_.c |
| 527 | |
| 528 | http_transport.h: headers |
| 529 | import_.c: $(SRCDIR)/import.c translate |
| 530 | ./translate $(SRCDIR)/import.c >import_.c |
| 531 | |
| 532 | $(OBJDIR)/import.o: import_.c import.h $(SRCDIR)/config.h |
| 533 | $(XTCC) -o $(OBJDIR)/import.o -c import_.c |
| 534 | |
| 535 | import.h: headers |
| 536 | info_.c: $(SRCDIR)/info.c translate |
| 537 | ./translate $(SRCDIR)/info.c >info_.c |
| 538 | |
| 539 | $(OBJDIR)/info.o: info_.c info.h $(SRCDIR)/config.h |
| 540 | $(XTCC) -o $(OBJDIR)/info.o -c info_.c |
| 541 |
+2
| --- src/makemake.tcl | ||
| +++ src/makemake.tcl | ||
| @@ -30,16 +30,18 @@ | ||
| 30 | 30 | diff |
| 31 | 31 | diffcmd |
| 32 | 32 | doc |
| 33 | 33 | encode |
| 34 | 34 | event |
| 35 | + export | |
| 35 | 36 | file |
| 36 | 37 | finfo |
| 37 | 38 | graph |
| 38 | 39 | http |
| 39 | 40 | http_socket |
| 40 | 41 | http_transport |
| 42 | + import | |
| 41 | 43 | info |
| 42 | 44 | login |
| 43 | 45 | main |
| 44 | 46 | manifest |
| 45 | 47 | md5 |
| 46 | 48 |
| --- src/makemake.tcl | |
| +++ src/makemake.tcl | |
| @@ -30,16 +30,18 @@ | |
| 30 | diff |
| 31 | diffcmd |
| 32 | doc |
| 33 | encode |
| 34 | event |
| 35 | file |
| 36 | finfo |
| 37 | graph |
| 38 | http |
| 39 | http_socket |
| 40 | http_transport |
| 41 | info |
| 42 | login |
| 43 | main |
| 44 | manifest |
| 45 | md5 |
| 46 |
| --- src/makemake.tcl | |
| +++ src/makemake.tcl | |
| @@ -30,16 +30,18 @@ | |
| 30 | diff |
| 31 | diffcmd |
| 32 | doc |
| 33 | encode |
| 34 | event |
| 35 | export |
| 36 | file |
| 37 | finfo |
| 38 | graph |
| 39 | http |
| 40 | http_socket |
| 41 | http_transport |
| 42 | import |
| 43 | info |
| 44 | login |
| 45 | main |
| 46 | manifest |
| 47 | md5 |
| 48 |
+19
-9
| --- src/vfile.c | ||
| +++ src/vfile.c | ||
| @@ -24,10 +24,28 @@ | ||
| 24 | 24 | #if defined(__DMC__) |
| 25 | 25 | #include "dirent.h" |
| 26 | 26 | #else |
| 27 | 27 | #include <dirent.h> |
| 28 | 28 | #endif |
| 29 | + | |
| 30 | +/* | |
| 31 | +** The input is guaranteed to be a 40-character well-formed UUID. | |
| 32 | +** Find its rid. | |
| 33 | +*/ | |
| 34 | +int fast_uuid_to_rid(const char *zUuid){ | |
| 35 | + static Stmt q; | |
| 36 | + int rid; | |
| 37 | + db_static_prepare(&q, "SELECT rid FROM blob WHERE uuid=:uuid"); | |
| 38 | + db_bind_text(&q, ":uuid", zUuid); | |
| 39 | + if( db_step(&q)==SQLITE_ROW ){ | |
| 40 | + rid = db_column_int(&q, 0); | |
| 41 | + }else{ | |
| 42 | + rid = 0; | |
| 43 | + } | |
| 44 | + db_reset(&q); | |
| 45 | + return rid; | |
| 46 | +} | |
| 29 | 47 | |
| 30 | 48 | /* |
| 31 | 49 | ** Given a UUID, return the corresponding record ID. If the UUID |
| 32 | 50 | ** does not exist, then return 0. |
| 33 | 51 | ** |
| @@ -37,27 +55,19 @@ | ||
| 37 | 55 | ** If the UUID is not found and phantomize is 1, then attempt to |
| 38 | 56 | ** create a phantom record. |
| 39 | 57 | */ |
| 40 | 58 | int uuid_to_rid(const char *zUuid, int phantomize){ |
| 41 | 59 | int rid, sz; |
| 42 | - static Stmt q; | |
| 43 | 60 | char z[UUID_SIZE+1]; |
| 44 | 61 | |
| 45 | 62 | sz = strlen(zUuid); |
| 46 | 63 | if( sz!=UUID_SIZE || !validate16(zUuid, sz) ){ |
| 47 | 64 | return 0; |
| 48 | 65 | } |
| 49 | 66 | strcpy(z, zUuid); |
| 50 | 67 | canonical16(z, sz); |
| 51 | - db_static_prepare(&q, "SELECT rid FROM blob WHERE uuid=:uuid"); | |
| 52 | - db_bind_text(&q, ":uuid", z); | |
| 53 | - if( db_step(&q)==SQLITE_ROW ){ | |
| 54 | - rid = db_column_int(&q, 0); | |
| 55 | - }else{ | |
| 56 | - rid = 0; | |
| 57 | - } | |
| 58 | - db_reset(&q); | |
| 68 | + rid = fast_uuid_to_rid(z); | |
| 59 | 69 | if( rid==0 && phantomize ){ |
| 60 | 70 | rid = content_new(zUuid); |
| 61 | 71 | } |
| 62 | 72 | return rid; |
| 63 | 73 | } |
| 64 | 74 |
| --- src/vfile.c | |
| +++ src/vfile.c | |
| @@ -24,10 +24,28 @@ | |
| 24 | #if defined(__DMC__) |
| 25 | #include "dirent.h" |
| 26 | #else |
| 27 | #include <dirent.h> |
| 28 | #endif |
| 29 | |
| 30 | /* |
| 31 | ** Given a UUID, return the corresponding record ID. If the UUID |
| 32 | ** does not exist, then return 0. |
| 33 | ** |
| @@ -37,27 +55,19 @@ | |
| 37 | ** If the UUID is not found and phantomize is 1, then attempt to |
| 38 | ** create a phantom record. |
| 39 | */ |
| 40 | int uuid_to_rid(const char *zUuid, int phantomize){ |
| 41 | int rid, sz; |
| 42 | static Stmt q; |
| 43 | char z[UUID_SIZE+1]; |
| 44 | |
| 45 | sz = strlen(zUuid); |
| 46 | if( sz!=UUID_SIZE || !validate16(zUuid, sz) ){ |
| 47 | return 0; |
| 48 | } |
| 49 | strcpy(z, zUuid); |
| 50 | canonical16(z, sz); |
| 51 | db_static_prepare(&q, "SELECT rid FROM blob WHERE uuid=:uuid"); |
| 52 | db_bind_text(&q, ":uuid", z); |
| 53 | if( db_step(&q)==SQLITE_ROW ){ |
| 54 | rid = db_column_int(&q, 0); |
| 55 | }else{ |
| 56 | rid = 0; |
| 57 | } |
| 58 | db_reset(&q); |
| 59 | if( rid==0 && phantomize ){ |
| 60 | rid = content_new(zUuid); |
| 61 | } |
| 62 | return rid; |
| 63 | } |
| 64 |
| --- src/vfile.c | |
| +++ src/vfile.c | |
| @@ -24,10 +24,28 @@ | |
| 24 | #if defined(__DMC__) |
| 25 | #include "dirent.h" |
| 26 | #else |
| 27 | #include <dirent.h> |
| 28 | #endif |
| 29 | |
| 30 | /* |
| 31 | ** The input is guaranteed to be a 40-character well-formed UUID. |
| 32 | ** Find its rid. |
| 33 | */ |
| 34 | int fast_uuid_to_rid(const char *zUuid){ |
| 35 | static Stmt q; |
| 36 | int rid; |
| 37 | db_static_prepare(&q, "SELECT rid FROM blob WHERE uuid=:uuid"); |
| 38 | db_bind_text(&q, ":uuid", zUuid); |
| 39 | if( db_step(&q)==SQLITE_ROW ){ |
| 40 | rid = db_column_int(&q, 0); |
| 41 | }else{ |
| 42 | rid = 0; |
| 43 | } |
| 44 | db_reset(&q); |
| 45 | return rid; |
| 46 | } |
| 47 | |
| 48 | /* |
| 49 | ** Given a UUID, return the corresponding record ID. If the UUID |
| 50 | ** does not exist, then return 0. |
| 51 | ** |
| @@ -37,27 +55,19 @@ | |
| 55 | ** If the UUID is not found and phantomize is 1, then attempt to |
| 56 | ** create a phantom record. |
| 57 | */ |
| 58 | int uuid_to_rid(const char *zUuid, int phantomize){ |
| 59 | int rid, sz; |
| 60 | char z[UUID_SIZE+1]; |
| 61 | |
| 62 | sz = strlen(zUuid); |
| 63 | if( sz!=UUID_SIZE || !validate16(zUuid, sz) ){ |
| 64 | return 0; |
| 65 | } |
| 66 | strcpy(z, zUuid); |
| 67 | canonical16(z, sz); |
| 68 | rid = fast_uuid_to_rid(z); |
| 69 | if( rid==0 && phantomize ){ |
| 70 | rid = content_new(zUuid); |
| 71 | } |
| 72 | return rid; |
| 73 | } |
| 74 |
+2
-5
| --- src/xfer.c | ||
| +++ src/xfer.c | ||
| @@ -454,15 +454,10 @@ | ||
| 454 | 454 | fprintf(stderr, "# login [%s] with capabilities [%s]\n", g.zLogin,zCap); |
| 455 | 455 | } |
| 456 | 456 | } |
| 457 | 457 | } |
| 458 | 458 | db_finalize(&q); |
| 459 | - | |
| 460 | - if( rc==0 ){ | |
| 461 | - /* If the login was successful. */ | |
| 462 | - login_set_anon_nobody_capabilities(); | |
| 463 | - } | |
| 464 | 459 | return rc; |
| 465 | 460 | } |
| 466 | 461 | |
| 467 | 462 | /* |
| 468 | 463 | ** Send the content of all files in the unsent table. |
| @@ -631,10 +626,12 @@ | ||
| 631 | 626 | char *zNow; |
| 632 | 627 | |
| 633 | 628 | if( strcmp(PD("REQUEST_METHOD","POST"),"POST") ){ |
| 634 | 629 | fossil_redirect_home(); |
| 635 | 630 | } |
| 631 | + g.zLogin = "anonymous"; | |
| 632 | + login_set_anon_nobody_capabilities(); | |
| 636 | 633 | memset(&xfer, 0, sizeof(xfer)); |
| 637 | 634 | blobarray_zero(xfer.aToken, count(xfer.aToken)); |
| 638 | 635 | cgi_set_content_type(g.zContentType); |
| 639 | 636 | blob_zero(&xfer.err); |
| 640 | 637 | xfer.pIn = &g.cgiIn; |
| 641 | 638 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -454,15 +454,10 @@ | |
| 454 | fprintf(stderr, "# login [%s] with capabilities [%s]\n", g.zLogin,zCap); |
| 455 | } |
| 456 | } |
| 457 | } |
| 458 | db_finalize(&q); |
| 459 | |
| 460 | if( rc==0 ){ |
| 461 | /* If the login was successful. */ |
| 462 | login_set_anon_nobody_capabilities(); |
| 463 | } |
| 464 | return rc; |
| 465 | } |
| 466 | |
| 467 | /* |
| 468 | ** Send the content of all files in the unsent table. |
| @@ -631,10 +626,12 @@ | |
| 631 | char *zNow; |
| 632 | |
| 633 | if( strcmp(PD("REQUEST_METHOD","POST"),"POST") ){ |
| 634 | fossil_redirect_home(); |
| 635 | } |
| 636 | memset(&xfer, 0, sizeof(xfer)); |
| 637 | blobarray_zero(xfer.aToken, count(xfer.aToken)); |
| 638 | cgi_set_content_type(g.zContentType); |
| 639 | blob_zero(&xfer.err); |
| 640 | xfer.pIn = &g.cgiIn; |
| 641 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -454,15 +454,10 @@ | |
| 454 | fprintf(stderr, "# login [%s] with capabilities [%s]\n", g.zLogin,zCap); |
| 455 | } |
| 456 | } |
| 457 | } |
| 458 | db_finalize(&q); |
| 459 | return rc; |
| 460 | } |
| 461 | |
| 462 | /* |
| 463 | ** Send the content of all files in the unsent table. |
| @@ -631,10 +626,12 @@ | |
| 626 | char *zNow; |
| 627 | |
| 628 | if( strcmp(PD("REQUEST_METHOD","POST"),"POST") ){ |
| 629 | fossil_redirect_home(); |
| 630 | } |
| 631 | g.zLogin = "anonymous"; |
| 632 | login_set_anon_nobody_capabilities(); |
| 633 | memset(&xfer, 0, sizeof(xfer)); |
| 634 | blobarray_zero(xfer.aToken, count(xfer.aToken)); |
| 635 | cgi_set_content_type(g.zContentType); |
| 636 | blob_zero(&xfer.err); |
| 637 | xfer.pIn = &g.cgiIn; |
| 638 |