Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/brpc/input_messenger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,14 @@ ParseResult InputMessenger::CutInputMessage(
}

if (m->CreatedByConnect()) {
if((ProtocolType)cur_index == PROTOCOL_BAIDU_STD) {
if((ProtocolType)cur_index == PROTOCOL_BAIDU_STD && cur_index == preferred) {
// baidu_std may fall to streaming_rpc.
cur_index = (int)PROTOCOL_STREAMING_RPC;
continue;
} else if((ProtocolType)cur_index == PROTOCOL_STREAMING_RPC && cur_index == preferred) {
// streaming_rpc may fall to baidu_std.
cur_index = (int)PROTOCOL_BAIDU_STD;
continue;
} else {
// The protocol is fixed at client-side, no need to try others.
LOG(ERROR) << "Fail to parse response from " << m->remote_side()
Expand Down
Loading