Fossil SCM

show references to commandline on webpages; add httptrace to windows http server

wolfgang 2010-10-09 20:13 wolfgangHelpCmd
Commit d1d1cd122b279dbdf089540c4b24355df59cbf4b
+1 -1
--- src/browse.c
+++ src/browse.c
@@ -247,7 +247,7 @@
247247
@ </a></li>
248248
}
249249
}
250250
db_finalize(&q);
251251
@ </ul></td></tr></table>
252
- style_footer();
252
+ style_footer_cmdref("ls");
253253
}
254254
--- src/browse.c
+++ src/browse.c
@@ -247,7 +247,7 @@
247 @ </a></li>
248 }
249 }
250 db_finalize(&q);
251 @ </ul></td></tr></table>
252 style_footer();
253 }
254
--- src/browse.c
+++ src/browse.c
@@ -247,7 +247,7 @@
247 @ </a></li>
248 }
249 }
250 db_finalize(&q);
251 @ </ul></td></tr></table>
252 style_footer_cmdref("ls");
253 }
254
--- src/configure.c
+++ src/configure.c
@@ -407,10 +407,15 @@
407407
** Restore the configuration to the default. AREA as above.
408408
**
409409
** WARNING: Do not import or merge or pull configurations from an
410410
** untrusted source. The inbound configuration is not checked for
411411
** safety and can introduce security vulnerabilities.
412
+**
413
+** The different parts of this configuration can also be controlled
414
+** using the gui:
415
+** * Go to page <a href="setup">Admin</a> and use the subcommands
416
+**
412417
*/
413418
void configuration_cmd(void){
414419
int n;
415420
const char *zMethod;
416421
if( g.argc<3 ){
417422
--- src/configure.c
+++ src/configure.c
@@ -407,10 +407,15 @@
407 ** Restore the configuration to the default. AREA as above.
408 **
409 ** WARNING: Do not import or merge or pull configurations from an
410 ** untrusted source. The inbound configuration is not checked for
411 ** safety and can introduce security vulnerabilities.
 
 
 
 
 
412 */
413 void configuration_cmd(void){
414 int n;
415 const char *zMethod;
416 if( g.argc<3 ){
417
--- src/configure.c
+++ src/configure.c
@@ -407,10 +407,15 @@
407 ** Restore the configuration to the default. AREA as above.
408 **
409 ** WARNING: Do not import or merge or pull configurations from an
410 ** untrusted source. The inbound configuration is not checked for
411 ** safety and can introduce security vulnerabilities.
412 **
413 ** The different parts of this configuration can also be controlled
414 ** using the gui:
415 ** * Go to page <a href="setup">Admin</a> and use the subcommands
416 **
417 */
418 void configuration_cmd(void){
419 int n;
420 const char *zMethod;
421 if( g.argc<3 ){
422
+1 -1
--- src/diff.c
+++ src/diff.c
@@ -815,11 +815,11 @@
815815
for(i=0; i<ann.nOrig; i++){
816816
((char*)ann.aOrig[i].z)[ann.aOrig[i].n] = 0;
817817
@ %s(ann.aOrig[i].zSrc): %h(ann.aOrig[i].z)
818818
}
819819
@ </pre>
820
- style_footer();
820
+ style_footer_cmdref("annotate");
821821
}
822822
823823
/*
824824
** COMMAND: annotate
825825
**
826826
--- src/diff.c
+++ src/diff.c
@@ -815,11 +815,11 @@
815 for(i=0; i<ann.nOrig; i++){
816 ((char*)ann.aOrig[i].z)[ann.aOrig[i].n] = 0;
817 @ %s(ann.aOrig[i].zSrc): %h(ann.aOrig[i].z)
818 }
819 @ </pre>
820 style_footer();
821 }
822
823 /*
824 ** COMMAND: annotate
825 **
826
--- src/diff.c
+++ src/diff.c
@@ -815,11 +815,11 @@
815 for(i=0; i<ann.nOrig; i++){
816 ((char*)ann.aOrig[i].z)[ann.aOrig[i].n] = 0;
817 @ %s(ann.aOrig[i].zSrc): %h(ann.aOrig[i].z)
818 }
819 @ </pre>
820 style_footer_cmdref("annotate");
821 }
822
823 /*
824 ** COMMAND: annotate
825 **
826
+1 -1
--- src/finfo.c
+++ src/finfo.c
@@ -212,7 +212,7 @@
212212
@ </td></tr>
213213
}
214214
}
215215
@ </table>
216216
timeline_output_graph_javascript(pGraph);
217
- style_footer();
217
+ style_footer_cmdref("finfo");
218218
}
219219
--- src/finfo.c
+++ src/finfo.c
@@ -212,7 +212,7 @@
212 @ </td></tr>
213 }
214 }
215 @ </table>
216 timeline_output_graph_javascript(pGraph);
217 style_footer();
218 }
219
--- src/finfo.c
+++ src/finfo.c
@@ -212,7 +212,7 @@
212 @ </td></tr>
213 }
214 }
215 @ </table>
216 timeline_output_graph_javascript(pGraph);
217 style_footer_cmdref("finfo");
218 }
219
+6 -6
--- src/info.c
+++ src/info.c
@@ -467,11 +467,11 @@
467467
const char *zOld = db_column_text(&q,1);
468468
const char *zNew = db_column_text(&q,2);
469469
append_file_change_line(zName, zOld, zNew, showDiff);
470470
}
471471
db_finalize(&q);
472
- style_footer();
472
+ style_footer_cmdref("info");
473473
}
474474
475475
/*
476476
** WEBPAGE: winfo
477477
** URL: /winfo?name=RID
@@ -550,11 +550,11 @@
550550
wiki_convert(&wiki, 0, 0);
551551
blob_reset(&wiki);
552552
}
553553
manifest_clear(&m);
554554
}
555
- style_footer();
555
+ style_footer_cmdref("info");
556556
}
557557
558558
/*
559559
** Show a webpage error message
560560
*/
@@ -654,11 +654,11 @@
654654
@ <tr><td>details:</td><td><input type="checkbox" name="detail"
655655
@ checked="checked" value="1" /></td></tr>
656656
@ <tr><td></td><td></td><td>
657657
@ <input type="submit" name="diff" value="diff" /></td></tr></table>
658658
@ </div></form>
659
- style_footer();
659
+ style_footer_cmdref("diff");
660660
return;
661661
}else if( vdiff_parse_manifest("from", &ridFrom, &mFrom)
662662
|| vdiff_parse_manifest("to", &ridTo, &mTo)
663663
){
664664
return;
@@ -701,11 +701,11 @@
701701
}
702702
}
703703
manifest_clear(&mFrom);
704704
manifest_clear(&mTo);
705705
706
- style_footer();
706
+ style_footer_cmdref("diff");
707707
}
708708
709709
/*
710710
** Write a description of an object to the www reply.
711711
**
@@ -1173,11 +1173,11 @@
11731173
hexdump(&content);
11741174
@ </pre>
11751175
}
11761176
@ </blockquote>
11771177
}
1178
- style_footer();
1178
+ style_footer_cmdref( "artifact" );
11791179
}
11801180
11811181
/*
11821182
** WEBPAGE: tinfo
11831183
** URL: /tinfo?name=ARTIFACTID
@@ -1233,11 +1233,11 @@
12331233
@
12341234
@ <ol>
12351235
free(zDate);
12361236
ticket_output_change_artifact(&m);
12371237
manifest_clear(&m);
1238
- style_footer();
1238
+ style_footer_cmdref("info");
12391239
}
12401240
12411241
12421242
/*
12431243
** WEBPAGE: info
12441244
--- src/info.c
+++ src/info.c
@@ -467,11 +467,11 @@
467 const char *zOld = db_column_text(&q,1);
468 const char *zNew = db_column_text(&q,2);
469 append_file_change_line(zName, zOld, zNew, showDiff);
470 }
471 db_finalize(&q);
472 style_footer();
473 }
474
475 /*
476 ** WEBPAGE: winfo
477 ** URL: /winfo?name=RID
@@ -550,11 +550,11 @@
550 wiki_convert(&wiki, 0, 0);
551 blob_reset(&wiki);
552 }
553 manifest_clear(&m);
554 }
555 style_footer();
556 }
557
558 /*
559 ** Show a webpage error message
560 */
@@ -654,11 +654,11 @@
654 @ <tr><td>details:</td><td><input type="checkbox" name="detail"
655 @ checked="checked" value="1" /></td></tr>
656 @ <tr><td></td><td></td><td>
657 @ <input type="submit" name="diff" value="diff" /></td></tr></table>
658 @ </div></form>
659 style_footer();
660 return;
661 }else if( vdiff_parse_manifest("from", &ridFrom, &mFrom)
662 || vdiff_parse_manifest("to", &ridTo, &mTo)
663 ){
664 return;
@@ -701,11 +701,11 @@
701 }
702 }
703 manifest_clear(&mFrom);
704 manifest_clear(&mTo);
705
706 style_footer();
707 }
708
709 /*
710 ** Write a description of an object to the www reply.
711 **
@@ -1173,11 +1173,11 @@
1173 hexdump(&content);
1174 @ </pre>
1175 }
1176 @ </blockquote>
1177 }
1178 style_footer();
1179 }
1180
1181 /*
1182 ** WEBPAGE: tinfo
1183 ** URL: /tinfo?name=ARTIFACTID
@@ -1233,11 +1233,11 @@
1233 @
1234 @ <ol>
1235 free(zDate);
1236 ticket_output_change_artifact(&m);
1237 manifest_clear(&m);
1238 style_footer();
1239 }
1240
1241
1242 /*
1243 ** WEBPAGE: info
1244
--- src/info.c
+++ src/info.c
@@ -467,11 +467,11 @@
467 const char *zOld = db_column_text(&q,1);
468 const char *zNew = db_column_text(&q,2);
469 append_file_change_line(zName, zOld, zNew, showDiff);
470 }
471 db_finalize(&q);
472 style_footer_cmdref("info");
473 }
474
475 /*
476 ** WEBPAGE: winfo
477 ** URL: /winfo?name=RID
@@ -550,11 +550,11 @@
550 wiki_convert(&wiki, 0, 0);
551 blob_reset(&wiki);
552 }
553 manifest_clear(&m);
554 }
555 style_footer_cmdref("info");
556 }
557
558 /*
559 ** Show a webpage error message
560 */
@@ -654,11 +654,11 @@
654 @ <tr><td>details:</td><td><input type="checkbox" name="detail"
655 @ checked="checked" value="1" /></td></tr>
656 @ <tr><td></td><td></td><td>
657 @ <input type="submit" name="diff" value="diff" /></td></tr></table>
658 @ </div></form>
659 style_footer_cmdref("diff");
660 return;
661 }else if( vdiff_parse_manifest("from", &ridFrom, &mFrom)
662 || vdiff_parse_manifest("to", &ridTo, &mTo)
663 ){
664 return;
@@ -701,11 +701,11 @@
701 }
702 }
703 manifest_clear(&mFrom);
704 manifest_clear(&mTo);
705
706 style_footer_cmdref("diff");
707 }
708
709 /*
710 ** Write a description of an object to the www reply.
711 **
@@ -1173,11 +1173,11 @@
1173 hexdump(&content);
1174 @ </pre>
1175 }
1176 @ </blockquote>
1177 }
1178 style_footer_cmdref( "artifact" );
1179 }
1180
1181 /*
1182 ** WEBPAGE: tinfo
1183 ** URL: /tinfo?name=ARTIFACTID
@@ -1233,11 +1233,11 @@
1233 @
1234 @ <ol>
1235 free(zDate);
1236 ticket_output_change_artifact(&m);
1237 manifest_clear(&m);
1238 style_footer_cmdref("info");
1239 }
1240
1241
1242 /*
1243 ** WEBPAGE: info
1244
+2 -2
--- src/setup.c
+++ src/setup.c
@@ -217,11 +217,11 @@
217217
@ <span class="usertype">nobody</span>.
218218
@ </p></li>
219219
@
220220
@ </ol>
221221
@ </td></tr></table>
222
- style_footer();
222
+ style_footer_cmdref("user");
223223
}
224224
225225
/*
226226
** Return true if zPw is a valid password string. A valid
227227
** password string is:
@@ -664,11 +664,11 @@
664664
@ template for users who are allowed more access than
665665
@ <span class="usertype">anonymous</span>,
666666
@ but less than a <span class="usertype">developer</span>.
667667
@ </p></li>
668668
@ </ul>
669
- style_footer();
669
+ style_footer_cmdref("user");
670670
}
671671
672672
673673
/*
674674
** Generate a checkbox for an attribute.
675675
--- src/setup.c
+++ src/setup.c
@@ -217,11 +217,11 @@
217 @ <span class="usertype">nobody</span>.
218 @ </p></li>
219 @
220 @ </ol>
221 @ </td></tr></table>
222 style_footer();
223 }
224
225 /*
226 ** Return true if zPw is a valid password string. A valid
227 ** password string is:
@@ -664,11 +664,11 @@
664 @ template for users who are allowed more access than
665 @ <span class="usertype">anonymous</span>,
666 @ but less than a <span class="usertype">developer</span>.
667 @ </p></li>
668 @ </ul>
669 style_footer();
670 }
671
672
673 /*
674 ** Generate a checkbox for an attribute.
675
--- src/setup.c
+++ src/setup.c
@@ -217,11 +217,11 @@
217 @ <span class="usertype">nobody</span>.
218 @ </p></li>
219 @
220 @ </ol>
221 @ </td></tr></table>
222 style_footer_cmdref("user");
223 }
224
225 /*
226 ** Return true if zPw is a valid password string. A valid
227 ** password string is:
@@ -664,11 +664,11 @@
664 @ template for users who are allowed more access than
665 @ <span class="usertype">anonymous</span>,
666 @ but less than a <span class="usertype">developer</span>.
667 @ </p></li>
668 @ </ul>
669 style_footer_cmdref("user");
670 }
671
672
673 /*
674 ** Generate a checkbox for an attribute.
675
+20
--- src/style.c
+++ src/style.c
@@ -114,10 +114,21 @@
114114
cgi_destination(CGI_BODY);
115115
g.cgiOutput = 1;
116116
headerHasBeenGenerated = 1;
117117
sideboxUsed = 0;
118118
}
119
+
120
+/*
121
+** append a reference to command line to a web page
122
+** and generate the footer
123
+*/
124
+void style_footer_cmdref( const char * const zCmd ){
125
+ @ <div class="cmdref">See also command line help:
126
+ @ <a href="help?cmd=%s(zCmd)">%s(zCmd)</a>
127
+ @ </div>
128
+ style_footer();
129
+}
119130
120131
/*
121132
** Draw the footer at the bottom of the page.
122133
*/
123134
void style_footer(void){
@@ -239,10 +250,11 @@
239250
@ if {[info exists login]} {
240251
@ html "<a href='$baseurl/login'>Logout</a> "
241252
@ } else {
242253
@ html "<a href='$baseurl/login'>Login</a> "
243254
@ }
255
+@ html "<small><sup><a href='$baseurl/help'>?</a></sup></small>"
244256
@ </th1></div>
245257
;
246258
247259
/*
248260
** The default page footer
@@ -735,10 +747,18 @@
735747
{ "a.hidden",
736748
"format for links, that should not be very visible",
737749
@ font-size: xx-small;
738750
@ color: #aaaaaa;
739751
},
752
+ { "div.cmdref",
753
+ "format for references to command line help entries the actual gui page."
754
+ "set \"display\" to \"none\" to suppress the display",
755
+ @ font-size: small;
756
+ @ text-align: right;
757
+ @ font-family: monospace;
758
+ @ color: #777777;
759
+ },
740760
{ 0,
741761
0,
742762
0
743763
}
744764
};
745765
--- src/style.c
+++ src/style.c
@@ -114,10 +114,21 @@
114 cgi_destination(CGI_BODY);
115 g.cgiOutput = 1;
116 headerHasBeenGenerated = 1;
117 sideboxUsed = 0;
118 }
 
 
 
 
 
 
 
 
 
 
 
119
120 /*
121 ** Draw the footer at the bottom of the page.
122 */
123 void style_footer(void){
@@ -239,10 +250,11 @@
239 @ if {[info exists login]} {
240 @ html "<a href='$baseurl/login'>Logout</a> "
241 @ } else {
242 @ html "<a href='$baseurl/login'>Login</a> "
243 @ }
 
244 @ </th1></div>
245 ;
246
247 /*
248 ** The default page footer
@@ -735,10 +747,18 @@
735 { "a.hidden",
736 "format for links, that should not be very visible",
737 @ font-size: xx-small;
738 @ color: #aaaaaa;
739 },
 
 
 
 
 
 
 
 
740 { 0,
741 0,
742 0
743 }
744 };
745
--- src/style.c
+++ src/style.c
@@ -114,10 +114,21 @@
114 cgi_destination(CGI_BODY);
115 g.cgiOutput = 1;
116 headerHasBeenGenerated = 1;
117 sideboxUsed = 0;
118 }
119
120 /*
121 ** append a reference to command line to a web page
122 ** and generate the footer
123 */
124 void style_footer_cmdref( const char * const zCmd ){
125 @ <div class="cmdref">See also command line help:
126 @ <a href="help?cmd=%s(zCmd)">%s(zCmd)</a>
127 @ </div>
128 style_footer();
129 }
130
131 /*
132 ** Draw the footer at the bottom of the page.
133 */
134 void style_footer(void){
@@ -239,10 +250,11 @@
250 @ if {[info exists login]} {
251 @ html "<a href='$baseurl/login'>Logout</a> "
252 @ } else {
253 @ html "<a href='$baseurl/login'>Login</a> "
254 @ }
255 @ html "<small><sup><a href='$baseurl/help'>?</a></sup></small>"
256 @ </th1></div>
257 ;
258
259 /*
260 ** The default page footer
@@ -735,10 +747,18 @@
747 { "a.hidden",
748 "format for links, that should not be very visible",
749 @ font-size: xx-small;
750 @ color: #aaaaaa;
751 },
752 { "div.cmdref",
753 "format for references to command line help entries the actual gui page."
754 "set \"display\" to \"none\" to suppress the display",
755 @ font-size: small;
756 @ text-align: right;
757 @ font-family: monospace;
758 @ color: #777777;
759 },
760 { 0,
761 0,
762 0
763 }
764 };
765
+3 -1
--- src/timeline.c
+++ src/timeline.c
@@ -952,11 +952,11 @@
952952
db_prepare(&q, "SELECT * FROM timeline ORDER BY timestamp DESC /*scan*/");
953953
@ <h2>%b(&desc)</h2>
954954
blob_reset(&desc);
955955
www_print_timeline(&q, tmFlags, 0);
956956
db_finalize(&q);
957
- style_footer();
957
+ style_footer_cmdref("timeline");
958958
}
959959
960960
/*
961961
** The input query q selects various records. Print a human-readable
962962
** summary of those records.
@@ -1095,10 +1095,12 @@
10951095
** t = tickets only
10961096
** e = events only
10971097
**
10981098
** The information can also be used in the gui:
10991099
** * go to the <a href="timeline">timeline</a> page
1100
+**
1101
+** See also: <a>descendants</a>
11001102
*/
11011103
void timeline_cmd(void){
11021104
Stmt q;
11031105
int n, k;
11041106
const char *zCount;
11051107
--- src/timeline.c
+++ src/timeline.c
@@ -952,11 +952,11 @@
952 db_prepare(&q, "SELECT * FROM timeline ORDER BY timestamp DESC /*scan*/");
953 @ <h2>%b(&desc)</h2>
954 blob_reset(&desc);
955 www_print_timeline(&q, tmFlags, 0);
956 db_finalize(&q);
957 style_footer();
958 }
959
960 /*
961 ** The input query q selects various records. Print a human-readable
962 ** summary of those records.
@@ -1095,10 +1095,12 @@
1095 ** t = tickets only
1096 ** e = events only
1097 **
1098 ** The information can also be used in the gui:
1099 ** * go to the <a href="timeline">timeline</a> page
 
 
1100 */
1101 void timeline_cmd(void){
1102 Stmt q;
1103 int n, k;
1104 const char *zCount;
1105
--- src/timeline.c
+++ src/timeline.c
@@ -952,11 +952,11 @@
952 db_prepare(&q, "SELECT * FROM timeline ORDER BY timestamp DESC /*scan*/");
953 @ <h2>%b(&desc)</h2>
954 blob_reset(&desc);
955 www_print_timeline(&q, tmFlags, 0);
956 db_finalize(&q);
957 style_footer_cmdref("timeline");
958 }
959
960 /*
961 ** The input query q selects various records. Print a human-readable
962 ** summary of those records.
@@ -1095,10 +1095,12 @@
1095 ** t = tickets only
1096 ** e = events only
1097 **
1098 ** The information can also be used in the gui:
1099 ** * go to the <a href="timeline">timeline</a> page
1100 **
1101 ** See also: <a>descendants</a>
1102 */
1103 void timeline_cmd(void){
1104 Stmt q;
1105 int n, k;
1106 const char *zCount;
1107
+1 -1
--- src/tkt.c
+++ src/tkt.c
@@ -366,11 +366,11 @@
366366
@ </ul>
367367
}
368368
db_finalize(&q);
369369
}
370370
371
- style_footer();
371
+ style_footer_cmdref("info");
372372
}
373373
374374
/*
375375
** TH command: append_field FIELD STRING
376376
**
377377
--- src/tkt.c
+++ src/tkt.c
@@ -366,11 +366,11 @@
366 @ </ul>
367 }
368 db_finalize(&q);
369 }
370
371 style_footer();
372 }
373
374 /*
375 ** TH command: append_field FIELD STRING
376 **
377
--- src/tkt.c
+++ src/tkt.c
@@ -366,11 +366,11 @@
366 @ </ul>
367 }
368 db_finalize(&q);
369 }
370
371 style_footer_cmdref("info");
372 }
373
374 /*
375 ** TH command: append_field FIELD STRING
376 **
377
+6
--- src/user.c
+++ src/user.c
@@ -171,10 +171,16 @@
171171
** to exist in the database.
172172
**
173173
** %fossil user password USERNAME ?PASSWORD?
174174
**
175175
** Change the web access password for a user.
176
+** Users can change their own password on the
177
+** <a href="login">Login/Logout</a> gui page.
178
+**
179
+** Administrators can also use the gui:
180
+** * Go to page <a href="setup">Admin</a>
181
+** ** and click <a href="setup_ulist">Users</a>
176182
*/
177183
void user_cmd(void){
178184
int n;
179185
db_find_and_open_repository(1);
180186
if( g.argc<3 ){
181187
--- src/user.c
+++ src/user.c
@@ -171,10 +171,16 @@
171 ** to exist in the database.
172 **
173 ** %fossil user password USERNAME ?PASSWORD?
174 **
175 ** Change the web access password for a user.
 
 
 
 
 
 
176 */
177 void user_cmd(void){
178 int n;
179 db_find_and_open_repository(1);
180 if( g.argc<3 ){
181
--- src/user.c
+++ src/user.c
@@ -171,10 +171,16 @@
171 ** to exist in the database.
172 **
173 ** %fossil user password USERNAME ?PASSWORD?
174 **
175 ** Change the web access password for a user.
176 ** Users can change their own password on the
177 ** <a href="login">Login/Logout</a> gui page.
178 **
179 ** Administrators can also use the gui:
180 ** * Go to page <a href="setup">Admin</a>
181 ** ** and click <a href="setup_ulist">Users</a>
182 */
183 void user_cmd(void){
184 int n;
185 db_find_and_open_repository(1);
186 if( g.argc<3 ){
187
+5 -2
--- src/wiki.c
+++ src/wiki.c
@@ -164,11 +164,11 @@
164164
@ <li> <form method="get" action="%s(g.zBaseURL)/wfind"><div>
165165
@ Search wiki titles: <input type="text" name="title"/>
166166
@ &nbsp; <input type="submit" /></div></form>
167167
@ </li>
168168
@ </ul>
169
- style_footer();
169
+ style_footer_cmdref("wiki");
170170
return;
171171
}
172172
if( check_name(zPageName) ) return;
173173
isSandbox = is_sandbox(zPageName);
174174
if( isSandbox ){
@@ -693,11 +693,11 @@
693693
@ <li><a href="%s(g.zTop)/wiki?name=%T(zName)"><s>%h(zName)</s></a></li>
694694
}
695695
}
696696
db_finalize(&q);
697697
@ </ul>
698
- style_footer();
698
+ style_footer_cmdref("wiki");
699699
}
700700
701701
/*
702702
** WEBPAGE: wfind
703703
**
@@ -899,10 +899,13 @@
899899
**
900900
** %fossil wiki diff ?ARTIFACT? ?-f infile[=stdin]? EntryName
901901
**
902902
** Diffs the local copy of a page with a given version (defaulting
903903
** to the head version).
904
+**
905
+** The wiki format is explained on the <a href="wiki">Wiki</a> subpage
906
+** <a href="wiki_rules">Formatting rules</a>.
904907
*/
905908
void wiki_cmd(void){
906909
int n;
907910
db_find_and_open_repository(1);
908911
if( g.argc<3 ){
909912
--- src/wiki.c
+++ src/wiki.c
@@ -164,11 +164,11 @@
164 @ <li> <form method="get" action="%s(g.zBaseURL)/wfind"><div>
165 @ Search wiki titles: <input type="text" name="title"/>
166 @ &nbsp; <input type="submit" /></div></form>
167 @ </li>
168 @ </ul>
169 style_footer();
170 return;
171 }
172 if( check_name(zPageName) ) return;
173 isSandbox = is_sandbox(zPageName);
174 if( isSandbox ){
@@ -693,11 +693,11 @@
693 @ <li><a href="%s(g.zTop)/wiki?name=%T(zName)"><s>%h(zName)</s></a></li>
694 }
695 }
696 db_finalize(&q);
697 @ </ul>
698 style_footer();
699 }
700
701 /*
702 ** WEBPAGE: wfind
703 **
@@ -899,10 +899,13 @@
899 **
900 ** %fossil wiki diff ?ARTIFACT? ?-f infile[=stdin]? EntryName
901 **
902 ** Diffs the local copy of a page with a given version (defaulting
903 ** to the head version).
 
 
 
904 */
905 void wiki_cmd(void){
906 int n;
907 db_find_and_open_repository(1);
908 if( g.argc<3 ){
909
--- src/wiki.c
+++ src/wiki.c
@@ -164,11 +164,11 @@
164 @ <li> <form method="get" action="%s(g.zBaseURL)/wfind"><div>
165 @ Search wiki titles: <input type="text" name="title"/>
166 @ &nbsp; <input type="submit" /></div></form>
167 @ </li>
168 @ </ul>
169 style_footer_cmdref("wiki");
170 return;
171 }
172 if( check_name(zPageName) ) return;
173 isSandbox = is_sandbox(zPageName);
174 if( isSandbox ){
@@ -693,11 +693,11 @@
693 @ <li><a href="%s(g.zTop)/wiki?name=%T(zName)"><s>%h(zName)</s></a></li>
694 }
695 }
696 db_finalize(&q);
697 @ </ul>
698 style_footer_cmdref("wiki");
699 }
700
701 /*
702 ** WEBPAGE: wfind
703 **
@@ -899,10 +899,13 @@
899 **
900 ** %fossil wiki diff ?ARTIFACT? ?-f infile[=stdin]? EntryName
901 **
902 ** Diffs the local copy of a page with a given version (defaulting
903 ** to the head version).
904 **
905 ** The wiki format is explained on the <a href="wiki">Wiki</a> subpage
906 ** <a href="wiki_rules">Formatting rules</a>.
907 */
908 void wiki_cmd(void){
909 int n;
910 db_find_and_open_repository(1);
911 if( g.argc<3 ){
912
--- src/winhttp.c
+++ src/winhttp.c
@@ -89,10 +89,13 @@
8989
if( z ){
9090
wanted = find_content_length(zHdr) + (&z[4]-zHdr) - amt;
9191
break;
9292
}
9393
}
94
+ if( g.fHttpTrace ){
95
+ fprintf(stderr,"HTTPTRACE(%p): got header '%s'\n",pAppData,zHdr);
96
+ }
9497
if( amt>=sizeof(zHdr) ) goto end_request;
9598
out = fopen(zRequestFName, "wb");
9699
if( out==0 ) goto end_request;
97100
fwrite(zHdr, 1, amt, out);
98101
while( wanted>0 ){
@@ -109,16 +112,26 @@
109112
out = 0;
110113
sprintf(zCmd, "\"%s\" http \"%s\" %s %s %s%s",
111114
g.argv[0], g.zRepositoryName, zRequestFName, zReplyFName,
112115
inet_ntoa(p->addr.sin_addr), p->zNotFound
113116
);
117
+ if( g.fHttpTrace ){
118
+ fprintf(stderr,"HTTPTRACE(%p): calling '%s'\n",pAppData,zCmd);
119
+ }
114120
portable_system(zCmd);
115121
in = fopen(zReplyFName, "rb");
116122
if( in ){
123
+ if( g.fHttpTrace ){
124
+ fprintf(stderr,"HTTPTRACE(%p): read reply '%s'\n",pAppData,zReplyFName);
125
+ }
117126
while( (got = fread(zHdr, 1, sizeof(zHdr), in))>0 ){
118127
send(p->s, zHdr, got, 0);
119128
}
129
+ }else{
130
+ if( g.fHttpTrace ){
131
+ fprintf(stderr,"HTTPTRACE(%p): no reply '%s'\n",pAppData,zReplyFName);
132
+ }
120133
}
121134
122135
end_request:
123136
if( out ) fclose(out);
124137
if( in ) fclose(in);
@@ -215,12 +228,15 @@
215228
}
216229
p->id = ++idCnt;
217230
p->s = client;
218231
p->addr = client_addr;
219232
p->zNotFound = zNotFoundOption;
233
+ if( g.fHttpTrace ){
234
+ fprintf(stderr,"HTTPTRACE(%p): start new request thread\n",p);
235
+ }
220236
_beginthread(win32_process_one_http_request, 0, (void*)p);
221237
}
222238
closesocket(s);
223239
WSACleanup();
224240
}
225241
226242
#endif /* _WIN32 -- This code is for win32 only */
227243
--- src/winhttp.c
+++ src/winhttp.c
@@ -89,10 +89,13 @@
89 if( z ){
90 wanted = find_content_length(zHdr) + (&z[4]-zHdr) - amt;
91 break;
92 }
93 }
 
 
 
