Fossil SCM

Previous two check-ins do not work correctly for CGI. Trying once again.

drh 2013-08-03 23:33 UTC trunk
Commit d8f716e1d1d422a72e015dfed7ce70fd16bd6a01
-1
--- src/cgi.c
+++ src/cgi.c
@@ -1185,11 +1185,10 @@
11851185
char zLine[2000]; /* A single line of input. */
11861186
g.fullHttpReply = 1;
11871187
if( fgets(zLine, sizeof(zLine),g.httpIn)==0 ){
11881188
malformed_request();
11891189
}
1190
- g.httpHeader = empty_blob;
11911190
blob_append(&g.httpHeader, zLine, -1);
11921191
cgi_trace(zLine);
11931192
zToken = extract_token(zLine, &z);
11941193
if( zToken==0 ){
11951194
malformed_request();
11961195
--- src/cgi.c
+++ src/cgi.c
@@ -1185,11 +1185,10 @@
1185 char zLine[2000]; /* A single line of input. */
1186 g.fullHttpReply = 1;
1187 if( fgets(zLine, sizeof(zLine),g.httpIn)==0 ){
1188 malformed_request();
1189 }
1190 g.httpHeader = empty_blob;
1191 blob_append(&g.httpHeader, zLine, -1);
1192 cgi_trace(zLine);
1193 zToken = extract_token(zLine, &z);
1194 if( zToken==0 ){
1195 malformed_request();
1196
--- src/cgi.c
+++ src/cgi.c
@@ -1185,11 +1185,10 @@
1185 char zLine[2000]; /* A single line of input. */
1186 g.fullHttpReply = 1;
1187 if( fgets(zLine, sizeof(zLine),g.httpIn)==0 ){
1188 malformed_request();
1189 }
 
1190 blob_append(&g.httpHeader, zLine, -1);
1191 cgi_trace(zLine);
1192 zToken = extract_token(zLine, &z);
1193 if( zToken==0 ){
1194 malformed_request();
1195
+1
--- src/main.c
+++ src/main.c
@@ -530,10 +530,11 @@
530530
int idx;
531531
int rc;
532532
sqlite3_config(SQLITE_CONFIG_LOG, fossil_sqlite_log, 0);
533533
memset(&g, 0, sizeof(g));
534534
g.now = time(0);
535
+ g.httpHeader = empty_blob;
535536
#ifdef FOSSIL_ENABLE_JSON
536537
#if defined(NDEBUG)
537538
g.json.errorDetailParanoia = 2 /* FIXME: make configurable
538539
One problem we have here is that this
539540
code is needed before the db is opened,
540541
--- src/main.c
+++ src/main.c
@@ -530,10 +530,11 @@
530 int idx;
531 int rc;
532 sqlite3_config(SQLITE_CONFIG_LOG, fossil_sqlite_log, 0);
533 memset(&g, 0, sizeof(g));
534 g.now = time(0);
 
535 #ifdef FOSSIL_ENABLE_JSON
536 #if defined(NDEBUG)
537 g.json.errorDetailParanoia = 2 /* FIXME: make configurable
538 One problem we have here is that this
539 code is needed before the db is opened,
540
--- src/main.c
+++ src/main.c
@@ -530,10 +530,11 @@
530 int idx;
531 int rc;
532 sqlite3_config(SQLITE_CONFIG_LOG, fossil_sqlite_log, 0);
533 memset(&g, 0, sizeof(g));
534 g.now = time(0);
535 g.httpHeader = empty_blob;
536 #ifdef FOSSIL_ENABLE_JSON
537 #if defined(NDEBUG)
538 g.json.errorDetailParanoia = 2 /* FIXME: make configurable
539 One problem we have here is that this
540 code is needed before the db is opened,
541
+1 -1
--- src/style.c
+++ src/style.c
@@ -1180,11 +1180,11 @@
11801180
@ g.zLogin = %h(g.zLogin)<br />
11811181
@ capabilities = %s(zCap)<br />
11821182
@ <hr>
11831183
P("HTTP_USER_AGENT");
11841184
cgi_print_all(showAll);
1185
- if( showAll ){
1185
+ if( showAll && blob_size(&g.httpHeader)>0 ){
11861186
@ <hr>
11871187
@ <pre>
11881188
@ %h(blob_str(&g.httpHeader))
11891189
@ </pre>
11901190
}
11911191
--- src/style.c
+++ src/style.c
@@ -1180,11 +1180,11 @@
1180 @ g.zLogin = %h(g.zLogin)<br />
1181 @ capabilities = %s(zCap)<br />
1182 @ <hr>
1183 P("HTTP_USER_AGENT");
1184 cgi_print_all(showAll);
1185 if( showAll ){
1186 @ <hr>
1187 @ <pre>
1188 @ %h(blob_str(&g.httpHeader))
1189 @ </pre>
1190 }
1191
--- src/style.c
+++ src/style.c
@@ -1180,11 +1180,11 @@
1180 @ g.zLogin = %h(g.zLogin)<br />
1181 @ capabilities = %s(zCap)<br />
1182 @ <hr>
1183 P("HTTP_USER_AGENT");
1184 cgi_print_all(showAll);
1185 if( showAll && blob_size(&g.httpHeader)>0 ){
1186 @ <hr>
1187 @ <pre>
1188 @ %h(blob_str(&g.httpHeader))
1189 @ </pre>
1190 }
1191

Keyboard Shortcuts

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