You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@heron.apache.org by GitBox <gi...@apache.org> on 2018/11/26 17:40:54 UTC

[GitHub] nwangtw commented on a change in pull request #2900: Fix Potential Double Delete Bug

nwangtw commented on a change in pull request #2900: Fix Potential Double Delete Bug
URL: https://github.com/apache/incubator-heron/pull/2900#discussion_r236356251
 
 

 ##########
 File path: heron/common/src/cpp/network/server.cpp
 ##########
 @@ -211,17 +207,16 @@ void Server::InternalSendRequest(Connection* _conn, google::protobuf::Message* _
   sp_int32 byte_size = _request->ByteSize();
   sp_uint32 sop = OutgoingPacket::SizeRequiredToPackString(_request->GetTypeName()) + REQID_size +
                   OutgoingPacket::SizeRequiredToPackProtocolBuffer(byte_size);
-  auto opkt = new OutgoingPacket(sop);
-  CHECK_EQ(opkt->PackString(_request->GetTypeName()), 0);
-  CHECK_EQ(opkt->PackREQID(rid), 0);
-  CHECK_EQ(opkt->PackProtocolBuffer(*_request, byte_size), 0);
+  OutgoingPacket opkt(sop);
 
 Review comment:
   Suggest to make the same change in SendResponse() and send SendMessage() in this file.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services