diff src/c/urweb.c @ 693:655bcc9b77e0

_Really_ implement embedded closure GC; extend Scriptcheck to figure out when client IDs must be assigned
author Adam Chlipala <adamc@hcoop.net>
date Sat, 04 Apr 2009 14:03:39 -0400
parents b6a8425e1b1f
children 7ea0df9e56b6
line wrap: on
line diff
--- a/src/c/urweb.c	Sat Apr 04 12:54:39 2009 -0400
+++ b/src/c/urweb.c	Sat Apr 04 14:03:39 2009 -0400
@@ -300,6 +300,8 @@
 
   const char *script_header, *url_prefix;
 
+  int needs_push;
+
   size_t n_deltas, used_deltas;
   delta *deltas;
 
@@ -333,6 +335,7 @@
 
   ctx->script_header = "";
   ctx->url_prefix = "/";
+  ctx->needs_push = 0;
   
   ctx->error_message[0] = 0;
 
@@ -476,7 +479,7 @@
 }
 
 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 @@
   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) {