94 if( amt>=sizeof(zHdr) ) goto end_request;
95 out = fopen(zRequestFName, "wb");
96 if( out==0 ) goto end_request;
97 fwrite(zHdr, 1, amt, out);
98 while( wanted>0 ){
@@ -109,16 +112,26 @@
109 out = 0;
110 sprintf(zCmd, "\"%s\" http \"%s\" %s %s %s%s",
111 g.argv[0], g.zRepositoryName, zRequestFName, zReplyFName,
112 inet_ntoa(p->addr.sin_addr), p->zNotFound
113 );
 
 
 
114 portable_system(zCmd);
115 in = fopen(zReplyFName, "rb");
116 if( in ){
 
 
 
117 while( (got = fread(zHdr, 1, sizeof(zHdr), in))>0 ){
118 send(p->s, zHdr, got, 0);
119 }
 
 
 
 
120 }
121
122 end_request:
123 if( out ) fclose(out);
124 if( in ) fclose(in);
@@ -215,12 +228,15 @@
215 }
216 p->id = ++idCnt;
217 p->s = client;
218 p->addr = client_addr;
219 p->zNotFound = zNotFoundOption;
 
 
 
220 _beginthread(win32_process_one_http_request, 0, (void*)p);
221 }
222 closesocket(s);
223 WSACleanup();
224 }
225
226 #endif /* _WIN32 -- This code is for win32 only */
227
--- src/winhttp.c
+++ src/winhttp.c
@@ -89,10 +89,13 @@
89 if( z ){
90 wanted = find_content_length(zHdr) + (&z[4]-zHdr) - amt;
91 break;
92 }
93 }
94 if( g.fHttpTrace ){
95 fprintf(stderr,"HTTPTRACE(%p): got header '%s'\n",pAppData,zHdr);
96 }
97 if( amt>=sizeof(zHdr) ) goto end_request;
98 out = fopen(zRequestFName, "wb");
99 if( out==0 ) goto end_request;
100 fwrite(zHdr, 1, amt, out);
101 while( wanted>0 ){
@@ -109,16 +112,26 @@
112 out = 0;
113 sprintf(zCmd, "\"%s\" http \"%s\" %s %s %s%s",
114 g.argv[0], g.zRepositoryName, zRequestFName, zReplyFName,
115 inet_ntoa(p->addr.sin_addr), p->zNotFound
116 );
117 if( g.fHttpTrace ){
118 fprintf(stderr,"HTTPTRACE(%p): calling '%s'\n",pAppData,zCmd);
119 }
120 portable_system(zCmd);
121 in = fopen(zReplyFName, "rb");
122 if( in ){
123 if( g.fHttpTrace ){
124 fprintf(stderr,"HTTPTRACE(%p): read reply '%s'\n",pAppData,zReplyFName);
125 }
126 while( (got = fread(zHdr, 1, sizeof(zHdr), in))>0 ){
127 send(p->s, zHdr, got, 0);
128 }
129 }else{
130 if( g.fHttpTrace ){
131 fprintf(stderr,"HTTPTRACE(%p): no reply '%s'\n",pAppData,zReplyFName);
132 }
133 }
134
135 end_request:
136 if( out ) fclose(out);
137 if( in ) fclose(in);
@@ -215,12 +228,15 @@
228 }
229 p->id = ++idCnt;
230 p->s = client;
231 p->addr = client_addr;
232 p->zNotFound = zNotFoundOption;
233 if( g.fHttpTrace ){
234 fprintf(stderr,"HTTPTRACE(%p): start new request thread\n",p);
235 }
236 _beginthread(win32_process_one_http_request, 0, (void*)p);
237 }
238 closesocket(s);
239 WSACleanup();
240 }
241
242 #endif /* _WIN32 -- This code is for win32 only */
243

Keyboard Shortcuts

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