NO-JIRA: [C++ binding] Allow simple_recv example to receive a message with no id
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/50a4e835 Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/50a4e835 Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/50a4e835 Branch: refs/heads/go1 Commit: 50a4e835385130f10ad9bbbb04709936f498d37b Parents: cd4ecfd Author: Andrew Stitcher <astitc...@apache.org> Authored: Wed May 16 13:51:46 2018 -0400 Committer: Andrew Stitcher <astitc...@apache.org> Committed: Wed May 16 13:51:46 2018 -0400 ---------------------------------------------------------------------- cpp/examples/simple_recv.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/50a4e835/cpp/examples/simple_recv.cpp ---------------------------------------------------------------------- diff --git a/cpp/examples/simple_recv.cpp b/cpp/examples/simple_recv.cpp index 5a7cde4..09a39e5 100644 --- a/cpp/examples/simple_recv.cpp +++ b/cpp/examples/simple_recv.cpp @@ -57,8 +57,8 @@ class simple_recv : public proton::messaging_handler { } void on_message(proton::delivery &d, proton::message &msg) OVERRIDE { - if (proton::coerce<int>(msg.id()) < received) { - return; // Ignore duplicate + if (!msg.id().empty() && proton::coerce<int>(msg.id()) < received) { + return; // Ignore if no id or duplicate } if (expected == 0 || received < expected) { --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org For additional commands, e-mail: commits-h...@qpid.apache.org