Fossil SCM

Added new loadavg-exempt WEBPAGE: flag for mkindex.c which exempts a given page from the load_control() check. Currently applied to /chat and its dependents: /builtin and /style.css.

stephan 2022-04-14 17:41 load-control-rework
Commit 5c49ab3c7a1a11752ceef728dad5ec26f8b8483bec39cc8dc14fc54b3de1e16d
+1 -1
--- src/builtin.c
+++ src/builtin.c
@@ -156,11 +156,11 @@
156156
}
157157
return;
158158
}
159159
160160
/*
161
-** WEBPAGE: builtin
161
+** WEBPAGE: builtin loadavg-exempt
162162
**
163163
** Return one of many built-in content files. Query parameters:
164164
**
165165
** name=FILENAME Return the single file whose name is FILENAME.
166166
** mimetype=TYPE Override the mimetype in the returned file to
167167
--- src/builtin.c
+++ src/builtin.c
@@ -156,11 +156,11 @@
156 }
157 return;
158 }
159
160 /*
161 ** WEBPAGE: builtin
162 **
163 ** Return one of many built-in content files. Query parameters:
164 **
165 ** name=FILENAME Return the single file whose name is FILENAME.
166 ** mimetype=TYPE Override the mimetype in the returned file to
167
--- src/builtin.c
+++ src/builtin.c
@@ -156,11 +156,11 @@
156 }
157 return;
158 }
159
160 /*
161 ** WEBPAGE: builtin loadavg-exempt
162 **
163 ** Return one of many built-in content files. Query parameters:
164 **
165 ** name=FILENAME Return the single file whose name is FILENAME.
166 ** mimetype=TYPE Override the mimetype in the returned file to
167
+6 -6
--- src/chat.c
+++ src/chat.c
@@ -128,11 +128,11 @@
128128
**
129129
** This is the name of the builtin sound file to use for the alert tone.
130130
** The value must be the name of a builtin WAV file.
131131
*/
132132
/*
133
-** WEBPAGE: chat
133
+** WEBPAGE: chat loadavg-exempt
134134
**
135135
** Start up a browser-based chat session.
136136
**
137137
** This is the main page that humans use to access the chatroom. Simply
138138
** point a web-browser at /chat and the screen fills with the latest
@@ -342,11 +342,11 @@
342342
}
343343
fossil_free(zTime);
344344
}
345345
346346
/*
347
-** WEBPAGE: chat-send hidden
347
+** WEBPAGE: chat-send hidden loadavg-exempt
348348
**
349349
** This page receives (via XHR) a new chat-message and/or a new file
350350
** to be entered into the chat history.
351351
**
352352
** On success it responds with an empty response: the new message
@@ -448,11 +448,11 @@
448448
fossil_free(zOut);
449449
}
450450
}
451451
452452
/*
453
-** WEBPAGE: chat-poll hidden
453
+** WEBPAGE: chat-poll hidden loadavg-exempt
454454
**
455455
** The chat page generated by /chat using an XHR to this page to
456456
** request new chat content. A typical invocation is:
457457
**
458458
** /chat-poll/N
@@ -667,11 +667,11 @@
667667
cgi_set_content(&json);
668668
return;
669669
}
670670
671671
/*
672
-** WEBPAGE: chat-fetch-one hidden
672
+** WEBPAGE: chat-fetch-one hidden loadavg-exempt
673673
**
674674
** /chat-fetch-one/N
675675
**
676676
** Fetches a single message with the given ID, if available.
677677
**
@@ -744,11 +744,11 @@
744744
}
745745
db_finalize(&q);
746746
}
747747
748748
/*
749
-** WEBPAGE: chat-download hidden
749
+** WEBPAGE: chat-download hidden loadavg-exempt
750750
**
751751
** Download the CHAT.FILE attachment associated with a single chat
752752
** entry. The "name" query parameter begins with an integer that
753753
** identifies the particular chat message. The integer may be followed
754754
** by a / and a filename, which will indicate to the browser to use
@@ -777,11 +777,11 @@
777777
cgi_set_content(&r);
778778
}
779779
780780
781781
/*
782
-** WEBPAGE: chat-delete hidden
782
+** WEBPAGE: chat-delete hidden loadavg-exempt
783783
**
784784
** Delete the chat entry identified by the name query parameter.
785785
** Invoking fetch("chat-delete/"+msgid) from javascript in the client
786786
** will delete a chat entry from the CHAT table.
787787
**
788788
--- src/chat.c
+++ src/chat.c
@@ -128,11 +128,11 @@
128 **
129 ** This is the name of the builtin sound file to use for the alert tone.
130 ** The value must be the name of a builtin WAV file.
131 */
132 /*
133 ** WEBPAGE: chat
134 **
135 ** Start up a browser-based chat session.
136 **
137 ** This is the main page that humans use to access the chatroom. Simply
138 ** point a web-browser at /chat and the screen fills with the latest
@@ -342,11 +342,11 @@
342 }
343 fossil_free(zTime);
344 }
345
346 /*
347 ** WEBPAGE: chat-send hidden
348 **
349 ** This page receives (via XHR) a new chat-message and/or a new file
350 ** to be entered into the chat history.
351 **
352 ** On success it responds with an empty response: the new message
@@ -448,11 +448,11 @@
448 fossil_free(zOut);
449 }
450 }
451
452 /*
453 ** WEBPAGE: chat-poll hidden
454 **
455 ** The chat page generated by /chat using an XHR to this page to
456 ** request new chat content. A typical invocation is:
457 **
458 ** /chat-poll/N
@@ -667,11 +667,11 @@
667 cgi_set_content(&json);
668 return;
669 }
670
671 /*
672 ** WEBPAGE: chat-fetch-one hidden
673 **
674 ** /chat-fetch-one/N
675 **
676 ** Fetches a single message with the given ID, if available.
677 **
@@ -744,11 +744,11 @@
744 }
745 db_finalize(&q);
746 }
747
748 /*
749 ** WEBPAGE: chat-download hidden
750 **
751 ** Download the CHAT.FILE attachment associated with a single chat
752 ** entry. The "name" query parameter begins with an integer that
753 ** identifies the particular chat message. The integer may be followed
754 ** by a / and a filename, which will indicate to the browser to use
@@ -777,11 +777,11 @@
777 cgi_set_content(&r);
778 }
779
780
781 /*
782 ** WEBPAGE: chat-delete hidden
783 **
784 ** Delete the chat entry identified by the name query parameter.
785 ** Invoking fetch("chat-delete/"+msgid) from javascript in the client
786 ** will delete a chat entry from the CHAT table.
787 **
788
--- src/chat.c
+++ src/chat.c
@@ -128,11 +128,11 @@
128 **
129 ** This is the name of the builtin sound file to use for the alert tone.
130 ** The value must be the name of a builtin WAV file.
131 */
132 /*
133 ** WEBPAGE: chat loadavg-exempt
134 **
135 ** Start up a browser-based chat session.
136 **
137 ** This is the main page that humans use to access the chatroom. Simply
138 ** point a web-browser at /chat and the screen fills with the latest
@@ -342,11 +342,11 @@
342 }
343 fossil_free(zTime);
344 }
345
346 /*
347 ** WEBPAGE: chat-send hidden loadavg-exempt
348 **
349 ** This page receives (via XHR) a new chat-message and/or a new file
350 ** to be entered into the chat history.
351 **
352 ** On success it responds with an empty response: the new message
@@ -448,11 +448,11 @@
448 fossil_free(zOut);
449 }
450 }
451
452 /*
453 ** WEBPAGE: chat-poll hidden loadavg-exempt
454 **
455 ** The chat page generated by /chat using an XHR to this page to
456 ** request new chat content. A typical invocation is:
457 **
458 ** /chat-poll/N
@@ -667,11 +667,11 @@
667 cgi_set_content(&json);
668 return;
669 }
670
671 /*
672 ** WEBPAGE: chat-fetch-one hidden loadavg-exempt
673 **
674 ** /chat-fetch-one/N
675 **
676 ** Fetches a single message with the given ID, if available.
677 **
@@ -744,11 +744,11 @@
744 }
745 db_finalize(&q);
746 }
747
748 /*
749 ** WEBPAGE: chat-download hidden loadavg-exempt
750 **
751 ** Download the CHAT.FILE attachment associated with a single chat
752 ** entry. The "name" query parameter begins with an integer that
753 ** identifies the particular chat message. The integer may be followed
754 ** by a / and a filename, which will indicate to the browser to use
@@ -777,11 +777,11 @@
777 cgi_set_content(&r);
778 }
779
780
781 /*
782 ** WEBPAGE: chat-delete hidden loadavg-exempt
783 **
784 ** Delete the chat entry identified by the name query parameter.
785 ** Invoking fetch("chat-delete/"+msgid) from javascript in the client
786 ** will delete a chat entry from the CHAT table.
787 **
788
+13 -12
--- src/dispatch.c
+++ src/dispatch.c
@@ -38,22 +38,23 @@
3838
3939
/***************************************************************************
4040
** These macros must match similar macros in mkindex.c
4141
** Allowed values for CmdOrPage.eCmdFlags.
4242
*/
43
-#define CMDFLAG_1ST_TIER 0x0001 /* Most important commands */
44
-#define CMDFLAG_2ND_TIER 0x0002 /* Obscure and seldom used commands */
45
-#define CMDFLAG_TEST 0x0004 /* Commands for testing only */
46
-#define CMDFLAG_WEBPAGE 0x0008 /* Web pages */
47
-#define CMDFLAG_COMMAND 0x0010 /* A command */
48
-#define CMDFLAG_SETTING 0x0020 /* A setting */
49
-#define CMDFLAG_VERSIONABLE 0x0040 /* A versionable setting */
50
-#define CMDFLAG_BLOCKTEXT 0x0080 /* Multi-line text setting */
51
-#define CMDFLAG_BOOLEAN 0x0100 /* A boolean setting */
52
-#define CMDFLAG_RAWCONTENT 0x0200 /* Do not interpret POST content */
53
-/* NOTE: 0x0400 = CMDFLAG_SENSITIVE in mkindex.c! */
54
-#define CMDFLAG_HIDDEN 0x0800 /* Elide from most listings */
43
+#define CMDFLAG_1ST_TIER 0x0001 /* Most important commands */
44
+#define CMDFLAG_2ND_TIER 0x0002 /* Obscure and seldom used commands */
45
+#define CMDFLAG_TEST 0x0004 /* Commands for testing only */
46
+#define CMDFLAG_WEBPAGE 0x0008 /* Web pages */
47
+#define CMDFLAG_COMMAND 0x0010 /* A command */
48
+#define CMDFLAG_SETTING 0x0020 /* A setting */
49
+#define CMDFLAG_VERSIONABLE 0x0040 /* A versionable setting */
50
+#define CMDFLAG_BLOCKTEXT 0x0080 /* Multi-line text setting */
51
+#define CMDFLAG_BOOLEAN 0x0100 /* A boolean setting */
52
+#define CMDFLAG_RAWCONTENT 0x0200 /* Do not interpret POST content */
53
+/* NOTE: 0x0400 = CMDFLAG_SENSITIVE in mkindex.c! */
54
+#define CMDFLAG_HIDDEN 0x0800 /* Elide from most listings */
55
+#define CMDFLAG_LDAVG_EXEMPT 0x1000 /* Exempt from load_control() */
5556
/**************************************************************************/
5657
5758
/* Values for the 2nd parameter to dispatch_name_search() */
5859
#define CMDFLAG_ANY 0x0038 /* Match anything */
5960
#define CMDFLAG_PREFIX 0x0200 /* Prefix match is ok */
6061
--- src/dispatch.c
+++ src/dispatch.c
@@ -38,22 +38,23 @@
38
39 /***************************************************************************
40 ** These macros must match similar macros in mkindex.c
41 ** Allowed values for CmdOrPage.eCmdFlags.
42 */
43 #define CMDFLAG_1ST_TIER 0x0001 /* Most important commands */
44 #define CMDFLAG_2ND_TIER 0x0002 /* Obscure and seldom used commands */
45 #define CMDFLAG_TEST 0x0004 /* Commands for testing only */
46 #define CMDFLAG_WEBPAGE 0x0008 /* Web pages */
47 #define CMDFLAG_COMMAND 0x0010 /* A command */
48 #define CMDFLAG_SETTING 0x0020 /* A setting */
49 #define CMDFLAG_VERSIONABLE 0x0040 /* A versionable setting */
50 #define CMDFLAG_BLOCKTEXT 0x0080 /* Multi-line text setting */
51 #define CMDFLAG_BOOLEAN 0x0100 /* A boolean setting */
52 #define CMDFLAG_RAWCONTENT 0x0200 /* Do not interpret POST content */
53 /* NOTE: 0x0400 = CMDFLAG_SENSITIVE in mkindex.c! */
54 #define CMDFLAG_HIDDEN 0x0800 /* Elide from most listings */
 
