jovan-wong commented on a change in pull request #48: [Issue#44] Resolve
RetrySendTimes doesn't Work for Async Send
URL: https://github.com/apache/rocketmq-client-cpp/pull/48#discussion_r244919196
##########
File path: src/protocol/RemotingCommand.cpp
##########
@@ -50,6 +50,46 @@ RemotingCommand::RemotingCommand(int code, string language,
int version,
m_remark(remark),
m_pExtHeader(pExtHeader) {}
+RemotingCommand::RemotingCommand(const RemotingCommand& command) {
+ m_code = command.m_code;
+ m_language = command.m_language;
+ m_version = command.m_version;
+ m_opaque = command.m_opaque;
+ m_flag = command.m_flag;
+ m_remark = command.m_remark;
+ m_msgBody = command.m_msgBody;
+
+ for (auto& it : command.m_extFields) {
+ m_extFields[it.first] = it.second;
+ }
+ m_head = command.m_head;
+ m_body = command.m_body;
+ s_seqNumber.store(command.s_seqNumber.load());
+ m_parsedJson = command.m_parsedJson;
+ //m_pExtHeader = command.m_pExtHeader; //ignore this filed at this moment,
if need please add it
+}
+
+
+RemotingCommand& RemotingCommand::operator=(const RemotingCommand& command) {
+ m_code = command.m_code;
Review comment:
I saw some duplicated codes of assignments of members,
So could we add a private method like `assign(const RemotingCommand&)`?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services