summaryrefslogtreecommitdiffstats
path: root/library/cpp
diff options
context:
space:
mode:
authorAlexander Smirnov <[email protected]>2024-08-23 11:56:16 +0000
committerAlexander Smirnov <[email protected]>2024-08-23 11:56:16 +0000
commit5f5100feff999707cfc58fad7105d15f60741b16 (patch)
tree06c83487d372b0557078eeb16bb963780cfb3c2d /library/cpp
parent08f2dfb5d1e981a372b00e670f13ae6e5a3dbbef (diff)
parent5741cf990d59e786aee8074fc01db7655490bcfd (diff)
Merge branch 'rightlib' into mergelibs-240823-1155
Diffstat (limited to 'library/cpp')
-rw-r--r--library/cpp/http/push_parser/http_parser.cpp20
-rw-r--r--library/cpp/http/push_parser/http_parser.h7
-rw-r--r--library/cpp/tld/tlds-alpha-by-domain.txt2
3 files changed, 14 insertions, 15 deletions
diff --git a/library/cpp/http/push_parser/http_parser.cpp b/library/cpp/http/push_parser/http_parser.cpp
index b69818c15c3..a646b349a39 100644
--- a/library/cpp/http/push_parser/http_parser.cpp
+++ b/library/cpp/http/push_parser/http_parser.cpp
@@ -261,13 +261,9 @@ void THttpParser::OnEof() {
throw THttpException() << TStringBuf("incompleted http response");
}
-bool THttpParser::DecodeContent() {
- if (!DecodeContent_) {
- return false;
- }
-
+bool THttpParser::DecodeContent(TString& decodedContent) const {
if (!ContentEncoding_ || ContentEncoding_ == "identity" || ContentEncoding_ == "none") {
- DecodedContent_ = Content_;
+ decodedContent = Content_;
return false;
}
@@ -277,7 +273,7 @@ bool THttpParser::DecodeContent() {
if (!GzipAllowMultipleStreams_) {
decompressor.SetAllowMultipleStreams(false);
}
- DecodedContent_ = decompressor.ReadAll();
+ decodedContent = decompressor.ReadAll();
} else if (ContentEncoding_ == "deflate") {
//https://tools.ietf.org/html/rfc1950
@@ -291,14 +287,14 @@ bool THttpParser::DecodeContent() {
}
try {
- DecodedContent_ = TZLibDecompress(&in, definitelyNoZlibHeader ? ZLib::Raw : ZLib::ZLib).ReadAll();
+ decodedContent = TZLibDecompress(&in, definitelyNoZlibHeader ? ZLib::Raw : ZLib::ZLib).ReadAll();
}
catch(...) {
if (definitelyNoZlibHeader) {
throw;
}
TMemoryInput retryInput(Content_.data(), Content_.size());
- DecodedContent_ = TZLibDecompress(&retryInput, ZLib::Raw).ReadAll();
+ decodedContent = TZLibDecompress(&retryInput, ZLib::Raw).ReadAll();
}
} else if (ContentEncoding_.StartsWith("z-")) {
// opposite for library/cpp/http/io/stream.h
@@ -313,13 +309,13 @@ bool THttpParser::DecodeContent() {
throw THttpParseException() << "Unsupported content-encoding method: " << exc.AsStrBuf();
}
NBlockCodecs::TDecodedInput decoder(&in, codec);
- DecodedContent_ = decoder.ReadAll();
+ decodedContent = decoder.ReadAll();
} else if (ContentEncoding_ == "lz4") {
const auto* codec = NBlockCodecs::Codec(TStringBuf(ContentEncoding_));
- DecodedContent_ = codec->Decode(Content_);
+ decodedContent = codec->Decode(Content_);
} else if (ContentEncoding_ == "br") {
TBrotliDecompress decoder(&in);
- DecodedContent_ = decoder.ReadAll();
+ decodedContent = decoder.ReadAll();
} else {
throw THttpParseException() << "Unsupported content-encoding method: " << ContentEncoding_;
}
diff --git a/library/cpp/http/push_parser/http_parser.h b/library/cpp/http/push_parser/http_parser.h
index a9a9186ba4a..af3ce46dbdb 100644
--- a/library/cpp/http/push_parser/http_parser.h
+++ b/library/cpp/http/push_parser/http_parser.h
@@ -53,7 +53,9 @@ public:
/// sz == 0 signaling end of input stream
bool Parse(const char* data, size_t sz) {
if (ParseImpl(data, sz)) {
- DecodeContent();
+ if (DecodeContent_) {
+ DecodeContent(DecodedContent_);
+ }
return true;
}
return false;
@@ -111,6 +113,8 @@ public:
FirstLine_.reserve(128);
}
+ bool DecodeContent(TString& decodedContent) const;
+
private:
bool ParseImpl(const char* data, size_t sz) {
Data_ = data;
@@ -135,7 +139,6 @@ private:
void ParseHeaderLine();
void OnEof();
- bool DecodeContent();
void ApplyHeaderLine(const TStringBuf& name, const TStringBuf& val);
diff --git a/library/cpp/tld/tlds-alpha-by-domain.txt b/library/cpp/tld/tlds-alpha-by-domain.txt
index 32b383b4ba2..d5d5bf6eb1c 100644
--- a/library/cpp/tld/tlds-alpha-by-domain.txt
+++ b/library/cpp/tld/tlds-alpha-by-domain.txt
@@ -1,4 +1,4 @@
-# Version 2024080700, Last Updated Wed Aug 7 07:07:01 2024 UTC
+# Version 2024082200, Last Updated Thu Aug 22 07:07:02 2024 UTC
AAA
AARP
ABB