Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2020-02-15 00:25:57 +0300
committerShelley Vohr <shelley.vohr@gmail.com>2020-02-27 20:28:07 +0300
commit98d262e5f3d04b9e737e13e1e19ba3127ecce285 (patch)
tree0c6a7225f3b1948b4721eb2e4e5363bcee23f575 /src/node_http_parser.cc
parent672f76d6bd5a416d2d798f0b79021a327990377d (diff)
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>
Diffstat (limited to 'src/node_http_parser.cc')
-rw-r--r--src/node_http_parser.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/node_http_parser.cc b/src/node_http_parser.cc
index a8c48999c57..40ece82b625 100644
--- a/src/node_http_parser.cc
+++ b/src/node_http_parser.cc
@@ -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()) {