[ 
https://issues.apache.org/jira/browse/PROTON-1211?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15298738#comment-15298738
 ] 

Cliff Jansen edited comment on PROTON-1211 at 5/24/16 7:15 PM:
---------------------------------------------------------------

Simplest fix is to just clear the pn_data_t before new insertion:

{code}
diff -c message.cpp.cj0 message.cpp

*** 143,148 ****
--- 143,149 ----
  
  void message::correlation_id(const message_id& id) {
      codec::encoder e(make_wrapper(pn_message_correlation_id(pn_msg())));
+     e.clear();
      e << id;
  }
{code}

But perhaps new encoders should clear by default as the more intuative use (and 
have a separate constructor for the "and save my current position" case).


was (Author: cliffjansen):
Simplest fix is to just clear the pn_data_t before new insertion:

{quote}
diff -c message.cpp.cj0 message.cpp

*** 143,148 ****
--- 143,149 ----
  
  void message::correlation_id(const message_id& id) {
      codec::encoder e(make_wrapper(pn_message_correlation_id(pn_msg())));
+     e.clear();
      e << id;
  }
{quote}

But perhaps new encoders should clear by default as the more intuative use (and 
have a separate constructor for the "and save my current position" case).

> C++ binding exception in message::correlation_id()
> --------------------------------------------------
>
>                 Key: PROTON-1211
>                 URL: https://issues.apache.org/jira/browse/PROTON-1211
>             Project: Qpid Proton
>          Issue Type: Bug
>          Components: cpp-binding
>    Affects Versions: 0.13.0, 0.14.0
>            Reporter: Cliff Jansen
>            Assignee: Cliff Jansen
>            Priority: Blocker
>             Fix For: 0.13.0
>
>         Attachments: msgid.cpp
>
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org

Reply via email to