Skip to content

Commit

Permalink
mongo 解决部分编译警告
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangke96 committed Jun 24, 2022
1 parent 4a34079 commit e8e38d2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/brpc/mongo.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,13 @@
#include "brpc/proto_base.pb.h"
#include "brpc/socket.h"
#include "butil/arena.h"
#include "butil/bson_util.h"
#include "butil/iobuf.h"
#include "butil/strings/string_piece.h"

namespace brpc {

typedef std::shared_ptr<bson_t> BsonPtr;
using butil::bson::BsonPtr;

struct MongoReply {
int32_t response_flags;
Expand Down
3 changes: 1 addition & 2 deletions src/brpc/policy/mongo_protocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ ParseResult ParseMongoMessage(butil::IOBuf* source, Socket* socket,
source->pop_front(sizeof(buf));
if (header.op_code == MONGO_OPCODE_REPLY) {
LOG(WARNING) << "ParseMongoMessage not support op_code: REPLY";
// TODO(zhangke)
return MakeParseError(PARSE_ERROR_ABSOLUTELY_WRONG);
} else if (header.op_code == MONGO_OPCODE_MSG) {
response_msg->opcode = MONGO_OPCODE_MSG;
MongoMsg& mongo_msg = response_msg->msg;
Expand Down Expand Up @@ -403,7 +403,6 @@ void ProcessMongoResponse(InputMessageBase* msg_base) {
// span->set_response_size(msg->response.ByteSize());
span->set_start_parse_us(start_parse_us);
}
const int saved_error = cntl->ErrorCode();
if (cntl->request_id() == "query" || cntl->request_id() == "query_getMore") {
bool next_batch = cntl->request_id() == "query_getMore";
if (msg->opcode == MONGO_OPCODE_MSG) {
Expand Down

0 comments on commit e8e38d2

Please sign in to comment.