Fossil SCM
Merge the enhanced load control measure to trunk.
Commit
9413395f5b2306678f7a86b62c636ae4a9cd2fdd699ddd551f6cda0b19ba5b0c
Parent
346e45702cabbfe…
16 files changed
+1
-1
+6
-6
+1
-1
+1
+13
-12
+1
-1
+2
-2
+11
-2
+1
+3
-1
+1
-1
+1
-1
+1
-1
+19
+1
-1
+15
-12
+1
-1
| --- src/builtin.c | ||
| +++ src/builtin.c | ||
| @@ -156,11 +156,11 @@ | ||
| 156 | 156 | } |
| 157 | 157 | return; |
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | /* |
| 161 | -** WEBPAGE: builtin | |
| 161 | +** WEBPAGE: builtin loadavg-exempt | |
| 162 | 162 | ** |
| 163 | 163 | ** Return one of many built-in content files. Query parameters: |
| 164 | 164 | ** |
| 165 | 165 | ** name=FILENAME Return the single file whose name is FILENAME. |
| 166 | 166 | ** mimetype=TYPE Override the mimetype in the returned file to |
| 167 | 167 |
| --- 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 @@ | ||
| 128 | 128 | ** |
| 129 | 129 | ** This is the name of the builtin sound file to use for the alert tone. |
| 130 | 130 | ** The value must be the name of a builtin WAV file. |
| 131 | 131 | */ |
| 132 | 132 | /* |
| 133 | -** WEBPAGE: chat | |
| 133 | +** WEBPAGE: chat loadavg-exempt | |
| 134 | 134 | ** |
| 135 | 135 | ** Start up a browser-based chat session. |
| 136 | 136 | ** |
| 137 | 137 | ** This is the main page that humans use to access the chatroom. Simply |
| 138 | 138 | ** point a web-browser at /chat and the screen fills with the latest |
| @@ -342,11 +342,11 @@ | ||
| 342 | 342 | } |
| 343 | 343 | fossil_free(zTime); |
| 344 | 344 | } |
| 345 | 345 | |
| 346 | 346 | /* |
| 347 | -** WEBPAGE: chat-send hidden | |
| 347 | +** WEBPAGE: chat-send hidden loadavg-exempt | |
| 348 | 348 | ** |
| 349 | 349 | ** This page receives (via XHR) a new chat-message and/or a new file |
| 350 | 350 | ** to be entered into the chat history. |
| 351 | 351 | ** |
| 352 | 352 | ** On success it responds with an empty response: the new message |
| @@ -448,11 +448,11 @@ | ||
| 448 | 448 | fossil_free(zOut); |
| 449 | 449 | } |
| 450 | 450 | } |
| 451 | 451 | |
| 452 | 452 | /* |
| 453 | -** WEBPAGE: chat-poll hidden | |
| 453 | +** WEBPAGE: chat-poll hidden loadavg-exempt | |
| 454 | 454 | ** |
| 455 | 455 | ** The chat page generated by /chat using an XHR to this page to |
| 456 | 456 | ** request new chat content. A typical invocation is: |
| 457 | 457 | ** |
| 458 | 458 | ** /chat-poll/N |
| @@ -667,11 +667,11 @@ | ||
| 667 | 667 | cgi_set_content(&json); |
| 668 | 668 | return; |
| 669 | 669 | } |
| 670 | 670 | |
| 671 | 671 | /* |
| 672 | -** WEBPAGE: chat-fetch-one hidden | |
| 672 | +** WEBPAGE: chat-fetch-one hidden loadavg-exempt | |
| 673 | 673 | ** |
| 674 | 674 | ** /chat-fetch-one/N |
| 675 | 675 | ** |
| 676 | 676 | ** Fetches a single message with the given ID, if available. |
| 677 | 677 | ** |
| @@ -744,11 +744,11 @@ | ||
| 744 | 744 | } |
| 745 | 745 | db_finalize(&q); |
| 746 | 746 | } |
| 747 | 747 | |
| 748 | 748 | /* |
| 749 | -** WEBPAGE: chat-download hidden | |
| 749 | +** WEBPAGE: chat-download hidden loadavg-exempt | |
| 750 | 750 | ** |
| 751 | 751 | ** Download the CHAT.FILE attachment associated with a single chat |
| 752 | 752 | ** entry. The "name" query parameter begins with an integer that |
| 753 | 753 | ** identifies the particular chat message. The integer may be followed |
| 754 | 754 | ** by a / and a filename, which will indicate to the browser to use |
| @@ -777,11 +777,11 @@ | ||
| 777 | 777 | cgi_set_content(&r); |
| 778 | 778 | } |
| 779 | 779 | |
| 780 | 780 | |
| 781 | 781 | /* |
| 782 | -** WEBPAGE: chat-delete hidden | |
| 782 | +** WEBPAGE: chat-delete hidden loadavg-exempt | |
| 783 | 783 | ** |
| 784 | 784 | ** Delete the chat entry identified by the name query parameter. |
| 785 | 785 | ** Invoking fetch("chat-delete/"+msgid) from javascript in the client |
| 786 | 786 | ** will delete a chat entry from the CHAT table. |
| 787 | 787 | ** |
| 788 | 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 |
| 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 |
+1
-1
| --- src/diff.c | ||
| +++ src/diff.c | ||
| @@ -3594,11 +3594,11 @@ | ||
| 3594 | 3594 | |
| 3595 | 3595 | /* Gather query parameters */ |
| 3596 | 3596 | login_check_credentials(); |
| 3597 | 3597 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 3598 | 3598 | if( exclude_spiders() ) return; |
| 3599 | - load_control(); | |
| 3599 | + fossil_nice_default(); | |
| 3600 | 3600 | zFilename = P("filename"); |
| 3601 | 3601 | zRevision = PD("checkin",0); |
| 3602 | 3602 | zOrigin = P("origin"); |
| 3603 | 3603 | zLimit = P("limit"); |
| 3604 | 3604 | showLog = PB("log"); |
| 3605 | 3605 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -3594,11 +3594,11 @@ | |
| 3594 | |
| 3595 | /* Gather query parameters */ |
| 3596 | login_check_credentials(); |
| 3597 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 3598 | if( exclude_spiders() ) return; |
| 3599 | load_control(); |
| 3600 | zFilename = P("filename"); |
| 3601 | zRevision = PD("checkin",0); |
| 3602 | zOrigin = P("origin"); |
| 3603 | zLimit = P("limit"); |
| 3604 | showLog = PB("log"); |
| 3605 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -3594,11 +3594,11 @@ | |
| 3594 | |
| 3595 | /* Gather query parameters */ |
| 3596 | login_check_credentials(); |
| 3597 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 3598 | if( exclude_spiders() ) return; |
| 3599 | fossil_nice_default(); |
| 3600 | zFilename = P("filename"); |
| 3601 | zRevision = PD("checkin",0); |
| 3602 | zOrigin = P("origin"); |
| 3603 | zLimit = P("limit"); |
| 3604 | showLog = PB("log"); |
| 3605 |
+1
| --- src/diffcmd.c | ||
| +++ src/diffcmd.c | ||
| @@ -1182,9 +1182,10 @@ | ||
| 1182 | 1182 | DiffConfig DCfg; |
| 1183 | 1183 | login_check_credentials(); |
| 1184 | 1184 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 1185 | 1185 | if( zFrom==0 || zTo==0 ) fossil_redirect_home(); |
| 1186 | 1186 | |
| 1187 | + fossil_nice_default(); | |
| 1187 | 1188 | cgi_set_content_type("text/plain"); |
| 1188 | 1189 | diff_config_init(&DCfg, DIFF_VERBOSE); |
| 1189 | 1190 | diff_two_versions(zFrom, zTo, &DCfg, 0); |
| 1190 | 1191 | } |
| 1191 | 1192 |
| --- src/diffcmd.c | |
| +++ src/diffcmd.c | |
| @@ -1182,9 +1182,10 @@ | |
| 1182 | DiffConfig DCfg; |
| 1183 | login_check_credentials(); |
| 1184 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 1185 | if( zFrom==0 || zTo==0 ) fossil_redirect_home(); |
| 1186 | |
| 1187 | cgi_set_content_type("text/plain"); |
| 1188 | diff_config_init(&DCfg, DIFF_VERBOSE); |
| 1189 | diff_two_versions(zFrom, zTo, &DCfg, 0); |
| 1190 | } |
| 1191 |
| --- src/diffcmd.c | |
| +++ src/diffcmd.c | |
| @@ -1182,9 +1182,10 @@ | |
| 1182 | DiffConfig DCfg; |
| 1183 | login_check_credentials(); |
| 1184 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 1185 | if( zFrom==0 || zTo==0 ) fossil_redirect_home(); |
| 1186 | |
| 1187 | fossil_nice_default(); |
| 1188 | cgi_set_content_type("text/plain"); |
| 1189 | diff_config_init(&DCfg, DIFF_VERBOSE); |
| 1190 | diff_two_versions(zFrom, zTo, &DCfg, 0); |
| 1191 | } |
| 1192 |
+13
-12
| --- src/dispatch.c | ||
| +++ src/dispatch.c | ||
| @@ -38,22 +38,23 @@ | ||
| 38 | 38 | |
| 39 | 39 | /*************************************************************************** |
| 40 | 40 | ** These macros must match similar macros in mkindex.c |
| 41 | 41 | ** Allowed values for CmdOrPage.eCmdFlags. |
| 42 | 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 */ | |
| 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() */ | |
| 55 | 56 | /**************************************************************************/ |
| 56 | 57 | |
| 57 | 58 | /* Values for the 2nd parameter to dispatch_name_search() */ |
| 58 | 59 | #define CMDFLAG_ANY 0x0038 /* Match anything */ |
| 59 | 60 | #define CMDFLAG_PREFIX 0x0200 /* Prefix match is ok */ |
| 60 | 61 |
| --- 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 |
+1
-1
| --- src/info.c | ||
| +++ src/info.c | ||
| @@ -1182,11 +1182,11 @@ | ||
| 1182 | 1182 | int bInvert = PB("inv"); |
| 1183 | 1183 | |
| 1184 | 1184 | login_check_credentials(); |
| 1185 | 1185 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 1186 | 1186 | login_anonymous_available(); |
| 1187 | - load_control(); | |
| 1187 | + fossil_nice_default(); | |
| 1188 | 1188 | blob_init(&qp, 0, 0); |
| 1189 | 1189 | diffType = preferred_diff_type(); |
| 1190 | 1190 | zRe = P("regex"); |
| 1191 | 1191 | if( zRe ) re_compile(&pRe, zRe, 0); |
| 1192 | 1192 | zBranch = P("branch"); |
| 1193 | 1193 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -1182,11 +1182,11 @@ | |
| 1182 | int bInvert = PB("inv"); |
| 1183 | |
| 1184 | login_check_credentials(); |
| 1185 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 1186 | login_anonymous_available(); |
| 1187 | load_control(); |
| 1188 | blob_init(&qp, 0, 0); |
| 1189 | diffType = preferred_diff_type(); |
| 1190 | zRe = P("regex"); |
| 1191 | if( zRe ) re_compile(&pRe, zRe, 0); |
| 1192 | zBranch = P("branch"); |
| 1193 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -1182,11 +1182,11 @@ | |
| 1182 | int bInvert = PB("inv"); |
| 1183 | |
| 1184 | login_check_credentials(); |
| 1185 | if( !g.perm.Read ){ login_needed(g.anon.Read); return; } |
| 1186 | login_anonymous_available(); |
| 1187 | fossil_nice_default(); |
| 1188 | blob_init(&qp, 0, 0); |
| 1189 | diffType = preferred_diff_type(); |
| 1190 | zRe = P("regex"); |
| 1191 | if( zRe ) re_compile(&pRe, zRe, 0); |
| 1192 | zBranch = P("branch"); |
| 1193 |
+2
-2
| --- src/json.c | ||
| +++ src/json.c | ||
| @@ -739,11 +739,11 @@ | ||
| 739 | 739 | ** been called. In general, this function should be used sparingly, |
| 740 | 740 | ** e.g. from low-level support functions like fossil_warning() where |
| 741 | 741 | ** there is genuine uncertainty about whether (or not) the JSON setup |
| 742 | 742 | ** has already been called. |
| 743 | 743 | */ |
| 744 | -int json_is_bootstrapped_early(){ | |
| 744 | +int json_is_bootstrapped_early(void){ | |
| 745 | 745 | return ((g.json.gc.v != NULL) && (g.json.gc.a != NULL)); |
| 746 | 746 | } |
| 747 | 747 | |
| 748 | 748 | /* |
| 749 | 749 | ** Initializes some JSON bits which need to be initialized relatively |
| @@ -758,11 +758,11 @@ | ||
| 758 | 758 | ** up. e.g. it must not use cgi_parameter() and friends because this |
| 759 | 759 | ** must be called before those data are initialized. |
| 760 | 760 | ** |
| 761 | 761 | ** If called multiple times, calls after the first are a no-op. |
| 762 | 762 | */ |
| 763 | -void json_bootstrap_early(){ | |
| 763 | +void json_bootstrap_early(void){ | |
| 764 | 764 | cson_value * v; |
| 765 | 765 | |
| 766 | 766 | if(g.json.gc.v!=NULL){ |
| 767 | 767 | /* Avoid multiple bootstrappings. */ |
| 768 | 768 | return; |
| 769 | 769 |
| --- src/json.c | |
| +++ src/json.c | |
| @@ -739,11 +739,11 @@ | |
| 739 | ** been called. In general, this function should be used sparingly, |
| 740 | ** e.g. from low-level support functions like fossil_warning() where |
| 741 | ** there is genuine uncertainty about whether (or not) the JSON setup |
| 742 | ** has already been called. |
| 743 | */ |
| 744 | int json_is_bootstrapped_early(){ |
| 745 | return ((g.json.gc.v != NULL) && (g.json.gc.a != NULL)); |
| 746 | } |
| 747 | |
| 748 | /* |
| 749 | ** Initializes some JSON bits which need to be initialized relatively |
| @@ -758,11 +758,11 @@ | |
| 758 | ** up. e.g. it must not use cgi_parameter() and friends because this |
| 759 | ** must be called before those data are initialized. |
| 760 | ** |
| 761 | ** If called multiple times, calls after the first are a no-op. |
| 762 | */ |
| 763 | void json_bootstrap_early(){ |
| 764 | cson_value * v; |
| 765 | |
| 766 | if(g.json.gc.v!=NULL){ |
| 767 | /* Avoid multiple bootstrappings. */ |
| 768 | return; |
| 769 |
| --- src/json.c | |
| +++ src/json.c | |
| @@ -739,11 +739,11 @@ | |
| 739 | ** been called. In general, this function should be used sparingly, |
| 740 | ** e.g. from low-level support functions like fossil_warning() where |
| 741 | ** there is genuine uncertainty about whether (or not) the JSON setup |
| 742 | ** has already been called. |
| 743 | */ |
| 744 | int json_is_bootstrapped_early(void){ |
| 745 | return ((g.json.gc.v != NULL) && (g.json.gc.a != NULL)); |
| 746 | } |
| 747 | |
| 748 | /* |
| 749 | ** Initializes some JSON bits which need to be initialized relatively |
| @@ -758,11 +758,11 @@ | |
| 758 | ** up. e.g. it must not use cgi_parameter() and friends because this |
| 759 | ** must be called before those data are initialized. |
| 760 | ** |
| 761 | ** If called multiple times, calls after the first are a no-op. |
| 762 | */ |
| 763 | void json_bootstrap_early(void){ |
| 764 | cson_value * v; |
| 765 | |
| 766 | if(g.json.gc.v!=NULL){ |
| 767 | /* Avoid multiple bootstrappings. */ |
| 768 | return; |
| 769 |
+11
-2
| --- src/loadctrl.c | ||
| +++ src/loadctrl.c | ||
| @@ -45,16 +45,25 @@ | ||
| 45 | 45 | void loadavg_test_cmd(void){ |
| 46 | 46 | fossil_print("load-average: %f\n", load_average()); |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | /* |
| 50 | -** Abort the current operation of the load average of the host computer | |
| 51 | -** is too high. | |
| 50 | +** Abort the current page request if the load average of the host | |
| 51 | +** computer is too high. Admin and Setup users are exempt from this | |
| 52 | +** restriction. | |
| 52 | 53 | */ |
| 53 | 54 | void load_control(void){ |
| 54 | 55 | double mxLoad = atof(db_get("max-loadavg", 0)); |
| 56 | +#if 1 | |
| 57 | + /* Disable this block only to test load restrictions */ | |
| 55 | 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 | |
| 56 | 65 | |
| 57 | 66 | style_set_current_feature("test"); |
| 58 | 67 | style_header("Server Overload"); |
| 59 | 68 | @ <h2>The server load is currently too high. |
| 60 | 69 | @ Please try again later.</h2> |
| 61 | 70 |
| --- src/loadctrl.c | |
| +++ src/loadctrl.c | |
| @@ -45,16 +45,25 @@ | |
| 45 | void loadavg_test_cmd(void){ |
| 46 | fossil_print("load-average: %f\n", load_average()); |
| 47 | } |
| 48 | |
| 49 | /* |
| 50 | ** Abort the current operation of the load average of the host computer |
| 51 | ** is too high. |
| 52 | */ |
| 53 | void load_control(void){ |
| 54 | double mxLoad = atof(db_get("max-loadavg", 0)); |
| 55 | if( mxLoad<=0.0 || mxLoad>=load_average() ) return; |
| 56 | |
| 57 | style_set_current_feature("test"); |
| 58 | style_header("Server Overload"); |
| 59 | @ <h2>The server load is currently too high. |
| 60 | @ Please try again later.</h2> |
| 61 |
| --- src/loadctrl.c | |
| +++ src/loadctrl.c | |
| @@ -45,16 +45,25 @@ | |
| 45 | void loadavg_test_cmd(void){ |
| 46 | fossil_print("load-average: %f\n", load_average()); |
| 47 | } |
| 48 | |
| 49 | /* |
| 50 | ** Abort the current page request if the load average of the host |
| 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 |
+1
| --- src/login.c | ||
| +++ src/login.c | ||
| @@ -985,10 +985,11 @@ | ||
| 985 | 985 | ** g.userUid Database USER.UID value. Might be -1 for "nobody" |
| 986 | 986 | ** g.zLogin Database USER.LOGIN value. NULL for user "nobody" |
| 987 | 987 | ** g.perm Permissions granted to this user |
| 988 | 988 | ** g.anon Permissions that would be available to anonymous |
| 989 | 989 | ** g.isHuman True if the user is human, not a spider or robot |
| 990 | +** g.perm Populated based on user account's capabilities | |
| 990 | 991 | ** |
| 991 | 992 | */ |
| 992 | 993 | void login_check_credentials(void){ |
| 993 | 994 | int uid = 0; /* User id */ |
| 994 | 995 | const char *zCookie; /* Text of the login cookie */ |
| 995 | 996 |
| --- src/login.c | |
| +++ src/login.c | |
| @@ -985,10 +985,11 @@ | |
| 985 | ** g.userUid Database USER.UID value. Might be -1 for "nobody" |
| 986 | ** g.zLogin Database USER.LOGIN value. NULL for user "nobody" |
| 987 | ** g.perm Permissions granted to this user |
| 988 | ** g.anon Permissions that would be available to anonymous |
| 989 | ** g.isHuman True if the user is human, not a spider or robot |
| 990 | ** |
| 991 | */ |
| 992 | void login_check_credentials(void){ |
| 993 | int uid = 0; /* User id */ |
| 994 | const char *zCookie; /* Text of the login cookie */ |
| 995 |
| --- src/login.c | |
| +++ src/login.c | |
| @@ -985,10 +985,11 @@ | |
| 985 | ** g.userUid Database USER.UID value. Might be -1 for "nobody" |
| 986 | ** g.zLogin Database USER.LOGIN value. NULL for user "nobody" |
| 987 | ** g.perm Permissions granted to this user |
| 988 | ** g.anon Permissions that would be available to anonymous |
| 989 | ** g.isHuman True if the user is human, not a spider or robot |
| 990 | ** g.perm Populated based on user account's capabilities |
| 991 | ** |
| 992 | */ |
| 993 | void login_check_credentials(void){ |
| 994 | int uid = 0; /* User id */ |
| 995 | const char *zCookie; /* Text of the login cookie */ |
| 996 |
+3
-1
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -1873,11 +1873,10 @@ | ||
| 1873 | 1873 | |
| 1874 | 1874 | /* At this point, the appropriate repository database file will have |
| 1875 | 1875 | ** been opened. |
| 1876 | 1876 | */ |
| 1877 | 1877 | |
| 1878 | - | |
| 1879 | 1878 | /* |
| 1880 | 1879 | ** Check to see if the first term of PATH_INFO specifies an |
| 1881 | 1880 | ** alternative skin. This will be the case if the first term of |
| 1882 | 1881 | ** PATH_INFO begins with "draftN/" where N is an integer between 1 |
| 1883 | 1882 | ** and 9. If so, activate the skin associated with that draft. |
| @@ -2016,10 +2015,13 @@ | ||
| 2016 | 2015 | @ <h1>Server Configuration Error</h1> |
| 2017 | 2016 | @ <p>The database schema on the server is out-of-date. Please ask |
| 2018 | 2017 | @ the administrator to run <b>fossil rebuild</b>.</p> |
| 2019 | 2018 | } |
| 2020 | 2019 | }else{ |
| 2020 | + if(0==(CMDFLAG_LDAVG_EXEMPT & pCmd->eCmdFlags)){ | |
| 2021 | + load_control(); | |
| 2022 | + } | |
| 2021 | 2023 | #ifdef FOSSIL_ENABLE_JSON |
| 2022 | 2024 | static int jsonOnce = 0; |
| 2023 | 2025 | if( jsonOnce==0 && g.json.isJsonMode!=0 ){ |
| 2024 | 2026 | assert(json_is_bootstrapped_early()); |
| 2025 | 2027 | json_bootstrap_late(); |
| 2026 | 2028 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -1873,11 +1873,10 @@ | |
| 1873 | |
| 1874 | /* At this point, the appropriate repository database file will have |
| 1875 | ** been opened. |
| 1876 | */ |
| 1877 | |
| 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 |
| 1883 | ** and 9. If so, activate the skin associated with that draft. |
| @@ -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 | |
| @@ -1873,11 +1873,10 @@ | |
| 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 |
| 1882 | ** and 9. If so, activate the skin associated with that draft. |
| @@ -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/stat.c | ||
| +++ src/stat.c | ||
| @@ -963,11 +963,11 @@ | ||
| 963 | 963 | */ |
| 964 | 964 | if( !g.perm.Write && !db_get_boolean("artifact_stats_enable",0) ){ |
| 965 | 965 | login_needed(g.anon.Write); |
| 966 | 966 | return; |
| 967 | 967 | } |
| 968 | - load_control(); | |
| 968 | + fossil_nice_default(); | |
| 969 | 969 | |
| 970 | 970 | style_set_current_feature("stat"); |
| 971 | 971 | style_header("Artifact Statistics"); |
| 972 | 972 | style_submenu_element("Repository Stats", "stat"); |
| 973 | 973 | style_submenu_element("Artifact List", "bloblist"); |
| 974 | 974 |
| --- src/stat.c | |
| +++ src/stat.c | |
| @@ -963,11 +963,11 @@ | |
| 963 | */ |
| 964 | if( !g.perm.Write && !db_get_boolean("artifact_stats_enable",0) ){ |
| 965 | login_needed(g.anon.Write); |
| 966 | return; |
| 967 | } |
| 968 | load_control(); |
| 969 | |
| 970 | style_set_current_feature("stat"); |
| 971 | style_header("Artifact Statistics"); |
| 972 | style_submenu_element("Repository Stats", "stat"); |
| 973 | style_submenu_element("Artifact List", "bloblist"); |
| 974 |
| --- src/stat.c | |
| +++ src/stat.c | |
| @@ -963,11 +963,11 @@ | |
| 963 | */ |
| 964 | if( !g.perm.Write && !db_get_boolean("artifact_stats_enable",0) ){ |
| 965 | login_needed(g.anon.Write); |
| 966 | return; |
| 967 | } |
| 968 | fossil_nice_default(); |
| 969 | |
| 970 | style_set_current_feature("stat"); |
| 971 | style_header("Artifact Statistics"); |
| 972 | style_submenu_element("Repository Stats", "stat"); |
| 973 | style_submenu_element("Artifact List", "bloblist"); |
| 974 |
+1
-1
| --- src/style.c | ||
| +++ src/style.c | ||
| @@ -1210,11 +1210,11 @@ | ||
| 1210 | 1210 | ** default.css. */ |
| 1211 | 1211 | fossil_free(zFile); |
| 1212 | 1212 | } |
| 1213 | 1213 | |
| 1214 | 1214 | /* |
| 1215 | -** WEBPAGE: style.css | |
| 1215 | +** WEBPAGE: style.css loadavg-exempt | |
| 1216 | 1216 | ** |
| 1217 | 1217 | ** Return the style sheet. The style sheet is assemblied from |
| 1218 | 1218 | ** multiple sources, in order: |
| 1219 | 1219 | ** |
| 1220 | 1220 | ** (1) The built-in "default.css" style sheet containing basic defaults. |
| 1221 | 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 |
| 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 |
+1
-1
| --- src/tar.c | ||
| +++ src/tar.c | ||
| @@ -756,11 +756,11 @@ | ||
| 756 | 756 | Blob tarball; /* Tarball accumulated here */ |
| 757 | 757 | const char *z; |
| 758 | 758 | |
| 759 | 759 | login_check_credentials(); |
| 760 | 760 | if( !g.perm.Zip ){ login_needed(g.anon.Zip); return; } |
| 761 | - load_control(); | |
| 761 | + fossil_nice_default(); | |
| 762 | 762 | zName = fossil_strdup(PD("name","")); |
| 763 | 763 | z = P("r"); |
| 764 | 764 | if( z==0 ) z = P("uuid"); |
| 765 | 765 | if( z==0 ) z = tar_uuid_from_name(&zName); |
| 766 | 766 | if( z==0 ) z = "trunk"; |
| 767 | 767 |
| --- src/tar.c | |
| +++ src/tar.c | |
| @@ -756,11 +756,11 @@ | |
| 756 | Blob tarball; /* Tarball accumulated here */ |
| 757 | const char *z; |
| 758 | |
| 759 | login_check_credentials(); |
| 760 | if( !g.perm.Zip ){ login_needed(g.anon.Zip); return; } |
| 761 | load_control(); |
| 762 | zName = fossil_strdup(PD("name","")); |
| 763 | z = P("r"); |
| 764 | if( z==0 ) z = P("uuid"); |
| 765 | if( z==0 ) z = tar_uuid_from_name(&zName); |
| 766 | if( z==0 ) z = "trunk"; |
| 767 |
| --- src/tar.c | |
| +++ src/tar.c | |
| @@ -756,11 +756,11 @@ | |
| 756 | Blob tarball; /* Tarball accumulated here */ |
| 757 | const char *z; |
| 758 | |
| 759 | login_check_credentials(); |
| 760 | if( !g.perm.Zip ){ login_needed(g.anon.Zip); return; } |
| 761 | fossil_nice_default(); |
| 762 | zName = fossil_strdup(PD("name","")); |
| 763 | z = P("r"); |
| 764 | if( z==0 ) z = P("uuid"); |
| 765 | if( z==0 ) z = tar_uuid_from_name(&zName); |
| 766 | if( z==0 ) z = "trunk"; |
| 767 |
+19
| --- src/util.c | ||
| +++ src/util.c | ||
| @@ -896,5 +896,24 @@ | ||
| 896 | 896 | } |
| 897 | 897 | } |
| 898 | 898 | #endif |
| 899 | 899 | return zBrowser; |
| 900 | 900 | } |
| 901 | + | |
| 902 | +/* | |
| 903 | +** On non-Windows systems, calls nice(2) with the given level. Errors | |
| 904 | +** are ignored. On Windows this is a no-op. | |
| 905 | +*/ | |
| 906 | +void fossil_nice(int level){ | |
| 907 | +#ifndef _WIN32 | |
| 908 | + nice(level); | |
| 909 | +#else | |
| 910 | + (void)level; | |
| 911 | +#endif | |
| 912 | +} | |
| 913 | + | |
| 914 | +/* | |
| 915 | +** Calls fossil_nice() with a default level. | |
| 916 | +*/ | |
| 917 | +void fossil_nice_default(void){ | |
| 918 | + fossil_nice(20); | |
| 919 | +} | |
| 901 | 920 |
| --- src/util.c | |
| +++ src/util.c | |
| @@ -896,5 +896,24 @@ | |
| 896 | } |
| 897 | } |
| 898 | #endif |
| 899 | return zBrowser; |
| 900 | } |
| 901 |
| --- src/util.c | |
| +++ src/util.c | |
| @@ -896,5 +896,24 @@ | |
| 896 | } |
| 897 | } |
| 898 | #endif |
| 899 | return zBrowser; |
| 900 | } |
| 901 | |
| 902 | /* |
| 903 | ** On non-Windows systems, calls nice(2) with the given level. Errors |
| 904 | ** are ignored. On Windows this is a no-op. |
| 905 | */ |
| 906 | void fossil_nice(int level){ |
| 907 | #ifndef _WIN32 |
| 908 | nice(level); |
| 909 | #else |
| 910 | (void)level; |
| 911 | #endif |
| 912 | } |
| 913 | |
| 914 | /* |
| 915 | ** Calls fossil_nice() with a default level. |
| 916 | */ |
| 917 | void fossil_nice_default(void){ |
| 918 | fossil_nice(20); |
| 919 | } |
| 920 |
+1
-1
| --- src/zip.c | ||
| +++ src/zip.c | ||
| @@ -921,11 +921,11 @@ | ||
| 921 | 921 | zType = "SQL"; |
| 922 | 922 | }else{ |
| 923 | 923 | eType = ARCHIVE_ZIP; |
| 924 | 924 | zType = "ZIP"; |
| 925 | 925 | } |
| 926 | - load_control(); | |
| 926 | + fossil_nice_default(); | |
| 927 | 927 | zName = fossil_strdup(PD("name","")); |
| 928 | 928 | z = P("r"); |
| 929 | 929 | if( z==0 ) z = P("uuid"); |
| 930 | 930 | if( z==0 ) z = tar_uuid_from_name(&zName); |
| 931 | 931 | if( z==0 ) z = "trunk"; |
| 932 | 932 |
| --- src/zip.c | |
| +++ src/zip.c | |
| @@ -921,11 +921,11 @@ | |
| 921 | zType = "SQL"; |
| 922 | }else{ |
| 923 | eType = ARCHIVE_ZIP; |
| 924 | zType = "ZIP"; |
| 925 | } |
| 926 | load_control(); |
| 927 | zName = fossil_strdup(PD("name","")); |
| 928 | z = P("r"); |
| 929 | if( z==0 ) z = P("uuid"); |
| 930 | if( z==0 ) z = tar_uuid_from_name(&zName); |
| 931 | if( z==0 ) z = "trunk"; |
| 932 |
| --- src/zip.c | |
| +++ src/zip.c | |
| @@ -921,11 +921,11 @@ | |
| 921 | zType = "SQL"; |
| 922 | }else{ |
| 923 | eType = ARCHIVE_ZIP; |
| 924 | zType = "ZIP"; |
| 925 | } |
| 926 | fossil_nice_default(); |
| 927 | zName = fossil_strdup(PD("name","")); |
| 928 | z = P("r"); |
| 929 | if( z==0 ) z = P("uuid"); |
| 930 | if( z==0 ) z = tar_uuid_from_name(&zName); |
| 931 | if( z==0 ) z = "trunk"; |
| 932 |
+15
-12
| --- tools/mkindex.c | ||
| +++ tools/mkindex.c | ||
| @@ -80,22 +80,23 @@ | ||
| 80 | 80 | |
| 81 | 81 | /*************************************************************************** |
| 82 | 82 | ** These macros must match similar macros in dispatch.c. |
| 83 | 83 | ** |
| 84 | 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 */ | |
| 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() */ | |
| 97 | 98 | /**************************************************************************/ |
| 98 | 99 | |
| 99 | 100 | /* |
| 100 | 101 | ** Each entry looks like this: |
| 101 | 102 | */ |
| @@ -260,10 +261,12 @@ | ||
| 260 | 261 | aEntry[nUsed].zDflt = string_dup(&zLine[i+8], j-8); |
| 261 | 262 | }else if( j>9 && strncmp(&zLine[i], "variable=", 9)==0 ){ |
| 262 | 263 | aEntry[nUsed].zVar = string_dup(&zLine[i+9], j-9); |
| 263 | 264 | }else if( j==6 && strncmp(&zLine[i], "hidden", 6)==0 ){ |
| 264 | 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; | |
| 265 | 268 | }else{ |
| 266 | 269 | fprintf(stderr, "%s:%d: unknown option: '%.*s'\n", |
| 267 | 270 | zFile, nLine, j, &zLine[i]); |
| 268 | 271 | nErr++; |
| 269 | 272 | } |
| 270 | 273 |
| --- 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 |