diff options
author | Adam Chlipala <adamc@hcoop.net> | 2009-11-24 09:24:25 -0500 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2009-11-24 09:24:25 -0500 |
commit | 7463b805e4510b4f187851e91c53bb28db3ba044 (patch) | |
tree | c7e296a3f9f17fcb036db1231ba57d295924ddb0 /src/c | |
parent | cf3fc72603a3ad499f2c3177beee709b3a5c53f8 (diff) |
Explicitly abort in-flight RPCs onunload
Diffstat (limited to 'src/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) { |