Fossil SCM
Move the JSON error cgi_reply() into fossil_print_error().
Commit
6131789870b2449cdb7269ef0680871f6bdb552b0cfd20228369ad9d829024d7
Parent
7b165677723ccfc…
2 files changed
-1
+4
-1
| --- src/json.c | ||
| +++ src/json.c | ||
| @@ -1576,11 +1576,10 @@ | ||
| 1576 | 1576 | cson_output( resp, cson_data_dest_cgi, NULL, &g.json.outOpt ); |
| 1577 | 1577 | if( g.json.jsonp ){ |
| 1578 | 1578 | cgi_append_content(")",1); |
| 1579 | 1579 | } |
| 1580 | 1580 | } |
| 1581 | - cgi_reply(); | |
| 1582 | 1581 | }else{ |
| 1583 | 1582 | json_send_response(resp); |
| 1584 | 1583 | } |
| 1585 | 1584 | cson_value_free(resp); |
| 1586 | 1585 | } |
| 1587 | 1586 |
| --- src/json.c | |
| +++ src/json.c | |
| @@ -1576,11 +1576,10 @@ | |
| 1576 | cson_output( resp, cson_data_dest_cgi, NULL, &g.json.outOpt ); |
| 1577 | if( g.json.jsonp ){ |
| 1578 | cgi_append_content(")",1); |
| 1579 | } |
| 1580 | } |
| 1581 | cgi_reply(); |
| 1582 | }else{ |
| 1583 | json_send_response(resp); |
| 1584 | } |
| 1585 | cson_value_free(resp); |
| 1586 | } |
| 1587 |
| --- src/json.c | |
| +++ src/json.c | |
| @@ -1576,11 +1576,10 @@ | |
| 1576 | cson_output( resp, cson_data_dest_cgi, NULL, &g.json.outOpt ); |
| 1577 | if( g.json.jsonp ){ |
| 1578 | cgi_append_content(")",1); |
| 1579 | } |
| 1580 | } |
| 1581 | }else{ |
| 1582 | json_send_response(resp); |
| 1583 | } |
| 1584 | cson_value_free(resp); |
| 1585 | } |
| 1586 |
+4
| --- src/printf.c | ||
| +++ src/printf.c | ||
| @@ -1085,10 +1085,14 @@ | ||
| 1085 | 1085 | */ |
| 1086 | 1086 | if( !json_is_main_boostrapped() ) json_main_bootstrap(); |
| 1087 | 1087 | json_err( 0, z, 1 ); |
| 1088 | 1088 | if( g.isHTTP && !g.json.preserveRc ){ |
| 1089 | 1089 | rc = 0 /* avoid HTTP 500 */; |
| 1090 | + } | |
| 1091 | + if( g.cgiOutput==1 ){ | |
| 1092 | + g.cgiOutput = 2; | |
| 1093 | + cgi_reply(); | |
| 1090 | 1094 | } |
| 1091 | 1095 | } |
| 1092 | 1096 | else |
| 1093 | 1097 | #endif |
| 1094 | 1098 | if( g.cgiOutput==1 && g.db ){ |
| 1095 | 1099 |
| --- src/printf.c | |
| +++ src/printf.c | |
| @@ -1085,10 +1085,14 @@ | |
| 1085 | */ |
| 1086 | if( !json_is_main_boostrapped() ) json_main_bootstrap(); |
| 1087 | json_err( 0, z, 1 ); |
| 1088 | if( g.isHTTP && !g.json.preserveRc ){ |
| 1089 | rc = 0 /* avoid HTTP 500 */; |
| 1090 | } |
| 1091 | } |
| 1092 | else |
| 1093 | #endif |
| 1094 | if( g.cgiOutput==1 && g.db ){ |
| 1095 |
| --- src/printf.c | |
| +++ src/printf.c | |
| @@ -1085,10 +1085,14 @@ | |
| 1085 | */ |
| 1086 | if( !json_is_main_boostrapped() ) json_main_bootstrap(); |
| 1087 | json_err( 0, z, 1 ); |
| 1088 | if( g.isHTTP && !g.json.preserveRc ){ |
| 1089 | rc = 0 /* avoid HTTP 500 */; |
| 1090 | } |
| 1091 | if( g.cgiOutput==1 ){ |
| 1092 | g.cgiOutput = 2; |
| 1093 | cgi_reply(); |
| 1094 | } |
| 1095 | } |
| 1096 | else |
| 1097 | #endif |
| 1098 | if( g.cgiOutput==1 && g.db ){ |
| 1099 |