From 9ce83e4c6eb39d289149b7aa3db2b4bd34ab6a0f Mon Sep 17 00:00:00 2001 From: walter Date: Sat, 29 Mar 2025 11:28:29 +0800 Subject: [PATCH] [fix](thrift) Pick THRIFT-5492: Add readEnd to TBufferedTransport (#49649) --- thirdparty/download-thirdparty.sh | 17 +++++++++++ ...ift-0.16-reset-consumed-message-size.patch | 29 +++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 thirdparty/patches/thrift-0.16-reset-consumed-message-size.patch diff --git a/thirdparty/download-thirdparty.sh b/thirdparty/download-thirdparty.sh index ac000ead7e7b16..c7f2eea4c37b95 100755 --- a/thirdparty/download-thirdparty.sh +++ b/thirdparty/download-thirdparty.sh @@ -455,4 +455,21 @@ else fi fi +# patch thrift +if [[ " ${TP_ARCHIVES[*]} " =~ " THRIFT " ]]; then + if [[ "${THRIFT_SOURCE}" == 'thrift-0.16.0' ]]; then + cd "${TP_SOURCE_DIR}/${THRIFT_SOURCE}" + if [[ ! -f "${PATCHED_MARK}" ]]; then + for patch_file in "${TP_PATCH_DIR}"/thrift-0.16*; do + echo "patch ${patch_file}" + patch -p1 --ignore-whitespace <"${patch_file}" + done + touch "${PATCHED_MARK}" + fi + cd - + fi + echo "Finished patching ${THRIFT_SOURCE}" +fi + + # vim: ts=4 sw=4 ts=4 tw=100: diff --git a/thirdparty/patches/thrift-0.16-reset-consumed-message-size.patch b/thirdparty/patches/thrift-0.16-reset-consumed-message-size.patch new file mode 100644 index 00000000000000..a760e3742db222 --- /dev/null +++ b/thirdparty/patches/thrift-0.16-reset-consumed-message-size.patch @@ -0,0 +1,29 @@ +From 89e0bc5fa4949b68503f7b6892128cc8fc5bc1d4 Mon Sep 17 00:00:00 2001 +From: Steve Licking +Date: Fri, 31 Dec 2021 10:54:05 -0800 +Subject: [PATCH] THRIFT-5492: Add readEnd to TBufferedTransport client: cpp + Patch: Steve Licking + +--- + lib/cpp/src/thrift/transport/TBufferTransports.h | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/lib/cpp/src/thrift/transport/TBufferTransports.h b/lib/cpp/src/thrift/transport/TBufferTransports.h +index 179934ba0..6feb540af 100644 +--- a/lib/cpp/src/thrift/transport/TBufferTransports.h ++++ b/lib/cpp/src/thrift/transport/TBufferTransports.h +@@ -270,6 +270,11 @@ public: + */ + uint32_t readAll(uint8_t* buf, uint32_t len) { return TBufferBase::readAll(buf, len); } + ++ uint32_t readEnd() override { ++ resetConsumedMessageSize(); ++ return 0; ++ } ++ + protected: + void initPointers() { + setReadBuffer(rBuf_.get(), 0); +-- +2.39.3 +