changeset 681:6c9b8875f347

Switch back to starting listener on load
author Adam Chlipala <adamc@hcoop.net>
date Sat, 28 Mar 2009 11:15:42 -0400
parents 54ec237a3028
children 5bbb542243e8
files lib/js/urweb.js src/c/urweb.c
diffstat 2 files changed, 2 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/lib/js/urweb.js	Sat Mar 28 11:13:36 2009 -0400
+++ b/lib/js/urweb.js	Sat Mar 28 11:15:42 2009 -0400
@@ -300,17 +300,10 @@
   connect();
 }
 
-var listener_started = false;
-
 function rv(chn, parse, k) {
   if (chn < 0)
     whine("Out-of-bounds channel receive");
 
-  if (!listener_started) {
-    listener_started = true;
-    listener();
-  }
-
   var ch;
 
   if (chn >= channels.length || channels[chn] == null) {
--- a/src/c/urweb.c	Sat Mar 28 11:13:36 2009 -0400
+++ b/src/c/urweb.c	Sat Mar 28 11:15:42 2009 -0400
@@ -861,8 +861,8 @@
     int pass;
     client *c = uw_new_client(&pass);
 
-    char *r = uw_malloc(ctx, 41 + 3 * INTS_MAX + strlen(ctx->url_prefix) + strlen(onload));
-    sprintf(r, " onload='client_id=%d;client_pass=%d;url_prefix=\"%s\";timeout=%d;%s'",
+    char *r = uw_malloc(ctx, 52 + 3 * INTS_MAX + strlen(ctx->url_prefix) + strlen(onload));
+    sprintf(r, " onload='client_id=%d;client_pass=%d;url_prefix=\"%s\";timeout=%d;listener();%s'",
             (int)c->id,
             c->data.used.pass,
             ctx->url_prefix,