src: inform callback scopes about exceptions in HTTP parser

Refs: https://github.com/nodejs/node/commit/4aca277f16b8649b5fc21d41f340fad0a47c2e61
Refs: https://github.com/nodejs/node/pull/30236
Fixes: https://github.com/nodejs/node/issues/31796

PR-URL: https://github.com/nodejs/node/pull/31801
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
This commit is contained in:
Anna Henningsen committed 2020-02-18 02:50:02 +01:00
1 parent eb0ade10a7
commit fab3eff2e5
2 files changed
+31

No files matched your search

+2
View File
@@ -330,6 +330,7 @@ class Parser : public AsyncWrap, public StreamListener {
this, InternalCallbackScope::kSkipTaskQueues);
head_response = cb.As<Function>()->Call(
env()->context(), object(), arraysize(argv), argv);
if (head_response.IsEmpty()) callback_scope.MarkAsFailed();
}
int64_t val;
@@ -401,6 +402,7 @@ class Parser : public AsyncWrap, public StreamListener {
InternalCallbackScope callback_scope(
this, InternalCallbackScope::kSkipTaskQueues);
r = cb.As<Function>()->Call(env()->context(), object(), 0, nullptr);
if (r.IsEmpty()) callback_scope.MarkAsFailed();
}
if (r.IsEmpty()) {