PROTON-1623: append new data to existing data
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/174747c0 Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/174747c0 Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/174747c0 Branch: refs/heads/go1 Commit: 174747c030050bb5fc75f342ca54a57c769874bf Parents: 884ec56 Author: Chuck Rolke <cro...@redhat.com> Authored: Thu Oct 12 10:47:58 2017 -0400 Committer: Chuck Rolke <cro...@redhat.com> Committed: Thu Oct 12 10:47:58 2017 -0400 ---------------------------------------------------------------------- examples/c/receive.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/174747c0/examples/c/receive.c ---------------------------------------------------------------------- diff --git a/examples/c/receive.c b/examples/c/receive.c index 1eeba43..e77ef27 100644 --- a/examples/c/receive.c +++ b/examples/c/receive.c @@ -100,9 +100,10 @@ static bool handle(app_data_t* app, pn_event_t* event) { size_t size = pn_delivery_pending(d); pn_rwbytes_t* m = &app->msgin; /* Append data to incoming message buffer */ int recv; + size_t oldsize = m->size; m->size += size; m->start = (char*)realloc(m->start, m->size); - recv = pn_link_recv(l, m->start, m->size); + recv = pn_link_recv(l, m->start + oldsize, m->size); if (recv == PN_ABORTED) { fprintf(stderr, "Message aborted\n"); m->size = 0; /* Forget the data we accumulated */ --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org For additional commands, e-mail: commits-h...@qpid.apache.org