Fossil SCM
Previous two check-ins do not work correctly for CGI. Trying once again.
Commit
d8f716e1d1d422a72e015dfed7ce70fd16bd6a01
Parent
8c4158e40c17629…
3 files changed
-1
+1
+1
-1
-1
| --- src/cgi.c | ||
| +++ src/cgi.c | ||
| @@ -1185,11 +1185,10 @@ | ||
| 1185 | 1185 | char zLine[2000]; /* A single line of input. */ |
| 1186 | 1186 | g.fullHttpReply = 1; |
| 1187 | 1187 | if( fgets(zLine, sizeof(zLine),g.httpIn)==0 ){ |
| 1188 | 1188 | malformed_request(); |
| 1189 | 1189 | } |
| 1190 | - g.httpHeader = empty_blob; | |
| 1191 | 1190 | blob_append(&g.httpHeader, zLine, -1); |
| 1192 | 1191 | cgi_trace(zLine); |
| 1193 | 1192 | zToken = extract_token(zLine, &z); |
| 1194 | 1193 | if( zToken==0 ){ |
| 1195 | 1194 | malformed_request(); |
| 1196 | 1195 |
| --- 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 @@ | ||
| 530 | 530 | int idx; |
| 531 | 531 | int rc; |
| 532 | 532 | sqlite3_config(SQLITE_CONFIG_LOG, fossil_sqlite_log, 0); |
| 533 | 533 | memset(&g, 0, sizeof(g)); |
| 534 | 534 | g.now = time(0); |
| 535 | + g.httpHeader = empty_blob; | |
| 535 | 536 | #ifdef FOSSIL_ENABLE_JSON |
| 536 | 537 | #if defined(NDEBUG) |
| 537 | 538 | g.json.errorDetailParanoia = 2 /* FIXME: make configurable |
| 538 | 539 | One problem we have here is that this |
| 539 | 540 | code is needed before the db is opened, |
| 540 | 541 |
| --- 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 @@ | ||
| 1180 | 1180 | @ g.zLogin = %h(g.zLogin)<br /> |
| 1181 | 1181 | @ capabilities = %s(zCap)<br /> |
| 1182 | 1182 | @ <hr> |
| 1183 | 1183 | P("HTTP_USER_AGENT"); |
| 1184 | 1184 | cgi_print_all(showAll); |
| 1185 | - if( showAll ){ | |
| 1185 | + if( showAll && blob_size(&g.httpHeader)>0 ){ | |
| 1186 | 1186 | @ <hr> |
| 1187 | 1187 | @ <pre> |
| 1188 | 1188 | @ %h(blob_str(&g.httpHeader)) |
| 1189 | 1189 | @ </pre> |
| 1190 | 1190 | } |
| 1191 | 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 ){ |
| 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 |