summaryrefslogtreecommitdiff
path: root/src/c/urweb.c
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-09-09 08:00:45 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-09-09 08:00:45 -0400
commit8a79a264fe8f5f349b7ad546ec8024bc0e7585a0 (patch)
treefc23a2be12e6d03e8be7f8754278784feaf45839 /src/c/urweb.c
parentd6d496a5720290dd26c7c738199667c6c1a67e6a (diff)
Don't replace <sc> in blob returns; optimize more 'option' pattern matches; detect more opportunities for 'let' inlining
Diffstat (limited to 'src/c/urweb.c')
-rw-r--r--src/c/urweb.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/c/urweb.c b/src/c/urweb.c
index 8566609b..651cef17 100644
--- a/src/c/urweb.c
+++ b/src/c/urweb.c
@@ -346,6 +346,7 @@ struct uw_context {
void *get_header_data;
buf outHeaders, page, heap, script;
+ int returning_blob;
input *inputs, *subinputs, *cur_container;
size_t n_subinputs, used_subinputs;
@@ -386,6 +387,7 @@ uw_context uw_init() {
buf_init(&ctx->outHeaders, 0);
buf_init(&ctx->page, 0);
+ ctx->returning_blob = 0;
buf_init(&ctx->heap, 0);
buf_init(&ctx->script, 1);
ctx->script.start[0] = 0;
@@ -458,6 +460,7 @@ void uw_reset_keep_error_message(uw_context ctx) {
buf_reset(&ctx->script);
ctx->script.start[0] = 0;
buf_reset(&ctx->page);
+ ctx->returning_blob = 0;
buf_reset(&ctx->heap);
ctx->regions = NULL;
ctx->cleanup_front = ctx->cleanup;
@@ -2549,7 +2552,7 @@ void uw_commit(uw_context ctx) {
ctx->transactionals[i].free(ctx->transactionals[i].data);
// Splice script data into appropriate part of page
- if (ctx->script_header[0] == 0)
+ if (ctx->returning_blob || ctx->script_header[0] == 0)
;
else if (buf_used(&ctx->script) == 0) {
size_t len = strlen(ctx->script_header);
@@ -2776,6 +2779,7 @@ __attribute__((noreturn)) void uw_return_blob(uw_context ctx, uw_Basis_blob b, u
cleanup *cl;
int len;
+ ctx->returning_blob = 1;
buf_reset(&ctx->outHeaders);
buf_reset(&ctx->page);