430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
|
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
|
-
+
+
-
-
+
+
-
-
-
+
+
-
-
+
+
+
+
+
+
+
+
|
@ the "fossil http" or "fossil server" commands then add
@ a command-line option "--errorlog <i>FILENAME</i>" to that
@ command.
@ </ol>
style_footer();
return;
}
if( P("truncate") && cgi_csrf_safe(1) ){
if( P("truncate1") && cgi_csrf_safe(1) ){
fclose(fopen(g.zErrlog,"w"));
}
if( P("download") ){
Blob log;
blob_read_from_file(&log, g.zErrlog, ExtFILE);
cgi_set_content_type("text/plain");
cgi_set_content(&log);
return;
}
szFile = file_size(g.zErrlog, ExtFILE);
if( P("truncate") ){
@ <form action="%R/errorlog" method="POST">
@ <p>The server error log at "%h(g.zErrlog)" is %,lld(szFile) bytes in size.
@ <form action="%R/errorlog" method="POST">
@ <p>Confirm that you want to truncate the %,lld(szFile)-byte error log:
if( szFile>1000 ){
@ <input type="submit" name="download" value="Download">
@ <input type="submit" name="truncate" value="Truncate">
@ <input type="submit" name="truncate1" value="Confirm">
@ <input type="submit" name="cancel" value="Cancel">
}
@ </form>
@ </form>
style_footer();
return;
}
@ <p>The server error log at "%h(g.zErrlog)" is %,lld(szFile) bytes in size.
style_submenu_element("Test", "%R/test-warning");
style_submenu_element("Download", "%R/errorlog?download");
style_submenu_element("Truncate", "%R/errorlog?truncate");
in = fossil_fopen(g.zErrlog, "rb");
if( in==0 ){
@ <p class='generalError'>Unable top open that file for reading!</p>
style_footer();
return;
}
if( szFile>MXSHOWLOG ){
|