DreamPearl commented on a change in pull request #355:
URL: https://github.com/apache/qpid-proton/pull/355#discussion_r813856498



##########
File path: cpp/src/sender.cpp
##########
@@ -67,11 +68,20 @@ tracker sender::send(const message &message) {
 }
 
 tracker sender::send(const message &message, const binary &tag) {
+    proton::message* message_to_send = (proton::message*)&message;
     pn_delivery_t *dlv = pn_delivery(
         pn_object(),
         pn_dtag((reinterpret_cast<const char *>(&tag[0])), tag.size()));
+    proton::binary tag_cp = tag;
+    tracker track = make_wrapper<tracker>(dlv);
     std::vector<char> buf;
-    message.encode(buf);
+    proton::message message_cp;
+    if (isTracingEnable()) {
+        message_cp = message;
+        send_span(message_cp, tag_cp, track);
+        message_to_send = &message_cp;
+    }
+    message_to_send->encode(buf);

Review comment:
       Also tried without using a message pointer.
   ```
   if (isTracingEnable()) {
       proton::message message_cp = message;
       send_span(message_cp, tag_cp, track);
       message_cp.encode(buf);
       }
    else
       message.encode(buf);
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to