You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ch...@apache.org on 2017/10/12 14:48:08 UTC
qpid-proton git commit: PROTON-1623: append new data to existing data
Repository: qpid-proton
Updated Branches:
refs/heads/master 884ec562b -> 174747c03
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/master
Commit: 174747c030050bb5fc75f342ca54a57c769874bf
Parents: 884ec56
Author: Chuck Rolke <cr...@redhat.com>
Authored: Thu Oct 12 10:47:58 2017 -0400
Committer: Chuck Rolke <cr...@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-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org