diff options
author | 2023-08-23 14:05:05 -0700 | |
---|---|---|
committer | 2023-08-23 14:05:05 -0700 | |
commit | c60385716b7a7ac9f788cdf7dfe37250321e0670 (patch) | |
tree | b08cc97e7e9d456efac7ec83d4862c8a8e3043bf /src/bun.js/bindings/AsyncContextFrame.cpp | |
parent | f3266ff436e0ed2aedd0d81f47a1ef104191a2c9 (diff) | |
download | bun-c60385716b7a7ac9f788cdf7dfe37250321e0670.tar.gz bun-c60385716b7a7ac9f788cdf7dfe37250321e0670.tar.zst bun-c60385716b7a7ac9f788cdf7dfe37250321e0670.zip |
Bunch of streams fixes (#4251)
* Update WebKit
* Don't do async hooks things when async hooks are not enabled
* Smarter scheduling of event loop tasks with the http server
* less exciting approach
* Bump WebKit
* Another approach
* Fix body-stream tests
* Fixes #1886
* Fix UAF in fetch body streaming
* Missing from commit
* Fix leak
* Fix the other leak
* Fix test
* Fix crash
* missing duperef
* Make this code clearer
* Ignore empty chunks
* Fixes #3969
* Delete flaky test
* Update bun-linux-build.yml
* Fix memory issue
* fix result body, and .done status before the last callback, dont touch headers after sent once
* refactor HTTPClientResult
* less flasky corrupted test
* oops
* fix mutex invalid state
* fix onProgressUpdate deinit/unlock
* fix onProgressUpdate deinit/unlock
* oops
* remove verbose
* fix posible null use
* avoid http null
* metadata can still be used onReject after toResponse
* dont leak task.http
* fix flask tests
* less flask close tests
---------
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: cirospaciari <ciro.spaciari@gmail.com>
Diffstat (limited to 'src/bun.js/bindings/AsyncContextFrame.cpp')
-rw-r--r-- | src/bun.js/bindings/AsyncContextFrame.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/bun.js/bindings/AsyncContextFrame.cpp b/src/bun.js/bindings/AsyncContextFrame.cpp index 2a103a8d1..1c541b2a8 100644 --- a/src/bun.js/bindings/AsyncContextFrame.cpp +++ b/src/bun.js/bindings/AsyncContextFrame.cpp @@ -97,10 +97,18 @@ extern "C" EncodedJSValue AsyncContextFrame__withAsyncContextIfNeeded(JSGlobalOb // } JSValue AsyncContextFrame::call(JSGlobalObject* global, JSValue functionObject, JSValue thisValue, const ArgList& args) { + if (LIKELY(!global->isAsyncContextTrackingEnabled())) { + return JSC::profiledCall(global, ProfilingReason::API, functionObject, JSC::getCallData(functionObject), thisValue, args); + } + ASYNCCONTEXTFRAME_CALL_IMPL(global, ProfilingReason::API, functionObject, JSC::getCallData(functionObject), thisValue, args); } JSValue AsyncContextFrame::call(JSGlobalObject* global, JSValue functionObject, JSValue thisValue, const ArgList& args, NakedPtr<Exception>& returnedException) { + if (LIKELY(!global->isAsyncContextTrackingEnabled())) { + return JSC::profiledCall(global, ProfilingReason::API, functionObject, JSC::getCallData(functionObject), thisValue, args, returnedException); + } + ASYNCCONTEXTFRAME_CALL_IMPL(global, ProfilingReason::API, functionObject, JSC::getCallData(functionObject), thisValue, args, returnedException); } |