55 /**************************************************************************/
56
57 /* Values for the 2nd parameter to dispatch_name_search() */
58 #define CMDFLAG_ANY 0x0038 /* Match anything */
59 #define CMDFLAG_PREFIX 0x0200 /* Prefix match is ok */
60
--- src/dispatch.c
+++ src/dispatch.c
@@ -38,22 +38,23 @@
38
39 /***************************************************************************
40 ** These macros must match similar macros in mkindex.c
41 ** Allowed values for CmdOrPage.eCmdFlags.
42 */
43 #define CMDFLAG_1ST_TIER 0x0001 /* Most important commands */
44 #define CMDFLAG_2ND_TIER 0x0002 /* Obscure and seldom used commands */
45 #define CMDFLAG_TEST 0x0004 /* Commands for testing only */
46 #define CMDFLAG_WEBPAGE 0x0008 /* Web pages */
47 #define CMDFLAG_COMMAND 0x0010 /* A command */
48 #define CMDFLAG_SETTING 0x0020 /* A setting */
49 #define CMDFLAG_VERSIONABLE 0x0040 /* A versionable setting */
50 #define CMDFLAG_BLOCKTEXT 0x0080 /* Multi-line text setting */
51 #define CMDFLAG_BOOLEAN 0x0100 /* A boolean setting */
52 #define CMDFLAG_RAWCONTENT 0x0200 /* Do not interpret POST content */
53 /* NOTE: 0x0400 = CMDFLAG_SENSITIVE in mkindex.c! */
54 #define CMDFLAG_HIDDEN 0x0800 /* Elide from most listings */
55 #define CMDFLAG_LDAVG_EXEMPT 0x1000 /* Exempt from load_control() */
56 /**************************************************************************/
57
58 /* Values for the 2nd parameter to dispatch_name_search() */
59 #define CMDFLAG_ANY 0x0038 /* Match anything */
60 #define CMDFLAG_PREFIX 0x0200 /* Prefix match is ok */
61
--- src/loadctrl.c
+++ src/loadctrl.c
@@ -51,16 +51,19 @@
5151
** computer is too high. Admin and Setup users are exempt from this
5252
** restriction.
5353
*/
5454
void load_control(void){
5555
double mxLoad = atof(db_get("max-loadavg", 0));
56
+#if 1
57
+ /* Disable this block only to test load restrictions */
5658
if( mxLoad<=0.0 || mxLoad>=load_average() ) return;
5759
5860
login_check_credentials();
5961
if(g.perm.Admin || g.perm.Setup){
6062
return;
6163
}
64
+#endif
6265
6366
style_set_current_feature("test");
6467
style_header("Server Overload");
6568
@ <h2>The server load is currently too high.
6669
@ Please try again later.</h2>
6770
--- src/loadctrl.c
+++ src/loadctrl.c
@@ -51,16 +51,19 @@
51 ** computer is too high. Admin and Setup users are exempt from this
52 ** restriction.
53 */
54 void load_control(void){
55 double mxLoad = atof(db_get("max-loadavg", 0));
 
 
56 if( mxLoad<=0.0 || mxLoad>=load_average() ) return;
57
58 login_check_credentials();
59 if(g.perm.Admin || g.perm.Setup){
60 return;
61 }
 
62
63 style_set_current_feature("test");
64 style_header("Server Overload");
65 @ <h2>The server load is currently too high.
66 @ Please try again later.</h2>
67
--- src/loadctrl.c
+++ src/loadctrl.c
@@ -51,16 +51,19 @@
51 ** computer is too high. Admin and Setup users are exempt from this
52 ** restriction.
53 */
54 void load_control(void){
55 double mxLoad = atof(db_get("max-loadavg", 0));
56 #if 1
57 /* Disable this block only to test load restrictions */
58 if( mxLoad<=0.0 || mxLoad>=load_average() ) return;
59
60 login_check_credentials();
61 if(g.perm.Admin || g.perm.Setup){
62 return;
63 }
64 #endif
65
66 style_set_current_feature("test");
67 style_header("Server Overload");
68 @ <h2>The server load is currently too high.
69 @ Please try again later.</h2>
70
+3 -1
--- src/main.c
+++ src/main.c
@@ -1872,11 +1872,10 @@
18721872
}
18731873
18741874
/* At this point, the appropriate repository database file will have
18751875
** been opened.
18761876
*/
1877
- load_control();
18781877
18791878
/*
18801879
** Check to see if the first term of PATH_INFO specifies an
18811880
** alternative skin. This will be the case if the first term of
18821881
** PATH_INFO begins with "draftN/" where N is an integer between 1
@@ -2016,10 +2015,13 @@
20162015
@ <h1>Server Configuration Error</h1>
20172016
@ <p>The database schema on the server is out-of-date. Please ask
20182017
@ the administrator to run <b>fossil rebuild</b>.</p>
20192018
}
20202019
}else{
2020
+ if(0==(CMDFLAG_LDAVG_EXEMPT & pCmd->eCmdFlags)){
2021
+ load_control();
2022
+ }
20212023
#ifdef FOSSIL_ENABLE_JSON
20222024
static int jsonOnce = 0;
20232025
if( jsonOnce==0 && g.json.isJsonMode!=0 ){
20242026
assert(json_is_bootstrapped_early());
20252027
json_bootstrap_late();
20262028
--- src/main.c
+++ src/main.c
@@ -1872,11 +1872,10 @@
1872 }
1873
1874 /* At this point, the appropriate repository database file will have
1875 ** been opened.
1876 */
1877 load_control();
1878
1879 /*
1880 ** Check to see if the first term of PATH_INFO specifies an
1881 ** alternative skin. This will be the case if the first term of
1882 ** PATH_INFO begins with "draftN/" where N is an integer between 1
@@ -2016,10 +2015,13 @@
2016 @ <h1>Server Configuration Error</h1>
2017 @ <p>The database schema on the server is out-of-date. Please ask
2018 @ the administrator to run <b>fossil rebuild</b>.</p>
2019 }
2020 }else{
 
 
 
2021 #ifdef FOSSIL_ENABLE_JSON
2022 static int jsonOnce = 0;
2023 if( jsonOnce==0 && g.json.isJsonMode!=0 ){
2024 assert(json_is_bootstrapped_early());
2025 json_bootstrap_late();
2026
--- src/main.c
+++ src/main.c
@@ -1872,11 +1872,10 @@
1872 }
1873
1874 /* At this point, the appropriate repository database file will have
1875 ** been opened.
1876 */
 
1877
1878 /*
1879 ** Check to see if the first term of PATH_INFO specifies an
1880 ** alternative skin. This will be the case if the first term of
1881 ** PATH_INFO begins with "draftN/" where N is an integer between 1
@@ -2016,10 +2015,13 @@
2015 @ <h1>Server Configuration Error</h1>
2016 @ <p>The database schema on the server is out-of-date. Please ask
2017 @ the administrator to run <b>fossil rebuild</b>.</p>
2018 }
2019 }else{
2020 if(0==(CMDFLAG_LDAVG_EXEMPT & pCmd->eCmdFlags)){
2021 load_control();
2022 }
2023 #ifdef FOSSIL_ENABLE_JSON
2024 static int jsonOnce = 0;
2025 if( jsonOnce==0 && g.json.isJsonMode!=0 ){
2026 assert(json_is_bootstrapped_early());
2027 json_bootstrap_late();
2028
+1 -1
--- src/style.c
+++ src/style.c
@@ -1210,11 +1210,11 @@
12101210
** default.css. */
12111211
fossil_free(zFile);
12121212
}
12131213
12141214
/*
1215
-** WEBPAGE: style.css
1215
+** WEBPAGE: style.css loadavg-exempt
12161216
**
12171217
** Return the style sheet. The style sheet is assemblied from
12181218
** multiple sources, in order:
12191219
**
12201220
** (1) The built-in "default.css" style sheet containing basic defaults.
12211221
--- src/style.c
+++ src/style.c
@@ -1210,11 +1210,11 @@
1210 ** default.css. */
1211 fossil_free(zFile);
1212 }
1213
1214 /*
1215 ** WEBPAGE: style.css
1216 **
1217 ** Return the style sheet. The style sheet is assemblied from
1218 ** multiple sources, in order:
1219 **
1220 ** (1) The built-in "default.css" style sheet containing basic defaults.
1221
--- src/style.c
+++ src/style.c
@@ -1210,11 +1210,11 @@
1210 ** default.css. */
1211 fossil_free(zFile);
1212 }
1213
1214 /*
1215 ** WEBPAGE: style.css loadavg-exempt
1216 **
1217 ** Return the style sheet. The style sheet is assemblied from
1218 ** multiple sources, in order:
1219 **
1220 ** (1) The built-in "default.css" style sheet containing basic defaults.
1221
+15 -12
--- tools/mkindex.c
+++ tools/mkindex.c
@@ -80,22 +80,23 @@
8080
8181
/***************************************************************************
8282
** These macros must match similar macros in dispatch.c.
8383
**
8484
** Allowed values for CmdOrPage.eCmdFlags. */
85
-#define CMDFLAG_1ST_TIER 0x0001 /* Most important commands */
86
-#define CMDFLAG_2ND_TIER 0x0002 /* Obscure and seldom used commands */
87
-#define CMDFLAG_TEST 0x0004 /* Commands for testing only */
88
-#define CMDFLAG_WEBPAGE 0x0008 /* Web pages */
89
-#define CMDFLAG_COMMAND 0x0010 /* A command */
90
-#define CMDFLAG_SETTING 0x0020 /* A setting */
91
-#define CMDFLAG_VERSIONABLE 0x0040 /* A versionable setting */
92
-#define CMDFLAG_BLOCKTEXT 0x0080 /* Multi-line text setting */
93
-#define CMDFLAG_BOOLEAN 0x0100 /* A boolean setting */
94
-#define CMDFLAG_RAWCONTENT 0x0200 /* Do not interpret webpage content */
95
-#define CMDFLAG_SENSITIVE 0x0400 /* Security-sensitive setting */
96
-#define CMDFLAG_HIDDEN 0x0800 /* Elide from most listings */
85
+#define CMDFLAG_1ST_TIER 0x0001 /* Most important commands */
86
+#define CMDFLAG_2ND_TIER 0x0002 /* Obscure and seldom used commands */
87
+#define CMDFLAG_TEST 0x0004 /* Commands for testing only */
88
+#define CMDFLAG_WEBPAGE 0x0008 /* Web pages */
89
+#define CMDFLAG_COMMAND 0x0010 /* A command */
90
+#define CMDFLAG_SETTING 0x0020 /* A setting */
91
+#define CMDFLAG_VERSIONABLE 0x0040 /* A versionable setting */
92
+#define CMDFLAG_BLOCKTEXT 0x0080 /* Multi-line text setting */
93
+#define CMDFLAG_BOOLEAN 0x0100 /* A boolean setting */
94
+#define CMDFLAG_RAWCONTENT 0x0200 /* Do not interpret webpage content */
95
+#define CMDFLAG_SENSITIVE 0x0400 /* Security-sensitive setting */
96
+#define CMDFLAG_HIDDEN 0x0800 /* Elide from most listings */
97
+#define CMDFLAG_LDAVG_EXEMPT 0x1000 /* Exempt from load_control() */
9798
/**************************************************************************/
9899
99100
/*
100101
** Each entry looks like this:
101102
*/
@@ -260,10 +261,12 @@
260261
aEntry[nUsed].zDflt = string_dup(&zLine[i+8], j-8);
261262
}else if( j>9 && strncmp(&zLine[i], "variable=", 9)==0 ){
262263
aEntry[nUsed].zVar = string_dup(&zLine[i+9], j-9);
263264
}else if( j==6 && strncmp(&zLine[i], "hidden", 6)==0 ){
264265
aEntry[nUsed].eType |= CMDFLAG_HIDDEN;
266
+ }else if( j==14 && strncmp(&zLine[i], "loadavg-exempt", 14)==0 ){
267
+ aEntry[nUsed].eType |= CMDFLAG_LDAVG_EXEMPT;
265268
}else{
266269
fprintf(stderr, "%s:%d: unknown option: '%.*s'\n",
267270
zFile, nLine, j, &zLine[i]);
268271
nErr++;
269272
}
270273
--- tools/mkindex.c
+++ tools/mkindex.c
@@ -80,22 +80,23 @@
80
81 /***************************************************************************
82 ** These macros must match similar macros in dispatch.c.
83 **
84 ** Allowed values for CmdOrPage.eCmdFlags. */
85 #define CMDFLAG_1ST_TIER 0x0001 /* Most important commands */
86 #define CMDFLAG_2ND_TIER 0x0002 /* Obscure and seldom used commands */
87 #define CMDFLAG_TEST 0x0004 /* Commands for testing only */
88 #define CMDFLAG_WEBPAGE 0x0008 /* Web pages */
89 #define CMDFLAG_COMMAND 0x0010 /* A command */
90 #define CMDFLAG_SETTING 0x0020 /* A setting */
91 #define CMDFLAG_VERSIONABLE 0x0040 /* A versionable setting */
92 #define CMDFLAG_BLOCKTEXT 0x0080 /* Multi-line text setting */
93 #define CMDFLAG_BOOLEAN 0x0100 /* A boolean setting */
94 #define CMDFLAG_RAWCONTENT 0x0200 /* Do not interpret webpage content */
95 #define CMDFLAG_SENSITIVE 0x0400 /* Security-sensitive setting */
96 #define CMDFLAG_HIDDEN 0x0800 /* Elide from most listings */
 
