Fossil SCM

Fix ETags support for when compiling with FOSSIL_ENABLE_TH1_HOOKS.

drh 2018-02-24 17:08 UTC etags
Commit 43a66b58db29aab0ce5a6e3beb27c761b02df4d632b5eb0ee7ee02869dccc749
2 files changed +18 -11 +1 -1
+18 -11
--- src/dispatch.c
+++ src/dispatch.c
@@ -38,24 +38,31 @@
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 */
43
+#define CMDFLAG_1ST_TIER 0x00001 /* Most important commands */
44
+#define CMDFLAG_2ND_TIER 0x00002 /* Obscure and seldom used commands */
45
+#define CMDFLAG_TEST 0x00004 /* Commands for testing only */
46
+#define CMDFLAG_WEBPAGE 0x00008 /* Web pages */
47
+#define CMDFLAG_COMMAND 0x00010 /* A command */
48
+#define CMDFLAG_SETTING 0x00020 /* A setting */
49
+#define CMDFLAG_VERSIONABLE 0x00040 /* A versionable setting */
50
+#define CMDFLAG_BLOCKTEXT 0x00080 /* Multi-line text setting */
51
+#define CMDFLAG_BOOLEAN 0x00100 /* A boolean setting */
52
+#define CMDFLAG_CONST 0x00000 /* ETAG_CONST */
53
+#define CMDFLAG_CONFIG 0x01000 /* ETAG_CONFIG */
54
+#define CMDFLAG_DATA 0x02000 /* ETAG_DATA */
55
+#define CMDFLAG_COOKIE 0x04000 /* ETAG_COOKIE */
56
+#define CMDFLAG_DYNAMIC 0x10000 /* ETAG_DYNAMIC - on by default */
57
+#define CMDFLAG_ETAG 0x1f000 /* Mask of all ETAG entries */
58
+#define CMDFLAG_TO_ETAG(X) ((X)>>12)
5259
/**************************************************************************/
5360
5461
/* Values for the 2nd parameter to dispatch_name_search() */
55
-#define CMDFLAG_ANY 0x0038 /* Match anything */
56
-#define CMDFLAG_PREFIX 0x0200 /* Prefix match is ok */
62
+#define CMDFLAG_ANY 0x00038 /* Match anything */
63
+#define CMDFLAG_PREFIX 0x00200 /* Prefix match is ok */
5764
5865
#endif /* INTERFACE */
5966
6067
/*
6168
** The page_index.h file contains the definition for aCommand[] - an array
6269
--- src/dispatch.c
+++ src/dispatch.c
@@ -38,24 +38,31 @@
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 /**************************************************************************/
53
54 /* Values for the 2nd parameter to dispatch_name_search() */
55 #define CMDFLAG_ANY 0x0038 /* Match anything */
56 #define CMDFLAG_PREFIX 0x0200 /* Prefix match is ok */
57
58 #endif /* INTERFACE */
59
60 /*
61 ** The page_index.h file contains the definition for aCommand[] - an array
62
--- src/dispatch.c
+++ src/dispatch.c
@@ -38,24 +38,31 @@
38
39 /***************************************************************************
40 ** These macros must match similar macros in mkindex.c
41 ** Allowed values for CmdOrPage.eCmdFlags.
42 */
43 #define CMDFLAG_1ST_TIER 0x00001 /* Most important commands */
44 #define CMDFLAG_2ND_TIER 0x00002 /* Obscure and seldom used commands */
45 #define CMDFLAG_TEST 0x00004 /* Commands for testing only */
46 #define CMDFLAG_WEBPAGE 0x00008 /* Web pages */
47 #define CMDFLAG_COMMAND 0x00010 /* A command */
48 #define CMDFLAG_SETTING 0x00020 /* A setting */
49 #define CMDFLAG_VERSIONABLE 0x00040 /* A versionable setting */
50 #define CMDFLAG_BLOCKTEXT 0x00080 /* Multi-line text setting */
51 #define CMDFLAG_BOOLEAN 0x00100 /* A boolean setting */
52 #define CMDFLAG_CONST 0x00000 /* ETAG_CONST */
53 #define CMDFLAG_CONFIG 0x01000 /* ETAG_CONFIG */
54 #define CMDFLAG_DATA 0x02000 /* ETAG_DATA */
55 #define CMDFLAG_COOKIE 0x04000 /* ETAG_COOKIE */
56 #define CMDFLAG_DYNAMIC 0x10000 /* ETAG_DYNAMIC - on by default */
57 #define CMDFLAG_ETAG 0x1f000 /* Mask of all ETAG entries */
58 #define CMDFLAG_TO_ETAG(X) ((X)>>12)
59 /**************************************************************************/
60
61 /* Values for the 2nd parameter to dispatch_name_search() */
62 #define CMDFLAG_ANY 0x00038 /* Match anything */
63 #define CMDFLAG_PREFIX 0x00200 /* Prefix match is ok */
64
65 #endif /* INTERFACE */
66
67 /*
68 ** The page_index.h file contains the definition for aCommand[] - an array
69
+1 -1
--- src/main.c
+++ src/main.c
@@ -1765,14 +1765,14 @@
17651765
if( !g.fNoThHook ){
17661766
rc = Th_WebpageHook(pCmd->zName+1, pCmd->eCmdFlags);
17671767
}else{
17681768
rc = TH_OK;
17691769
}
1770
- etag_require(CMDFLAG_TO_ETAG(pCmd->eType));
17711770
if( rc==TH_OK || rc==TH_RETURN || rc==TH_CONTINUE ){
17721771
if( rc==TH_OK || rc==TH_RETURN ){
17731772
#endif
1773
+ etag_require(CMDFLAG_TO_ETAG(pCmd->eCmdFlags));
17741774
pCmd->xFunc();
17751775
#ifdef FOSSIL_ENABLE_TH1_HOOKS
17761776
}
17771777
if( !g.fNoThHook && (rc==TH_OK || rc==TH_CONTINUE) ){
17781778
Th_WebpageNotify(pCmd->zName+1, pCmd->eCmdFlags);
17791779
--- src/main.c
+++ src/main.c
@@ -1765,14 +1765,14 @@
1765 if( !g.fNoThHook ){
1766 rc = Th_WebpageHook(pCmd->zName+1, pCmd->eCmdFlags);
1767 }else{
1768 rc = TH_OK;
1769 }
1770 etag_require(CMDFLAG_TO_ETAG(pCmd->eType));
1771 if( rc==TH_OK || rc==TH_RETURN || rc==TH_CONTINUE ){
1772 if( rc==TH_OK || rc==TH_RETURN ){
1773 #endif
 
1774 pCmd->xFunc();
1775 #ifdef FOSSIL_ENABLE_TH1_HOOKS
1776 }
1777 if( !g.fNoThHook && (rc==TH_OK || rc==TH_CONTINUE) ){
1778 Th_WebpageNotify(pCmd->zName+1, pCmd->eCmdFlags);
1779
--- src/main.c
+++ src/main.c
@@ -1765,14 +1765,14 @@
1765 if( !g.fNoThHook ){
1766 rc = Th_WebpageHook(pCmd->zName+1, pCmd->eCmdFlags);
1767 }else{
1768 rc = TH_OK;
1769 }
 
1770 if( rc==TH_OK || rc==TH_RETURN || rc==TH_CONTINUE ){
1771 if( rc==TH_OK || rc==TH_RETURN ){
1772 #endif
1773 etag_require(CMDFLAG_TO_ETAG(pCmd->eCmdFlags));
1774 pCmd->xFunc();
1775 #ifdef FOSSIL_ENABLE_TH1_HOOKS
1776 }
1777 if( !g.fNoThHook && (rc==TH_OK || rc==TH_CONTINUE) ){
1778 Th_WebpageNotify(pCmd->zName+1, pCmd->eCmdFlags);
1779

Keyboard Shortcuts

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