ucode: ignore exit exceptions
authorJo-Philipp Wich <jo@mein.io>
Tue, 2 Aug 2022 11:40:28 +0000 (13:40 +0200)
committerStijn Tintel <stijn@linux-ipv6.be>
Tue, 2 Aug 2022 12:38:35 +0000 (15:38 +0300)
A request handler might legitimately call `exit()`, don't raise a server
error in this case.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Tested-by: Stijn Tintel <stijn@linux-ipv6.be>
ucode.c

diff --git a/ucode.c b/ucode.c
index 69da3da67a7e48378bc95addc935d17a413e97b3..e76f441ea622778504bc098a353fc76e08343ab2 100644 (file)
--- a/ucode.c
+++ b/ucode.c
@@ -195,6 +195,9 @@ uh_ucode_exception(uc_vm_t *vm, uc_exception_t *ex)
 {
        uc_value_t *ctx;
 
+       if (ex->type == EXCEPTION_EXIT)
+               return;
+
        printf("Status: 500 Internal Server Error\r\n\r\n"
        "Exception while executing ucode program %s:\n",
        current_prefix->handler);