From dfe722a61e5c81cdfa6ed844933a14783cd9bd9c Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Sat, 4 Apr 2009 14:03:39 -0400 Subject: _Really_ implement embedded closure GC; extend Scriptcheck to figure out when client IDs must be assigned --- src/c/urweb.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/c') diff --git a/src/c/urweb.c b/src/c/urweb.c index ed19305e..880cd143 100644 --- a/src/c/urweb.c +++ b/src/c/urweb.c @@ -300,6 +300,8 @@ struct uw_context { const char *script_header, *url_prefix; + int needs_push; + size_t n_deltas, used_deltas; delta *deltas; @@ -333,6 +335,7 @@ uw_context uw_init() { ctx->script_header = ""; ctx->url_prefix = "/"; + ctx->needs_push = 0; ctx->error_message[0] = 0; @@ -476,7 +479,7 @@ uw_Basis_string uw_Basis_requestHeader(uw_context ctx, uw_Basis_string h) { } void uw_login(uw_context ctx) { - if (ctx->script_header[0]) { + if (ctx->needs_push) { char *id_s, *pass_s; if ((id_s = uw_Basis_requestHeader(ctx, "UrWeb-Client")) @@ -578,6 +581,10 @@ void uw_set_url_prefix(uw_context ctx, const char *s) { ctx->url_prefix = s; } +void uw_set_needs_push(uw_context ctx, int n) { + ctx->needs_push = n; +} + static void buf_check_ctx(uw_context ctx, buf *b, size_t extra, const char *desc) { if (b->back - b->front < extra) { -- cgit v1.2.3