diff options
| author | Ted Ross <tross@apache.org> | 2013-05-24 20:42:39 +0000 |
|---|---|---|
| committer | Ted Ross <tross@apache.org> | 2013-05-24 20:42:39 +0000 |
| commit | d7c04dfcfec17330912765ba88b296b517a6c317 (patch) | |
| tree | bab4fe4e8927ade9e240fcfb78a798ccc7288112 | |
| parent | e1be68d273e4e6b7a7915cc91219ce583c1e88d7 (diff) | |
| download | qpid-python-d7c04dfcfec17330912765ba88b296b517a6c317.tar.gz | |
NO-JIRA - Pre-settled deliveries that are received must be locally settled.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1486214 13f79535-47bb-0310-9956-ffa450edef68
| -rw-r--r-- | qpid/extras/dispatch/src/message.c | 56 | ||||
| -rw-r--r-- | qpid/extras/dispatch/src/router_node.c | 10 |
2 files changed, 8 insertions, 58 deletions
diff --git a/qpid/extras/dispatch/src/message.c b/qpid/extras/dispatch/src/message.c index ea5092b13e..041205879e 100644 --- a/qpid/extras/dispatch/src/message.c +++ b/qpid/extras/dispatch/src/message.c @@ -785,62 +785,6 @@ dx_field_iterator_t *dx_message_field_iterator(dx_message_t *msg, dx_message_fie } -dx_iovec_t *dx_message_field_iovec(dx_message_t *msg, dx_message_field_t field) -{ - dx_field_location_t *loc = dx_message_field_location(msg, field); - if (!loc) - return 0; - - // - // Count the number of buffers this field straddles - // - int bufcnt = 1; - dx_buffer_t *buf = loc->buffer; - size_t bufsize = dx_buffer_size(buf) - loc->offset; - ssize_t remaining = loc->length - bufsize; - - while (remaining > 0) { - bufcnt++; - buf = buf->next; - if (!buf) - return 0; - remaining -= dx_buffer_size(buf); - } - - // - // Allocate an iovec object big enough to hold the number of buffers - // - dx_iovec_t *iov = dx_iovec(bufcnt); - if (!iov) - return 0; - - // - // Build out the io vectors with pointers to the segments of the field in buffers - // - bufcnt = 0; - buf = loc->buffer; - bufsize = dx_buffer_size(buf) - loc->offset; - void *base = dx_buffer_base(buf) + loc->offset; - remaining = loc->length; - - while (remaining > 0) { - if (bufsize > remaining) - bufsize = remaining; - dx_iovec_array(iov)[bufcnt].iov_base = base; - dx_iovec_array(iov)[bufcnt].iov_len = bufsize; - bufcnt++; - remaining -= bufsize; - if (remaining > 0) { - buf = buf->next; - base = dx_buffer_base(buf); - bufsize = dx_buffer_size(buf); - } - } - - return iov; -} - - ssize_t dx_message_field_length(dx_message_t *msg, dx_message_field_t field) { dx_field_location_t *loc = dx_message_field_location(msg, field); diff --git a/qpid/extras/dispatch/src/router_node.c b/qpid/extras/dispatch/src/router_node.c index 791434f576..e361e9ce8e 100644 --- a/qpid/extras/dispatch/src/router_node.c +++ b/qpid/extras/dispatch/src/router_node.c @@ -210,8 +210,14 @@ static void router_rx_handler(void* context, dx_link_t *link, pn_delivery_t *del pn_delivery_settle(delivery); } + sys_mutex_unlock(router->lock); // TOINVESTIGATE Move this higher? dx_free_message(msg); - sys_mutex_unlock(router->lock); + + // + // If this was a pre-settled delivery, we must also locally settle it. + // + if (pn_delivery_settled(delivery)) + pn_delivery_settle(delivery); } } else { // @@ -292,7 +298,7 @@ static int router_incoming_link_handler(void* context, dx_link_t *link) pn_terminus_copy(pn_link_source(pn_link), pn_link_remote_source(pn_link)); pn_terminus_copy(pn_link_target(pn_link), pn_link_remote_target(pn_link)); - pn_link_flow(pn_link, 32); + pn_link_flow(pn_link, 1000); pn_link_open(pn_link); } else { pn_link_close(pn_link); |
