Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | Another attempt to adjust JSON session lifecycle. |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | descendants | both | jsonTestsPass |
| Files: | files | file ages | folders |
| SHA3-256: |
a34c7b37f274b652304160f7ca802785 |
| User & Date: | mistachkin 2020-06-12 20:57:42.843 |
Context
|
2020-06-12
| ||
| 21:07 | Handle missing 'json' Tcl package gracefully. ... (check-in: e3297200e5 user: mistachkin tags: jsonTestsPass) | |
| 20:57 | Another attempt to adjust JSON session lifecycle. ... (check-in: a34c7b37f2 user: mistachkin tags: jsonTestsPass) | |
|
2020-06-11
| ||
| 23:55 | More fixes. ... (check-in: 37089a5ed1 user: mistachkin tags: jsonTestsPass) | |
Changes
Changes to src/cgi.c.
| ︙ | ︙ | |||
1107 1108 1109 1110 1111 1112 1113 |
&& (zPathInfo[5]==0 || zPathInfo[5]=='/')){
/* We need to change some following behaviour depending on whether
** we are operating in JSON mode or not. We cannot, however, be
** certain whether we should/need to be in JSON mode until the
** PATH_INFO is set up.
*/
g.json.isJsonMode = 1;
| < | 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 |
&& (zPathInfo[5]==0 || zPathInfo[5]=='/')){
/* We need to change some following behaviour depending on whether
** we are operating in JSON mode or not. We cannot, however, be
** certain whether we should/need to be in JSON mode until the
** PATH_INFO is set up.
*/
g.json.isJsonMode = 1;
}else{
assert(!g.json.isJsonMode &&
"Internal misconfiguration of g.json.isJsonMode");
}
#endif
z = (char*)P("HTTP_COOKIE");
if( z ){
|
| ︙ | ︙ | |||
1811 1812 1813 1814 1815 1816 1817 |
cgi_setenv("SCRIPT_NAME", "");
}
for(i=0; zToken[i] && zToken[i]!='?'; i++){}
if( zToken[i] ) zToken[i++] = 0;
if( nCycles==0 ){
cgi_setenv("PATH_INFO", zToken);
| < < < < < < < < < < < < < < < | 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 |
cgi_setenv("SCRIPT_NAME", "");
}
for(i=0; zToken[i] && zToken[i]!='?'; i++){}
if( zToken[i] ) zToken[i++] = 0;
if( nCycles==0 ){
cgi_setenv("PATH_INFO", zToken);
}else{
cgi_replace_parameter("PATH_INFO", mprintf("%s",zToken));
}
/* Get all the optional fields that follow the first line.
*/
while( fgets(zLine,sizeof(zLine),g.httpIn) ){
|
| ︙ | ︙ |
Changes to src/db.c.
| ︙ | ︙ | |||
76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
va_list ap;
char *z;
va_start(ap, zFormat);
z = vmprintf(zFormat, ap);
va_end(ap);
#ifdef FOSSIL_ENABLE_JSON
if( g.json.isJsonMode ){
if( !json_is_main_boostrapped() ) json_main_bootstrap();
json_err( 0, z, 1 );
}
else
#endif /* FOSSIL_ENABLE_JSON */
if( g.xferPanic && g.cgiOutput==1 ){
cgi_reset_content();
| > > > > > | 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
va_list ap;
char *z;
va_start(ap, zFormat);
z = vmprintf(zFormat, ap);
va_end(ap);
#ifdef FOSSIL_ENABLE_JSON
if( g.json.isJsonMode ){
/*
** Avoid calling into the JSON support subsystem if it
** has not yet been initialized, e.g. early SQLite log
** messages, etc.
*/
if( !json_is_main_boostrapped() ) json_main_bootstrap();
json_err( 0, z, 1 );
}
else
#endif /* FOSSIL_ENABLE_JSON */
if( g.xferPanic && g.cgiOutput==1 ){
cgi_reset_content();
|
| ︙ | ︙ |
Changes to src/main.c.
| ︙ | ︙ | |||
1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 |
#endif
{
@ <h1>Server Configuration Error</h1>
@ <p>The database schema on the server is out-of-date. Please ask
@ the administrator to run <b>fossil rebuild</b>.</p>
}
}else{
if( (pCmd->eCmdFlags & CMDFLAG_RAWCONTENT)==0 ){
cgi_decode_post_parameters();
}
if( g.fCgiTrace ){
fossil_trace("######## Calling %s #########\n", pCmd->zName);
cgi_print_all(1, 1);
}
| > > > > > | 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 |
#endif
{
@ <h1>Server Configuration Error</h1>
@ <p>The database schema on the server is out-of-date. Please ask
@ the administrator to run <b>fossil rebuild</b>.</p>
}
}else{
#ifdef FOSSIL_ENABLE_JSON
if( g.json.isJsonMode ){
json_mode_bootstrap();
}
#endif
if( (pCmd->eCmdFlags & CMDFLAG_RAWCONTENT)==0 ){
cgi_decode_post_parameters();
}
if( g.fCgiTrace ){
fossil_trace("######## Calling %s #########\n", pCmd->zName);
cgi_print_all(1, 1);
}
|
| ︙ | ︙ |
Changes to src/printf.c.
| ︙ | ︙ | |||
1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 |
/*
** Write error message output
*/
static int fossil_print_error(int rc, const char *z){
#ifdef FOSSIL_ENABLE_JSON
if( g.json.isJsonMode ){
if( !json_is_main_boostrapped() ) json_main_bootstrap();
json_err( 0, z, 1 );
if( g.isHTTP && !g.json.preserveRc ){
rc = 0 /* avoid HTTP 500 */;
}
}
else
| > > > > > | 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 |
/*
** Write error message output
*/
static int fossil_print_error(int rc, const char *z){
#ifdef FOSSIL_ENABLE_JSON
if( g.json.isJsonMode ){
/*
** Avoid calling into the JSON support subsystem if it
** has not yet been initialized, e.g. early SQLite log
** messages, etc.
*/
if( !json_is_main_boostrapped() ) json_main_bootstrap();
json_err( 0, z, 1 );
if( g.isHTTP && !g.json.preserveRc ){
rc = 0 /* avoid HTTP 500 */;
}
}
else
|
| ︙ | ︙ | |||
1189 1190 1191 1192 1193 1194 1195 |
char *z;
va_list ap;
va_start(ap, zFormat);
z = vmprintf(zFormat, ap);
va_end(ap);
fossil_errorlog("warning: %s", z);
#ifdef FOSSIL_ENABLE_JSON
| > | | | | | < | 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 |
char *z;
va_list ap;
va_start(ap, zFormat);
z = vmprintf(zFormat, ap);
va_end(ap);
fossil_errorlog("warning: %s", z);
#ifdef FOSSIL_ENABLE_JSON
if(g.json.isJsonMode){
/*
** Avoid calling into the JSON support subsystem if it
** has not yet been initialized, e.g. early SQLite log
** messages, etc.
*/
if( !json_is_main_boostrapped() ) json_main_bootstrap();
json_warn( FSL_JSON_W_UNKNOWN, "%s", z );
}else
#endif
{
if( g.cgiOutput==1 ){
cgi_printf("<p class=\"generalError\">\n%h\n</p>\n", z);
|
| ︙ | ︙ |
Changes to src/th_main.c.
| ︙ | ︙ | |||
126 127 128 129 130 131 132 133 134 135 136 137 138 139 |
/*
** Checks if the TH1 trace log needs to be enabled. If so, prepares
** it for use.
*/
void Th_InitTraceLog(){
g.thTrace = find_option("th-trace", 0, 0)!=0;
if( g.thTrace ){
blob_zero(&g.thLog);
}
}
/*
** Prints the entire contents of the TH1 trace log to the standard
** output channel.
| > | 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 |
/*
** Checks if the TH1 trace log needs to be enabled. If so, prepares
** it for use.
*/
void Th_InitTraceLog(){
g.thTrace = find_option("th-trace", 0, 0)!=0;
if( g.thTrace ){
g.fAnyTrace = 1;
blob_zero(&g.thLog);
}
}
/*
** Prints the entire contents of the TH1 trace log to the standard
** output channel.
|
| ︙ | ︙ |