diff options
Diffstat (limited to 'src/c')
-rw-r--r-- | src/c/urweb.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/c/urweb.c b/src/c/urweb.c index e337424a..57762da8 100644 --- a/src/c/urweb.c +++ b/src/c/urweb.c @@ -476,6 +476,9 @@ struct uw_context { char *output_buffer; size_t output_buffer_size; + + // For caching. + char *recording; }; size_t uw_headers_max = SIZE_MAX; @@ -558,6 +561,8 @@ uw_context uw_init(int id, uw_loggers *lg) { ctx->output_buffer = malloc(1); ctx->output_buffer_size = 1; + ctx->recording = 0; + return ctx; } @@ -1661,6 +1666,14 @@ void uw_write(uw_context ctx, const char* s) { *ctx->page.front = 0; } +void uw_recordingStart(uw_context ctx) { + ctx->recording = ctx->page.front; +} + +char *uw_recordingRead(uw_context ctx) { + return strdup(ctx->recording); +} + char *uw_Basis_attrifyInt(uw_context ctx, uw_Basis_int n) { char *result; int len; |