Fossil SCM

Pull in the latest changes from trunk.

drh 2010-01-24 22:35 ssl merge
Commit 97311bd9d53fd05e3ad4c86a95f0d396f431b311
+2 -1
--- src/cgi.c
+++ src/cgi.c
@@ -311,16 +311,17 @@
311311
/*time_t expires = time(0) + atoi(db_config("constant_expires","604800"));*/
312312
time_t expires = time(0) + 604800;
313313
char * zDate = cgi_rfc822_datestamp(expires);
314314
fprintf(g.httpOut, "Expires: %s\r\n", zDate );
315315
if( zDate[0] ) free( zDate );
316
+ }else{
317
+ fprintf(g.httpOut, "Cache-control: no-cache, no-store\r\n");
316318
}
317319
318320
/* Content intended for logged in users should only be cached in
319321
** the browser, not some shared location.
320322
*/
321
- fprintf(g.httpOut, "Cache-control: no-cache, no-store\r\n");
322323
fprintf(g.httpOut, "Content-Type: %s; charset=utf-8\r\n", zContentType);
323324
if( strcmp(zContentType,"application/x-fossil")==0 ){
324325
cgi_combine_header_and_body();
325326
blob_compress(&cgiContent[0], &cgiContent[0]);
326327
}
327328
--- src/cgi.c
+++ src/cgi.c
@@ -311,16 +311,17 @@
311 /*time_t expires = time(0) + atoi(db_config("constant_expires","604800"));*/
312 time_t expires = time(0) + 604800;
313 char * zDate = cgi_rfc822_datestamp(expires);
314 fprintf(g.httpOut, "Expires: %s\r\n", zDate );
315 if( zDate[0] ) free( zDate );
 
 
316 }
317
318 /* Content intended for logged in users should only be cached in
319 ** the browser, not some shared location.
320 */
321 fprintf(g.httpOut, "Cache-control: no-cache, no-store\r\n");
322 fprintf(g.httpOut, "Content-Type: %s; charset=utf-8\r\n", zContentType);
323 if( strcmp(zContentType,"application/x-fossil")==0 ){
324 cgi_combine_header_and_body();
325 blob_compress(&cgiContent[0], &cgiContent[0]);
326 }
327
--- src/cgi.c
+++ src/cgi.c
@@ -311,16 +311,17 @@
311 /*time_t expires = time(0) + atoi(db_config("constant_expires","604800"));*/
312 time_t expires = time(0) + 604800;
313 char * zDate = cgi_rfc822_datestamp(expires);
314 fprintf(g.httpOut, "Expires: %s\r\n", zDate );
315 if( zDate[0] ) free( zDate );
316 }else{
317 fprintf(g.httpOut, "Cache-control: no-cache, no-store\r\n");
318 }
319
320 /* Content intended for logged in users should only be cached in
321 ** the browser, not some shared location.
322 */
 
323 fprintf(g.httpOut, "Content-Type: %s; charset=utf-8\r\n", zContentType);
324 if( strcmp(zContentType,"application/x-fossil")==0 ){
325 cgi_combine_header_and_body();
326 blob_compress(&cgiContent[0], &cgiContent[0]);
327 }
328
+1
--- src/doc.c
+++ src/doc.c
@@ -561,6 +561,7 @@
561561
if( blob_size(&logo)==0 ){
562562
blob_init(&logo, (char*)aLogo, sizeof(aLogo));
563563
}
564564
cgi_set_content_type(zMime);
565565
cgi_set_content(&logo);
566
+ g.isConst = 1;
566567
}
567568
--- src/doc.c
+++ src/doc.c
@@ -561,6 +561,7 @@
561 if( blob_size(&logo)==0 ){
562 blob_init(&logo, (char*)aLogo, sizeof(aLogo));
563 }
564 cgi_set_content_type(zMime);
565 cgi_set_content(&logo);
 
