Skip to content

Commit

Permalink
Fix some errors in the switch statement when decode dubbo response (#…
Browse files Browse the repository at this point in the history
…14207)

Signed-off-by: wbpcode <[email protected]>
  • Loading branch information
wbpcode authored Dec 1, 2020
1 parent 2745d66 commit 7985d81
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ DubboHessian2SerializerImpl::deserializeRpcResult(Buffer::Instance& buffer,
switch (type) {
case RpcResponseType::ResponseWithException:
case RpcResponseType::ResponseWithExceptionWithAttachments:
case RpcResponseType::ResponseWithValue:
result->setException(true);
break;
case RpcResponseType::ResponseWithNullValue:
case RpcResponseType::ResponseNullValueWithAttachments:
has_value = false;
FALLTHRU;
case RpcResponseType::ResponseWithValue:
case RpcResponseType::ResponseValueWithAttachments:
case RpcResponseType::ResponseNullValueWithAttachments:
result->setException(false);
break;
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ TEST(HessianProtocolTest, deserializeRpcResult) {
context->setBodySize(4);
auto result = serializer.deserializeRpcResult(buffer, context);
EXPECT_TRUE(result.second);
EXPECT_TRUE(result.first->hasException());
EXPECT_FALSE(result.first->hasException());
}

// incorrect body size
Expand Down

0 comments on commit 7985d81

Please sign in to comment.