comparison src/c/urweb.c @ 1763:22858505bb2d

Allow RPC and run it synchronously in onunload event.
author Vladimir Shabanov <vshabanoff@gmail.com>
date Wed, 16 May 2012 22:46:35 +0400
parents e9587120831a
children 61c7eb1d3867
comparison
equal deleted inserted replaced
1762:a6eab6820b37 1763:22858505bb2d
1334 1334
1335 uw_Basis_string uw_Basis_maybe_onunload(uw_context ctx, uw_Basis_string s) { 1335 uw_Basis_string uw_Basis_maybe_onunload(uw_context ctx, uw_Basis_string s) {
1336 if (ctx->script_header[0] == 0) 1336 if (ctx->script_header[0] == 0)
1337 return ""; 1337 return "";
1338 else { 1338 else {
1339 char *r = uw_malloc(ctx, 22 + strlen(s)); 1339 char *r = uw_malloc(ctx, 37 + strlen(s));
1340 sprintf(r, " onunload='unload();%s'", s); 1340 sprintf(r, " onunload='unloading=true;%s;unload()'", s);
1341 return r; 1341 return r;
1342 } 1342 }
1343 } 1343 }
1344 1344
1345 const char *uw_Basis_get_settings(uw_context ctx, uw_unit u) { 1345 const char *uw_Basis_get_settings(uw_context ctx, uw_unit u) {