Skip to content

Commit

Permalink
properly set decodeMetadataUsingBinary
Browse files Browse the repository at this point in the history
Summary: tsia

Reviewed By: iahs

Differential Revision: D66013096

fbshipit-source-id: 8d6f398a1d35c64b27ec9d9e295811b94c23c3a2
  • Loading branch information
avalonalex authored and facebook-github-bot committed Nov 17, 2024
1 parent fe75e5a commit 77e6ce5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions thrift/lib/cpp2/transport/rocket/client/RocketClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,9 @@ void RocketClient::handleFrame(std::unique_ptr<folly::IOBuf> frame) {
ServerPushMetadata serverMeta;
try {
PayloadSerializer::getInstance().unpack(
serverMeta, std::move(mdPushFrame.metadata()), false);
serverMeta,
std::move(mdPushFrame.metadata()),
encodeMetadataUsingBinary_);
} catch (...) {
close(transport::TTransportException(
transport::TTransportException::CORRUPTED_DATA,
Expand Down Expand Up @@ -388,7 +390,7 @@ StreamChannelStatusResponse RocketClient::handleFirstResponse(
}
auto firstResponse =
rocket::PayloadSerializer::getInstance().unpack<FirstResponsePayload>(
std::move(fullPayload), false /* decodeMetadataUsingBinary */);
std::move(fullPayload), encodeMetadataUsingBinary_);
if (firstResponse.hasException()) {
serverCallback.onInitialError(std::move(firstResponse.exception()));
return StreamChannelStatus::Complete;
Expand Down Expand Up @@ -444,7 +446,7 @@ StreamChannelStatusResponse RocketClient::handleStreamResponse(
if (next) {
auto streamPayload =
rocket::PayloadSerializer::getInstance().unpack<StreamPayload>(
std::move(fullPayload), false /* decodeMetadataUsingBinary */);
std::move(fullPayload), encodeMetadataUsingBinary_);
if (streamPayload.hasException()) {
return serverCallback.onStreamError(std::move(streamPayload.exception()));
}
Expand Down Expand Up @@ -513,7 +515,7 @@ StreamChannelStatusResponse RocketClient::handleSinkResponse(
if (next) {
auto streamPayload =
rocket::PayloadSerializer::getInstance().unpack<StreamPayload>(
std::move(fullPayload), false /* decodeMetadataUsingBinary */);
std::move(fullPayload), encodeMetadataUsingBinary_);
if (streamPayload.hasException()) {
return serverCallback.onFinalResponseError(
std::move(streamPayload.exception()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ void RocketServerConnection::handleSinkFrame(
if (next) {
auto streamPayload =
PayloadSerializer::getInstance().unpack<StreamPayload>(
std::move(*fullPayload), false /* decodeMetadataUsingBinary */);
std::move(*fullPayload), decodeMetadataUsingBinary_.value());
if (streamPayload.hasException()) {
notViolateContract =
clientCallback.onSinkError(std::move(streamPayload.exception()));
Expand Down

0 comments on commit 77e6ce5

Please sign in to comment.