aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrobot-piglet <robot-piglet@yandex-team.com>2023-09-01 13:01:10 +0300
committerrobot-piglet <robot-piglet@yandex-team.com>2023-09-01 13:12:47 +0300
commitd9f4e5381822b17ac7448b1f4386e1f74e118883 (patch)
tree3fdb6665ed998737bae5ac1ace9f0321ab728bcb
parent41fb59788d7929ed2ef5a9382669414db05ed34c (diff)
downloadydb-d9f4e5381822b17ac7448b1f4386e1f74e118883.tar.gz
Intermediate changes
-rw-r--r--library/cpp/http/push_parser/http_parser.cpp4
-rw-r--r--library/cpp/http/push_parser/http_parser.h5
2 files changed, 9 insertions, 0 deletions
diff --git a/library/cpp/http/push_parser/http_parser.cpp b/library/cpp/http/push_parser/http_parser.cpp
index 2302dcb1ab..5852a02d5b 100644
--- a/library/cpp/http/push_parser/http_parser.cpp
+++ b/library/cpp/http/push_parser/http_parser.cpp
@@ -262,6 +262,10 @@ void THttpParser::OnEof() {
}
bool THttpParser::DecodeContent() {
+ if (!DecodeContent_) {
+ return false;
+ }
+
if (!ContentEncoding_ || ContentEncoding_ == "identity" || ContentEncoding_ == "none") {
DecodedContent_ = Content_;
return false;
diff --git a/library/cpp/http/push_parser/http_parser.h b/library/cpp/http/push_parser/http_parser.h
index 8757a3ef9a..c888235c33 100644
--- a/library/cpp/http/push_parser/http_parser.h
+++ b/library/cpp/http/push_parser/http_parser.h
@@ -36,6 +36,10 @@ public:
GzipAllowMultipleStreams_ = allow;
}
+ inline void DisableDecodeContent() noexcept {
+ DecodeContent_ = false;
+ }
+
/// @return true on end parsing (GetExtraDataSize() return amount not used bytes)
/// throw exception on bad http format (unsupported encoding, etc)
/// sz == 0 signaling end of input stream
@@ -132,6 +136,7 @@ private:
TMessageType MessageType_ = Response;
bool CollectHeaders_ = true;
bool GzipAllowMultipleStreams_ = true;
+ bool DecodeContent_ = true;
// parsed data
const char* Data_ = nullptr;