diff options
author | Ziv Scully <ziv@mit.edu> | 2014-05-27 21:14:13 -0400 |
---|---|---|
committer | Ziv Scully <ziv@mit.edu> | 2014-05-27 21:14:13 -0400 |
commit | b1516ed386ca303a526959586f0a06564ca77bb0 (patch) | |
tree | d37d80752e5a132615064d4b1e991dcb8ef35793 /src/c/urweb.c | |
parent | 93d6de491838eb3607a12686bfdc250366aa60e4 (diff) |
Finishes initial prototype, caching parameterless pages with table-match-based invalidation. Still has problems parsing non-Postgres SQL dialects properly.
Diffstat (limited to 'src/c/urweb.c')
-rw-r--r-- | src/c/urweb.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/c/urweb.c b/src/c/urweb.c index ffcc0146..d4c0b439 100644 --- a/src/c/urweb.c +++ b/src/c/urweb.c @@ -477,6 +477,9 @@ struct uw_context { char *output_buffer; size_t output_buffer_size; + + // For caching. + char *recording; }; size_t uw_headers_max = SIZE_MAX; @@ -560,6 +563,8 @@ uw_context uw_init(int id, void *logger_data, uw_logger log_debug) { ctx->output_buffer = malloc(1); ctx->output_buffer_size = 1; + ctx->recording = 0; + return ctx; } @@ -1636,6 +1641,19 @@ void uw_write(uw_context ctx, const char* s) { *ctx->page.front = 0; } +void uw_recordingStart(uw_context ctx) { + // TODO: remove following debug statement. + uw_write(ctx, "<!--Recording started here-->"); + ctx->recording = ctx->page.front; +} + +char *uw_recordingRead(uw_context ctx) { + char *recording = strdup(ctx->recording); + // TODO: remove following debug statement. + uw_write(ctx, "<!--Recording read here-->"); + return recording; +} + char *uw_Basis_attrifyInt(uw_context ctx, uw_Basis_int n) { char *result; int len; |