566 }
567
--- src/doc.c
+++ src/doc.c
@@ -561,6 +561,7 @@
561 if( blob_size(&logo)==0 ){
562 blob_init(&logo, (char*)aLogo, sizeof(aLogo));
563 }
564 cgi_set_content_type(zMime);
565 cgi_set_content(&logo);
566 g.isConst = 1;
567 }
568
+3 -2
--- src/http.c
+++ src/http.c
@@ -125,11 +125,11 @@
125125
**
126126
** The server address is contain in the "g" global structure. The
127127
** url_parse() routine should have been called prior to this routine
128128
** in order to fill this structure appropriately.
129129
*/
130
-void http_exchange(Blob *pSend, Blob *pReply){
130
+void http_exchange(Blob *pSend, Blob *pReply, int useLogin){
131131
Blob login; /* The login card */
132132
Blob payload; /* The complete payload including login card */
133133
Blob hdr; /* The HTTP request header */
134134
int closeConnection; /* True to close the connection when done */
135135
int iLength; /* Length of the reply payload */
@@ -141,11 +141,12 @@
141141
if( transport_open() ){
142142
fossil_fatal(transport_errmsg());
143143
}
144144
145145
/* Construct the login card and prepare the complete payload */
146
- http_build_login_card(pSend, &login);
146
+ blob_zero(&login);
147
+ if( useLogin ) http_build_login_card(pSend, &login);
147148
if( g.fHttpTrace ){
148149
payload = login;
149150
blob_append(&payload, blob_buffer(pSend), blob_size(pSend));
150151
}else{
151152
blob_compress2(&login, pSend, &payload);
152153
--- src/http.c
+++ src/http.c
@@ -125,11 +125,11 @@
125 **
126 ** The server address is contain in the "g" global structure. The
127 ** url_parse() routine should have been called prior to this routine
128 ** in order to fill this structure appropriately.
129 */
130 void http_exchange(Blob *pSend, Blob *pReply){
131 Blob login; /* The login card */
132 Blob payload; /* The complete payload including login card */
133 Blob hdr; /* The HTTP request header */
134 int closeConnection; /* True to close the connection when done */
135 int iLength; /* Length of the reply payload */
@@ -141,11 +141,12 @@
141 if( transport_open() ){
142 fossil_fatal(transport_errmsg());
143 }
144
145 /* Construct the login card and prepare the complete payload */
146 http_build_login_card(pSend, &login);
 
147 if( g.fHttpTrace ){
148 payload = login;
149 blob_append(&payload, blob_buffer(pSend), blob_size(pSend));
150 }else{
151 blob_compress2(&login, pSend, &payload);
152
--- src/http.c
+++ src/http.c
@@ -125,11 +125,11 @@
125 **
126 ** The server address is contain in the "g" global structure. The
127 ** url_parse() routine should have been called prior to this routine
128 ** in order to fill this structure appropriately.
129 */
130 void http_exchange(Blob *pSend, Blob *pReply, int useLogin){
131 Blob login; /* The login card */
132 Blob payload; /* The complete payload including login card */
133 Blob hdr; /* The HTTP request header */
134 int closeConnection; /* True to close the connection when done */
135 int iLength; /* Length of the reply payload */
@@ -141,11 +141,12 @@
141 if( transport_open() ){
142 fossil_fatal(transport_errmsg());
143 }
144
145 /* Construct the login card and prepare the complete payload */
146 blob_zero(&login);
147 if( useLogin ) http_build_login_card(pSend, &login);
148 if( g.fHttpTrace ){
149 payload = login;
150 blob_append(&payload, blob_buffer(pSend), blob_size(pSend));
151 }else{
152 blob_compress2(&login, pSend, &payload);
153
+1 -1
--- src/login.c
+++ src/login.c
@@ -472,11 +472,11 @@
472472
static char *zUser = 0;
473473
int i;
474474
for(i=0; zCap[i]; i++){
475475
switch( zCap[i] ){
476476
case 's': g.okSetup = 1; /* Fall thru into Admin */
477
- case 'a': g.okAdmin = g.okRdTkt = g.okWrTkt =
477
+ case 'a': g.okAdmin = g.okRdTkt = g.okWrTkt = g.okZip =
478478
g.okRdWiki = g.okWrWiki = g.okNewWiki =
479479
g.okApndWiki = g.okHistory = g.okClone =
480480
g.okNewTkt = g.okPassword = g.okRdAddr =
481481
g.okTktFmt = 1; /* Fall thru into Read/Write */
482482
case 'i': g.okRead = g.okWrite = 1; break;
483483
--- src/login.c
+++ src/login.c
@@ -472,11 +472,11 @@
472 static char *zUser = 0;
473 int i;
474 for(i=0; zCap[i]; i++){
475 switch( zCap[i] ){
476 case 's': g.okSetup = 1; /* Fall thru into Admin */
477 case 'a': g.okAdmin = g.okRdTkt = g.okWrTkt =
478 g.okRdWiki = g.okWrWiki = g.okNewWiki =
479 g.okApndWiki = g.okHistory = g.okClone =
480 g.okNewTkt = g.okPassword = g.okRdAddr =
481 g.okTktFmt = 1; /* Fall thru into Read/Write */
482 case 'i': g.okRead = g.okWrite = 1; break;
483
--- src/login.c
+++ src/login.c
@@ -472,11 +472,11 @@
472 static char *zUser = 0;
473 int i;
474 for(i=0; zCap[i]; i++){
475 switch( zCap[i] ){
476 case 's': g.okSetup = 1; /* Fall thru into Admin */
477 case 'a': g.okAdmin = g.okRdTkt = g.okWrTkt = g.okZip =
478 g.okRdWiki = g.okWrWiki = g.okNewWiki =
479 g.okApndWiki = g.okHistory = g.okClone =
480 g.okNewTkt = g.okPassword = g.okRdAddr =
481 g.okTktFmt = 1; /* Fall thru into Read/Write */
482 case 'i': g.okRead = g.okWrite = 1; break;
483
+1 -1
--- src/manifest.c
+++ src/manifest.c
@@ -386,11 +386,11 @@
386386
if( p->zWikiTitle!=0 ) goto manifest_syntax_error;
387387
if( blob_token(&line, &a1)==0 ) goto manifest_syntax_error;
388388
if( blob_token(&line, &a2)!=0 ) goto manifest_syntax_error;
389389
p->zWikiTitle = blob_terminate(&a1);
390390
defossilize(p->zWikiTitle);
391
- if( !wiki_name_is_wellformed(p->zWikiTitle) ){
391
+ if( !wiki_name_is_wellformed((const unsigned char *)p->zWikiTitle) ){
392392
goto manifest_syntax_error;
393393
}
394394
break;
395395
}
396396
397397
--- src/manifest.c
+++ src/manifest.c
@@ -386,11 +386,11 @@
386 if( p->zWikiTitle!=0 ) goto manifest_syntax_error;
387 if( blob_token(&line, &a1)==0 ) goto manifest_syntax_error;
388 if( blob_token(&line, &a2)!=0 ) goto manifest_syntax_error;
389 p->zWikiTitle = blob_terminate(&a1);
390 defossilize(p->zWikiTitle);
391 if( !wiki_name_is_wellformed(p->zWikiTitle) ){
392 goto manifest_syntax_error;
393 }
394 break;
395 }
396
397
--- src/manifest.c
+++ src/manifest.c
@@ -386,11 +386,11 @@
386 if( p->zWikiTitle!=0 ) goto manifest_syntax_error;
387 if( blob_token(&line, &a1)==0 ) goto manifest_syntax_error;
388 if( blob_token(&line, &a2)!=0 ) goto manifest_syntax_error;
389 p->zWikiTitle = blob_terminate(&a1);
390 defossilize(p->zWikiTitle);
391 if( !wiki_name_is_wellformed((const unsigned char *)p->zWikiTitle) ){
392 goto manifest_syntax_error;
393 }
394 break;
395 }
396
397
+5 -5
--- src/rss.c
+++ src/rss.c
@@ -73,13 +73,13 @@
7373
zPubDate = cgi_rfc822_datestamp(time(NULL));
7474
7575
@ <?xml version="1.0"?>
7676
@ <rss version="2.0">
7777
@ <channel>
78
- @ <title>%s(zProjectName)</title>
78
+ @ <title>%h(zProjectName)</title>
7979
@ <link>%s(g.zBaseURL)</link>
80
- @ <description>%s(zProjectDescr)</description>
80
+ @ <description>%h(zProjectDescr)</description>
8181
@ <pubDate>%s(zPubDate)</pubDate>
8282
@ <generator>Fossil version %s(MANIFEST_VERSION) %s(MANIFEST_DATE)</generator>
8383
db_prepare(&q, blob_buffer(&bSQL));
8484
blob_reset( &bSQL );
8585
while( db_step(&q)==SQLITE_ROW && nLine<=20 ){
@@ -102,15 +102,15 @@
102102
}else if( nChild>1 ){
103103
zPrefix = "*FORK* ";
104104
}
105105
106106
@ <item>
107
- @ <title>%s(zPrefix)%s(zCom)</title>
107
+ @ <title>%h(zPrefix)%s(zCom)</title>
108108
@ <link>%s(g.zBaseURL)/ci/%s(zId)</link>
109
- @ <description>%s(zPrefix)%s(zCom)</description>
109
+ @ <description>%s(zPrefix)%h(zCom)</description>
110110
@ <pubDate>%s(zDate)</pubDate>
111
- @ <author>%s(zAuthor)</author>
111
+ @ <author>%h(zAuthor)</author>
112112
@ <guid>%s(g.zBaseURL)/ci/%s(zId)</guid>
113113
@ </item>
114114
free(zDate);
115115
nLine++;
116116
}
117117
--- src/rss.c
+++ src/rss.c
@@ -73,13 +73,13 @@
73 zPubDate = cgi_rfc822_datestamp(time(NULL));
74
75 @ <?xml version="1.0"?>
76 @ <rss version="2.0">
77 @ <channel>
78 @ <title>%s(zProjectName)</title>
79 @ <link>%s(g.zBaseURL)</link>
80 @ <description>%s(zProjectDescr)</description>
81 @ <pubDate>%s(zPubDate)</pubDate>
82 @ <generator>Fossil version %s(MANIFEST_VERSION) %s(MANIFEST_DATE)</generator>
83 db_prepare(&q, blob_buffer(&bSQL));
84 blob_reset( &bSQL );
85 while( db_step(&q)==SQLITE_ROW && nLine<=20 ){
@@ -102,15 +102,15 @@
102 }else if( nChild>1 ){
103 zPrefix = "*FORK* ";
104 }
105
106 @ <item>
107 @ <title>%s(zPrefix)%s(zCom)</title>
108 @ <link>%s(g.zBaseURL)/ci/%s(zId)</link>
109 @ <description>%s(zPrefix)%s(zCom)</description>
110 @ <pubDate>%s(zDate)</pubDate>
111 @ <author>%s(zAuthor)</author>
112 @ <guid>%s(g.zBaseURL)/ci/%s(zId)</guid>
113 @ </item>
114 free(zDate);
115 nLine++;
116 }
117
--- src/rss.c
+++ src/rss.c
@@ -73,13 +73,13 @@
73 zPubDate = cgi_rfc822_datestamp(time(NULL));
74
75 @ <?xml version="1.0"?>
76 @ <rss version="2.0">
77 @ <channel>
78 @ <title>%h(zProjectName)</title>
79 @ <link>%s(g.zBaseURL)</link>
80 @ <description>%h(zProjectDescr)</description>
81 @ <pubDate>%s(zPubDate)</pubDate>
82 @ <generator>Fossil version %s(MANIFEST_VERSION) %s(MANIFEST_DATE)</generator>
83 db_prepare(&q, blob_buffer(&bSQL));
84 blob_reset( &bSQL );
85 while( db_step(&q)==SQLITE_ROW && nLine<=20 ){
@@ -102,15 +102,15 @@
102 }else if( nChild>1 ){
103 zPrefix = "*FORK* ";
104 }
105
106 @ <item>
107 @ <title>%h(zPrefix)%s(zCom)</title>
108 @ <link>%s(g.zBaseURL)/ci/%s(zId)</link>
109 @ <description>%s(zPrefix)%h(zCom)</description>
110 @ <pubDate>%s(zDate)</pubDate>
111 @ <author>%h(zAuthor)</author>
112 @ <guid>%s(g.zBaseURL)/ci/%s(zId)</guid>
113 @ </item>
114 free(zDate);
115 nLine++;
116 }
117
+17
--- src/setup.c
+++ src/setup.c
@@ -962,22 +962,30 @@
962962
}
963963
db_begin_transaction();
964964
if( P("clear")!=0 ){
965965
db_multi_exec("DELETE FROM config WHERE name='css'");
966966
cgi_replace_parameter("css", zDefaultCSS);
967
+ db_end_transaction(0);
968
+ cgi_redirect("setup_editcss");
967969
}else{
968970
textarea_attribute(0, 0, 0, "css", "css", zDefaultCSS);
969971
}
972
+ if( P("submit")!=0 ){
973
+ db_end_transaction(0);
974
+ cgi_redirect("setup_editcss");
975
+ }
970976
style_header("Edit CSS");
971977
@ <form action="%s(g.zBaseURL)/setup_editcss" method="POST">
972978
login_insert_csrf_secret();
973979
@ Edit the CSS below:<br />
974980
textarea_attribute("", 40, 80, "css", "css", zDefaultCSS);
975981
@ <br />
976982
@ <input type="submit" name="submit" value="Apply Changes">
977983
@ <input type="submit" name="clear" value="Revert To Default">
978984
@ </form>
985
+ @ <p><b>Note:</b> Press your browser Reload button after modifying the
986
+ @ CSS in order to pull in the modified CSS file.</p>
979987
@ <hr>
980988
@ The default CSS is shown below for reference. Other examples
981989
@ of CSS files can be seen on the <a href="setup_skin">skins page</a>.
982990
@ See also the <a href="setup_header">header</a> and
983991
@ <a href="setup_footer">footer</a> editing screens.
@@ -1091,14 +1099,18 @@
10911099
db_finalize(&ins);
10921100
db_multi_exec(
10931101
"REPLACE INTO config(name, value) VALUES('logo-mimetype',%Q)",
10941102
zMime
10951103
);
1104
+ db_end_transaction(0);
1105
+ cgi_redirect("setup_logo");
10961106
}else if( P("clr")!=0 ){
10971107
db_multi_exec(
10981108
"DELETE FROM config WHERE name GLOB 'logo-*'"
10991109
);
1110
+ db_end_transaction(0);
1111
+ cgi_redirect("setup_logo");
11001112
}
11011113
style_header("Edit Project Logo");
11021114
@ <p>The current project logo has a MIME-Type of <b>%h(zMime)</b> and looks
11031115
@ like this:</p>
11041116
@ <blockquote><img src="%s(g.zTop)/logo" alt="logo"></blockquote>
@@ -1117,8 +1129,13 @@
11171129
@ Logo Image file:
11181130
@ <input type="file" name="im" size="60" accepts="image/*"><br>
11191131
@ <input type="submit" name="set" value="Change Logo">
11201132
@ <input type="submit" name="clr" value="Revert To Default">
11211133
@ </form>
1134
+ @
1135
+ @ <p><b>Note:</b> Your browser has probably cached the logo image, so
1136
+ @ you will probably need to press the Reload button on your browser after
1137
+ @ changing the logo to provoke your browser to reload the new logo image.
1138
+ @ </p>
11221139
style_footer();
11231140
db_end_transaction(0);
11241141
}
11251142
--- src/setup.c
+++ src/setup.c
@@ -962,22 +962,30 @@
962 }
963 db_begin_transaction();
964 if( P("clear")!=0 ){
965 db_multi_exec("DELETE FROM config WHERE name='css'");
966 cgi_replace_parameter("css", zDefaultCSS);
 
 
967 }else{
968 textarea_attribute(0, 0, 0, "css", "css", zDefaultCSS);
969 }
 
 
 
 
970 style_header("Edit CSS");
971 @ <form action="%s(g.zBaseURL)/setup_editcss" method="POST">
972 login_insert_csrf_secret();
973 @ Edit the CSS below:<br />
974 textarea_attribute("", 40, 80, "css", "css", zDefaultCSS);
975 @ <br />
976 @ <input type="submit" name="submit" value="Apply Changes">
977 @ <input type="submit" name="clear" value="Revert To Default">
978 @ </form>
 
 
979 @ <hr>
980 @ The default CSS is shown below for reference. Other examples
981 @ of CSS files can be seen on the <a href="setup_skin">skins page</a>.
982 @ See also the <a href="setup_header">header</a> and
983 @ <a href="setup_footer">footer</a> editing screens.
@@ -1091,14 +1099,18 @@
1091 db_finalize(&ins);
1092 db_multi_exec(
1093 "REPLACE INTO config(name, value) VALUES('logo-mimetype',%Q)",
1094 zMime
1095 );
 
 
1096 }else if( P("clr")!=0 ){
1097 db_multi_exec(
1098 "DELETE FROM config WHERE name GLOB 'logo-*'"
1099 );
 
 
1100 }
1101 style_header("Edit Project Logo");
1102 @ <p>The current project logo has a MIME-Type of <b>%h(zMime)</b> and looks
1103 @ like this:</p>
1104 @ <blockquote><img src="%s(g.zTop)/logo" alt="logo"></blockquote>
@@ -1117,8 +1129,13 @@
1117 @ Logo Image file:
1118 @ <input type="file" name="im" size="60" accepts="image/*"><br>
1119 @ <input type="submit" name="set" value="Change Logo">
1120 @ <input type="submit" name="clr" value="Revert To Default">
1121 @ </form>
 
 
 
 
 
1122 style_footer();
1123 db_end_transaction(0);
1124 }
1125
--- src/setup.c
+++ src/setup.c
@@ -962,22 +962,30 @@
962 }
963 db_begin_transaction();
964 if( P("clear")!=0 ){
965 db_multi_exec("DELETE FROM config WHERE name='css'");
966 cgi_replace_parameter("css", zDefaultCSS);
967 db_end_transaction(0);
968 cgi_redirect("setup_editcss");
969 }else{
970 textarea_attribute(0, 0, 0, "css", "css", zDefaultCSS);
971 }
972 if( P("submit")!=0 ){
973 db_end_transaction(0);
974 cgi_redirect("setup_editcss");
975 }
976 style_header("Edit CSS");
977 @ <form action="%s(g.zBaseURL)/setup_editcss" method="POST">
978 login_insert_csrf_secret();
979 @ Edit the CSS below:<br />
980 textarea_attribute("", 40, 80, "css", "css", zDefaultCSS);
981 @ <br />
982 @ <input type="submit" name="submit" value="Apply Changes">
983 @ <input type="submit" name="clear" value="Revert To Default">
984 @ </form>
985 @ <p><b>Note:</b> Press your browser Reload button after modifying the
986 @ CSS in order to pull in the modified CSS file.</p>
987 @ <hr>
988 @ The default CSS is shown below for reference. Other examples
989 @ of CSS files can be seen on the <a href="setup_skin">skins page</a>.
990 @ See also the <a href="setup_header">header</a> and
991 @ <a href="setup_footer">footer</a> editing screens.
@@ -1091,14 +1099,18 @@
1099 db_finalize(&ins);
1100 db_multi_exec(
1101 "REPLACE INTO config(name, value) VALUES('logo-mimetype',%Q)",
1102 zMime
1103 );
1104 db_end_transaction(0);
1105 cgi_redirect("setup_logo");
1106 }else if( P("clr")!=0 ){
1107 db_multi_exec(
1108 "DELETE FROM config WHERE name GLOB 'logo-*'"
1109 );
1110 db_end_transaction(0);
1111 cgi_redirect("setup_logo");
1112 }
1113 style_header("Edit Project Logo");
1114 @ <p>The current project logo has a MIME-Type of <b>%h(zMime)</b> and looks
1115 @ like this:</p>
1116 @ <blockquote><img src="%s(g.zTop)/logo" alt="logo"></blockquote>
@@ -1117,8 +1129,13 @@
1129 @ Logo Image file:
1130 @ <input type="file" name="im" size="60" accepts="image/*"><br>
1131 @ <input type="submit" name="set" value="Change Logo">
1132 @ <input type="submit" name="clr" value="Revert To Default">
1133 @ </form>
1134 @
1135 @ <p><b>Note:</b> Your browser has probably cached the logo image, so
1136 @ you will probably need to press the Reload button on your browser after
1137 @ changing the logo to provoke your browser to reload the new logo image.
1138 @ </p>
1139 style_footer();
1140 db_end_transaction(0);
1141 }
1142
--- src/style.c
+++ src/style.c
@@ -391,10 +391,11 @@
391391
char *zCSS = 0;
392392
393393
cgi_set_content_type("text/css");
394394
zCSS = db_get("css",(char*)zDefaultCSS);
395395
cgi_append_content(zCSS, -1);
396
+ g.isConst = 1;
396397
}
397398
398399
/*
399400
** WEBPAGE: test_env
400401
*/
401402
--- src/style.c
+++ src/style.c
@@ -391,10 +391,11 @@
391 char *zCSS = 0;
392
393 cgi_set_content_type("text/css");
394 zCSS = db_get("css",(char*)zDefaultCSS);
395 cgi_append_content(zCSS, -1);
 
