Skip to content

Commit

Permalink
http1: remove exceptions from H/1 codec (#11778)
Browse files Browse the repository at this point in the history
Commit Message:
Remove all throw statements from H/1 codec
This change removed all uses of C++ exceptions from H/1 codec. I modeled the flow after Yan's H/2 work (#11575). Codec status are set in uniform helper methods. This is the only change from the previous PR (#11101), besides merging newer exceptions.

This change replaces all throw statements with a return of corresponding error Status and adds plumbing to return the status to codec callers. The dispatch() method returns the encountered error to the caller, which will be handled accordingly.

The calls to the RequestEncoder::encodeHeaders() NOT called from dispatch() method will RELEASE_ASSERT if an error code is returned. This does not alter the existing behavior of abnormally terminating the process, just the method of termination: RELEASE_ASSERT vs uncaught exception.

Risk Level: High (Codec changes)
Signed-off-by: Asra Ali <asraa@google.com>
  • Loading branch information
asraa committed Aug 10, 2020
1 parent bb3571a commit 2187f10
Show file tree
Hide file tree
Showing 5 changed files with 250 additions and 134 deletions.
2 changes: 1 addition & 1 deletion source/common/http/http1/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ envoy_cc_library(
srcs = ["codec_impl.cc"],
hdrs = ["codec_impl.h"],
external_deps = ["http_parser"],
deps = CODEC_LIB_DEPS,
deps = CODEC_LIB_DEPS + ["//source/common/common:cleanup_lib"],
)

envoy_cc_library(
Expand Down
Loading

0 comments on commit 2187f10

Please sign in to comment.