97 /**************************************************************************/
98
99 /*
100 ** Each entry looks like this:
101 */
@@ -260,10 +261,12 @@
260 aEntry[nUsed].zDflt = string_dup(&zLine[i+8], j-8);
261 }else if( j>9 && strncmp(&zLine[i], "variable=", 9)==0 ){
262 aEntry[nUsed].zVar = string_dup(&zLine[i+9], j-9);
263 }else if( j==6 && strncmp(&zLine[i], "hidden", 6)==0 ){
264 aEntry[nUsed].eType |= CMDFLAG_HIDDEN;
 
 
265 }else{
266 fprintf(stderr, "%s:%d: unknown option: '%.*s'\n",
267 zFile, nLine, j, &zLine[i]);
268 nErr++;
269 }
270
--- tools/mkindex.c
+++ tools/mkindex.c
@@ -80,22 +80,23 @@
80
81 /***************************************************************************
82 ** These macros must match similar macros in dispatch.c.
83 **
84 ** Allowed values for CmdOrPage.eCmdFlags. */
85 #define CMDFLAG_1ST_TIER 0x0001 /* Most important commands */
86 #define CMDFLAG_2ND_TIER 0x0002 /* Obscure and seldom used commands */
87 #define CMDFLAG_TEST 0x0004 /* Commands for testing only */
88 #define CMDFLAG_WEBPAGE 0x0008 /* Web pages */
89 #define CMDFLAG_COMMAND 0x0010 /* A command */
90 #define CMDFLAG_SETTING 0x0020 /* A setting */
91 #define CMDFLAG_VERSIONABLE 0x0040 /* A versionable setting */
92 #define CMDFLAG_BLOCKTEXT 0x0080 /* Multi-line text setting */
93 #define CMDFLAG_BOOLEAN 0x0100 /* A boolean setting */
94 #define CMDFLAG_RAWCONTENT 0x0200 /* Do not interpret webpage content */
95 #define CMDFLAG_SENSITIVE 0x0400 /* Security-sensitive setting */
96 #define CMDFLAG_HIDDEN 0x0800 /* Elide from most listings */
97 #define CMDFLAG_LDAVG_EXEMPT 0x1000 /* Exempt from load_control() */
98 /**************************************************************************/
99
100 /*
101 ** Each entry looks like this:
102 */
@@ -260,10 +261,12 @@
261 aEntry[nUsed].zDflt = string_dup(&zLine[i+8], j-8);
262 }else if( j>9 && strncmp(&zLine[i], "variable=", 9)==0 ){
263 aEntry[nUsed].zVar = string_dup(&zLine[i+9], j-9);
264 }else if( j==6 && strncmp(&zLine[i], "hidden", 6)==0 ){
265 aEntry[nUsed].eType |= CMDFLAG_HIDDEN;
266 }else if( j==14 && strncmp(&zLine[i], "loadavg-exempt", 14)==0 ){
267 aEntry[nUsed].eType |= CMDFLAG_LDAVG_EXEMPT;
268 }else{
269 fprintf(stderr, "%s:%d: unknown option: '%.*s'\n",
270 zFile, nLine, j, &zLine[i]);
271 nErr++;
272 }
273

Keyboard Shortcuts

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