396 }
397
398 /*
399 ** WEBPAGE: test_env
400 */
401
--- src/style.c
+++ src/style.c
@@ -391,10 +391,11 @@
391 char *zCSS = 0;
392
393 cgi_set_content_type("text/css");
394 zCSS = db_get("css",(char*)zDefaultCSS);
395 cgi_append_content(zCSS, -1);
396 g.isConst = 1;
397 }
398
399 /*
400 ** WEBPAGE: test_env
401 */
402
+5 -3
--- src/vfile.c
+++ src/vfile.c
@@ -167,19 +167,21 @@
167167
zName = db_column_text(&q, 1);
168168
rid = db_column_int(&q, 2);
169169
isDeleted = db_column_int(&q, 3);
170170
oldChnged = db_column_int(&q, 4);
171171
oldMtime = db_column_int64(&q, 6);
172
- if( !file_isfile(zName) && file_size(0)>=0 ){
172
+ if( isDeleted ){
173
+ chnged = 1;
174
+ }else if( !file_isfile(zName) && file_size(0)>=0 ){
173175
if( notFileIsFatal ){
174
- fossil_warning("not a ordinary file: %s", zName);
176
+ fossil_warning("not an ordinary file: %s", zName);
175177
nErr++;
176178
}
177179
chnged = 1;
178180
}else if( oldChnged>=2 ){
179181
chnged = oldChnged;
180
- }else if( isDeleted || rid==0 ){
182
+ }else if( rid==0 ){
181183
chnged = 1;
182184
}
183185
if( chnged!=1 ){
184186
currentMtime = file_mtime(0);
185187
assert( currentMtime>0 );
186188
--- src/vfile.c
+++ src/vfile.c
@@ -167,19 +167,21 @@
167 zName = db_column_text(&q, 1);
168 rid = db_column_int(&q, 2);
169 isDeleted = db_column_int(&q, 3);
170 oldChnged = db_column_int(&q, 4);
171 oldMtime = db_column_int64(&q, 6);
172 if( !file_isfile(zName) && file_size(0)>=0 ){
 
 
173 if( notFileIsFatal ){
174 fossil_warning("not a ordinary file: %s", zName);
175 nErr++;
176 }
177 chnged = 1;
178 }else if( oldChnged>=2 ){
179 chnged = oldChnged;
180 }else if( isDeleted || rid==0 ){
181 chnged = 1;
182 }
183 if( chnged!=1 ){
184 currentMtime = file_mtime(0);
185 assert( currentMtime>0 );
186
--- src/vfile.c
+++ src/vfile.c
@@ -167,19 +167,21 @@
167 zName = db_column_text(&q, 1);
168 rid = db_column_int(&q, 2);
169 isDeleted = db_column_int(&q, 3);
170 oldChnged = db_column_int(&q, 4);
171 oldMtime = db_column_int64(&q, 6);
172 if( isDeleted ){
173 chnged = 1;
174 }else if( !file_isfile(zName) && file_size(0)>=0 ){
175 if( notFileIsFatal ){
176 fossil_warning("not an ordinary file: %s", zName);
177 nErr++;
178 }
179 chnged = 1;
180 }else if( oldChnged>=2 ){
181 chnged = oldChnged;
182 }else if( rid==0 ){
183 chnged = 1;
184 }
185 if( chnged!=1 ){
186 currentMtime = file_mtime(0);
187 assert( currentMtime>0 );
188
+3 -3
--- src/wiki.c
+++ src/wiki.c
@@ -35,11 +35,11 @@
3535
** Well-formed wiki page names do not begin or end with whitespace,
3636
** and do not contain tabs or other control characters and do not
3737
** contain more than a single space character in a row. Well-formed
3838
** names must be between 3 and 100 chracters in length, inclusive.
3939
*/
40
-int wiki_name_is_wellformed(const char *z){
40
+int wiki_name_is_wellformed(const unsigned char *z){
4141
int i;
4242
if( z[0]<=0x20 ){
4343
return 0;
4444
}
4545
for(i=1; z[i]; i++){
@@ -67,11 +67,11 @@
6767
/*
6868
** Check a wiki name. If it is not well-formed, then issue an error
6969
** and return true. If it is well-formed, return false.
7070
*/
7171
static int check_name(const char *z){
72
- if( !wiki_name_is_wellformed(z) ){
72
+ if( !wiki_name_is_wellformed((const unsigned char *)z) ){
7373
style_header("Wiki Page Name Error");
7474
@ The wiki name "<b>%h(z)</b>" is not well-formed. Rules for
7575
@ wiki page names:
7676
well_formed_wiki_name_rules();
7777
style_footer();
@@ -345,11 +345,11 @@
345345
if( !g.okNewWiki ){
346346
login_needed();
347347
return;
348348
}
349349
zName = PD("name","");
350
- if( zName[0] && wiki_name_is_wellformed(zName) ){
350
+ if( zName[0] && wiki_name_is_wellformed((const unsigned char *)zName) ){
351351
cgi_redirectf("wikiedit?name=%T", zName);
352352
}
353353
style_header("Create A New Wiki Page");
354354
@ <p>Rules for wiki page names:
355355
well_formed_wiki_name_rules();
356356
--- src/wiki.c
+++ src/wiki.c
@@ -35,11 +35,11 @@
35 ** Well-formed wiki page names do not begin or end with whitespace,
36 ** and do not contain tabs or other control characters and do not
37 ** contain more than a single space character in a row. Well-formed
38 ** names must be between 3 and 100 chracters in length, inclusive.
39 */
40 int wiki_name_is_wellformed(const char *z){
41 int i;
42 if( z[0]<=0x20 ){
43 return 0;
44 }
45 for(i=1; z[i]; i++){
@@ -67,11 +67,11 @@
67 /*
68 ** Check a wiki name. If it is not well-formed, then issue an error
69 ** and return true. If it is well-formed, return false.
70 */
71 static int check_name(const char *z){
72 if( !wiki_name_is_wellformed(z) ){
73 style_header("Wiki Page Name Error");
74 @ The wiki name "<b>%h(z)</b>" is not well-formed. Rules for
75 @ wiki page names:
76 well_formed_wiki_name_rules();
77 style_footer();
@@ -345,11 +345,11 @@
345 if( !g.okNewWiki ){
346 login_needed();
347 return;
348 }
349 zName = PD("name","");
350 if( zName[0] && wiki_name_is_wellformed(zName) ){
351 cgi_redirectf("wikiedit?name=%T", zName);
352 }
353 style_header("Create A New Wiki Page");
354 @ <p>Rules for wiki page names:
355 well_formed_wiki_name_rules();
356
--- src/wiki.c
+++ src/wiki.c
@@ -35,11 +35,11 @@
35 ** Well-formed wiki page names do not begin or end with whitespace,
36 ** and do not contain tabs or other control characters and do not
37 ** contain more than a single space character in a row. Well-formed
38 ** names must be between 3 and 100 chracters in length, inclusive.
39 */
40 int wiki_name_is_wellformed(const unsigned char *z){
41 int i;
42 if( z[0]<=0x20 ){
43 return 0;
44 }
45 for(i=1; z[i]; i++){
@@ -67,11 +67,11 @@
67 /*
68 ** Check a wiki name. If it is not well-formed, then issue an error
69 ** and return true. If it is well-formed, return false.
70 */
71 static int check_name(const char *z){
72 if( !wiki_name_is_wellformed((const unsigned char *)z) ){
73 style_header("Wiki Page Name Error");
74 @ The wiki name "<b>%h(z)</b>" is not well-formed. Rules for
75 @ wiki page names:
76 well_formed_wiki_name_rules();
77 style_footer();
@@ -345,11 +345,11 @@
345 if( !g.okNewWiki ){
346 login_needed();
347 return;
348 }
349 zName = PD("name","");
350 if( zName[0] && wiki_name_is_wellformed((const unsigned char *)zName) ){
351 cgi_redirectf("wikiedit?name=%T", zName);
352 }
353 style_header("Create A New Wiki Page");
354 @ <p>Rules for wiki page names:
355 well_formed_wiki_name_rules();
356
--- src/wikiformat.c
+++ src/wikiformat.c
@@ -1015,11 +1015,11 @@
10151015
}
10161016
}
10171017
}else if( g.okHistory ){
10181018
blob_appendf(p->pOut, "<a href=\"%s/info/%s\">", g.zBaseURL, zTarget);
10191019
}
1020
- }else if( wiki_name_is_wellformed(zTarget) ){
1020
+ }else if( wiki_name_is_wellformed((const unsigned char *)zTarget) ){
10211021
blob_appendf(p->pOut, "<a href=\"%s/wiki?name=%T\">", g.zBaseURL, zTarget);
10221022
}else{
10231023
blob_appendf(p->pOut, "[bad-link: %h]", zTarget);
10241024
zTerm = "";
10251025
}
10261026
--- src/wikiformat.c
+++ src/wikiformat.c
@@ -1015,11 +1015,11 @@
1015 }
1016 }
1017 }else if( g.okHistory ){
1018 blob_appendf(p->pOut, "<a href=\"%s/info/%s\">", g.zBaseURL, zTarget);
1019 }
1020 }else if( wiki_name_is_wellformed(zTarget) ){
1021 blob_appendf(p->pOut, "<a href=\"%s/wiki?name=%T\">", g.zBaseURL, zTarget);
1022 }else{
1023 blob_appendf(p->pOut, "[bad-link: %h]", zTarget);
1024 zTerm = "";
1025 }
1026
--- src/wikiformat.c
+++ src/wikiformat.c
@@ -1015,11 +1015,11 @@
1015 }
1016 }
1017 }else if( g.okHistory ){
1018 blob_appendf(p->pOut, "<a href=\"%s/info/%s\">", g.zBaseURL, zTarget);
1019 }
1020 }else if( wiki_name_is_wellformed((const unsigned char *)zTarget) ){
1021 blob_appendf(p->pOut, "<a href=\"%s/wiki?name=%T\">", g.zBaseURL, zTarget);
1022 }else{
1023 blob_appendf(p->pOut, "[bad-link: %h]", zTarget);
1024 zTerm = "";
1025 }
1026
+4 -1
--- src/xfer.c
+++ src/xfer.c
@@ -386,10 +386,13 @@
386386
Stmt q;
387387
int rc = -1;
388388
char *zLogin = blob_terminate(pLogin);
389389
defossilize(zLogin);
390390
391
+ if( strcmp(zLogin, "nobody")==0 || strcmp(zLogin,"anonymous")==0 ){
392
+ return 0; /* Anybody is allowed to sync as "nobody" or "anonymous" */
393
+ }
391394
db_prepare(&q,
392395
"SELECT pw, cap, uid FROM user"
393396
" WHERE login=%Q"
394397
" AND login NOT IN ('anonymous','nobody','developer','reader')"
395398
" AND length(pw)>0",
@@ -1062,11 +1065,11 @@
10621065
nCardRcvd = 0;
10631066
xfer.nFileSent = 0;
10641067
xfer.nDeltaSent = 0;
10651068
xfer.nGimmeSent = 0;
10661069
fflush(stdout);
1067
- http_exchange(&send, &recv);
1070
+ http_exchange(&send, &recv, cloneFlag==0 || nCycle>0);
10681071
blob_reset(&send);
10691072
10701073
/* Begin constructing the next message (which might never be
10711074
** sent) by beginning with the pull or push cards
10721075
*/
10731076
--- src/xfer.c
+++ src/xfer.c
@@ -386,10 +386,13 @@
386 Stmt q;
387 int rc = -1;
388 char *zLogin = blob_terminate(pLogin);
389 defossilize(zLogin);
390
 
 
 
391 db_prepare(&q,
392 "SELECT pw, cap, uid FROM user"
393 " WHERE login=%Q"
394 " AND login NOT IN ('anonymous','nobody','developer','reader')"
395 " AND length(pw)>0",
@@ -1062,11 +1065,11 @@
1062 nCardRcvd = 0;
1063 xfer.nFileSent = 0;
1064 xfer.nDeltaSent = 0;
1065 xfer.nGimmeSent = 0;
1066 fflush(stdout);
1067 http_exchange(&send, &recv);
1068 blob_reset(&send);
1069
1070 /* Begin constructing the next message (which might never be
1071 ** sent) by beginning with the pull or push cards
1072 */
1073
--- src/xfer.c
+++ src/xfer.c
@@ -386,10 +386,13 @@
386 Stmt q;
387 int rc = -1;
388 char *zLogin = blob_terminate(pLogin);
389 defossilize(zLogin);
390
391 if( strcmp(zLogin, "nobody")==0 || strcmp(zLogin,"anonymous")==0 ){
392 return 0; /* Anybody is allowed to sync as "nobody" or "anonymous" */
393 }
394 db_prepare(&q,
395 "SELECT pw, cap, uid FROM user"
396 " WHERE login=%Q"
397 " AND login NOT IN ('anonymous','nobody','developer','reader')"
398 " AND length(pw)>0",
@@ -1062,11 +1065,11 @@
1065 nCardRcvd = 0;
1066 xfer.nFileSent = 0;
1067 xfer.nDeltaSent = 0;
1068 xfer.nGimmeSent = 0;
1069 fflush(stdout);
1070 http_exchange(&send, &recv, cloneFlag==0 || nCycle>0);
1071 blob_reset(&send);
1072
1073 /* Begin constructing the next message (which might never be
1074 ** sent) by beginning with the pull or push cards
1075 */
1076
+4 -1
--- src/xfer.c
+++ src/xfer.c
@@ -386,10 +386,13 @@
386386
Stmt q;
387387
int rc = -1;
388388
char *zLogin = blob_terminate(pLogin);
389389
defossilize(zLogin);
390390
391
+ if( strcmp(zLogin, "nobody")==0 || strcmp(zLogin,"anonymous")==0 ){
392
+ return 0; /* Anybody is allowed to sync as "nobody" or "anonymous" */
393
+ }
391394
db_prepare(&q,
392395
"SELECT pw, cap, uid FROM user"
393396
" WHERE login=%Q"
394397
" AND login NOT IN ('anonymous','nobody','developer','reader')"
395398
" AND length(pw)>0",
@@ -1062,11 +1065,11 @@
10621065
nCardRcvd = 0;
10631066
xfer.nFileSent = 0;
10641067
xfer.nDeltaSent = 0;
10651068
xfer.nGimmeSent = 0;
10661069
fflush(stdout);
1067
- http_exchange(&send, &recv);
1070
+ http_exchange(&send, &recv, cloneFlag==0 || nCycle>0);
10681071
blob_reset(&send);
10691072
10701073
/* Begin constructing the next message (which might never be
10711074
** sent) by beginning with the pull or push cards
10721075
*/
10731076
--- src/xfer.c
+++ src/xfer.c
@@ -386,10 +386,13 @@
386 Stmt q;
387 int rc = -1;
388 char *zLogin = blob_terminate(pLogin);
389 defossilize(zLogin);
390
 
 
 
391 db_prepare(&q,
392 "SELECT pw, cap, uid FROM user"
393 " WHERE login=%Q"
394 " AND login NOT IN ('anonymous','nobody','developer','reader')"
395 " AND length(pw)>0",
@@ -1062,11 +1065,11 @@
1062 nCardRcvd = 0;
1063 xfer.nFileSent = 0;
1064 xfer.nDeltaSent = 0;
1065 xfer.nGimmeSent = 0;
1066 fflush(stdout);
1067 http_exchange(&send, &recv);
1068 blob_reset(&send);
1069
1070 /* Begin constructing the next message (which might never be
1071 ** sent) by beginning with the pull or push cards
1072 */
1073
--- src/xfer.c
+++ src/xfer.c
@@ -386,10 +386,13 @@
386 Stmt q;
387 int rc = -1;
388 char *zLogin = blob_terminate(pLogin);
389 defossilize(zLogin);
390
391 if( strcmp(zLogin, "nobody")==0 || strcmp(zLogin,"anonymous")==0 ){
392 return 0; /* Anybody is allowed to sync as "nobody" or "anonymous" */
393 }
394 db_prepare(&q,
395 "SELECT pw, cap, uid FROM user"
396 " WHERE login=%Q"
397 " AND login NOT IN ('anonymous','nobody','developer','reader')"
398 " AND length(pw)>0",
@@ -1062,11 +1065,11 @@
1065 nCardRcvd = 0;
1066 xfer.nFileSent = 0;
1067 xfer.nDeltaSent = 0;
1068 xfer.nGimmeSent = 0;
1069 fflush(stdout);
1070 http_exchange(&send, &recv, cloneFlag==0 || nCycle>0);
1071 blob_reset(&send);
1072
1073 /* Begin constructing the next message (which might never be
1074 ** sent) by beginning with the pull or push cards
1075 */
1076
--- www/branching.wiki
+++ www/branching.wiki
@@ -173,11 +173,11 @@
173173
<i>property</i> is a name/value pair. Internally, fossil implements
174174
tags as properties with a NULL value. So, tags and properties really
175175
are much the same thing, and henceforth we will use the word "tag"
176176
to mean either a tag or a property.
177177
178
-A tag can be either a one-time tag or an propagating tag or a cancellation tag.
178
+A tag can be a one-time tag, a propagating tag or a cancellation tag.
179179
A one-time tag only applies to the check-in to which it is attached. A
180180
propagating tag applies to the check-in to which it is attached and also
181181
to all direct descendants of that check-in. A <i>direct descendant</i>
182182
is a descendant through direct children. Tags propagation does not
183183
cross merges. Tag propagation also stops as soon
184184
--- www/branching.wiki
+++ www/branching.wiki
@@ -173,11 +173,11 @@
173 <i>property</i> is a name/value pair. Internally, fossil implements
174 tags as properties with a NULL value. So, tags and properties really
175 are much the same thing, and henceforth we will use the word "tag"
176 to mean either a tag or a property.
177
178 A tag can be either a one-time tag or an propagating tag or a cancellation tag.
179 A one-time tag only applies to the check-in to which it is attached. A
180 propagating tag applies to the check-in to which it is attached and also
181 to all direct descendants of that check-in. A <i>direct descendant</i>
182 is a descendant through direct children. Tags propagation does not
183 cross merges. Tag propagation also stops as soon
184
--- www/branching.wiki
+++ www/branching.wiki
@@ -173,11 +173,11 @@
173 <i>property</i> is a name/value pair. Internally, fossil implements
174 tags as properties with a NULL value. So, tags and properties really
175 are much the same thing, and henceforth we will use the word "tag"
176 to mean either a tag or a property.
177
178 A tag can be a one-time tag, a propagating tag or a cancellation tag.
179 A one-time tag only applies to the check-in to which it is attached. A
180 propagating tag applies to the check-in to which it is attached and also
181 to all direct descendants of that check-in. A <i>direct descendant</i>
182 is a descendant through direct children. Tags propagation does not
183 cross merges. Tag propagation also stops as soon
184

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button