aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Ai Hoshino <ambiguous404@gmail.com> 2023-08-25 08:16:51 +0800
committerGravatar GitHub <noreply@github.com> 2023-08-24 17:16:51 -0700
commit339d2c7f190c81bbf2c64f3fd5715b3ebe8841ab (patch)
treea29fd63e0d0411ac5cf0f2822b28e5307b327a31 /src
parentd2bef4fbeae798cde08745b211d150417428b270 (diff)
downloadbun-339d2c7f190c81bbf2c64f3fd5715b3ebe8841ab.tar.gz
bun-339d2c7f190c81bbf2c64f3fd5715b3ebe8841ab.tar.zst
bun-339d2c7f190c81bbf2c64f3fd5715b3ebe8841ab.zip
Make the server not crash if an error occurs in dev build. (#4300)
Close: #4298
Diffstat (limited to 'src')
-rw-r--r--src/bun.js/api/server.zig10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/bun.js/api/server.zig b/src/bun.js/api/server.zig
index 64a85d6a4..ca803cef2 100644
--- a/src/bun.js/api/server.zig
+++ b/src/bun.js/api/server.zig
@@ -1023,7 +1023,7 @@ fn NewFlags(comptime debug_mode: bool) type {
has_written_status: bool = false,
response_protected: bool = false,
aborted: bool = false,
- finalized: bun.DebugOnly(bool) = bun.DebugOnlyDefault(false),
+ has_finalized: bun.DebugOnly(bool) = bun.DebugOnlyDefault(false),
};
}
@@ -1515,9 +1515,9 @@ fn NewRequestContext(comptime ssl_enabled: bool, comptime debug_mode: bool, comp
ctxLog("finalizeWithoutDeinit<d> ({*})<r>", .{this});
this.blob.detach();
- if (comptime Environment.allow_assert) {
- std.debug.assert(!this.flags.finalized);
- this.flags.finalized = true;
+ if (comptime Environment.isDebug) {
+ ctxLog("finalizeWithoutDeinit: has_finalized {any}", .{this.flags.has_finalized});
+ this.flags.has_finalized = true;
}
if (!this.response_jsvalue.isEmpty()) {
@@ -1596,7 +1596,7 @@ fn NewRequestContext(comptime ssl_enabled: bool, comptime debug_mode: bool, comp
ctxLog("deinit<d> ({*})<r>", .{this});
if (comptime Environment.allow_assert)
- std.debug.assert(this.flags.finalized);
+ std.debug.assert(this.flags.has_finalized);
if (comptime Environment.allow_assert)
std.debug.assert(this.flags.has_marked_complete);