diff options
author | 2009-11-24 09:24:25 -0500 | |
---|---|---|
committer | 2009-11-24 09:24:25 -0500 | |
commit | b6dbf123f6d621f9befeb5a5c23b03469f94c914 (patch) | |
tree | c7e296a3f9f17fcb036db1231ba57d295924ddb0 /src/c/urweb.c | |
parent | d82b1ce3c53cbd5d10f4e0af1f6577e180ecfb4d (diff) |
Explicitly abort in-flight RPCs onunload
Diffstat (limited to 'src/c/urweb.c')
-rw-r--r-- | src/c/urweb.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/c/urweb.c b/src/c/urweb.c index e75d0c66..344ef2ad 100644 --- a/src/c/urweb.c +++ b/src/c/urweb.c @@ -1173,6 +1173,16 @@ uw_Basis_string uw_Basis_maybe_onload(uw_context ctx, uw_Basis_string s) { } } +uw_Basis_string uw_Basis_maybe_onunload(uw_context ctx, uw_Basis_string s) { + if (ctx->script_header[0] == 0) + return ""; + else { + char *r = uw_malloc(ctx, 22 + strlen(s)); + sprintf(r, " onunload='unload();%s'", s); + return r; + } +} + extern uw_Basis_string uw_cookie_sig(uw_context); const char *uw_Basis_get_settings(uw_context ctx, uw_unit u) { |