Author: tross
Date: Fri May 24 20:42:39 2013
New Revision: 1486214
URL: http://svn.apache.org/r1486214
Log:
NO-JIRA - Pre-settled deliveries that are received must be locally settled.
Modified:
qpid/trunk/qpid/extras/dispatch/src/message.c
qpid/trunk/qpid/extras/dispatch/src/router_node.c
Modified: qpid/trunk/qpid/extras/dispatch/src/message.c
URL:
http://svn.apache.org/viewvc/qpid/trunk/qpid/extras/dispatch/src/message.c?rev=1486214&r1=1486213&r2=1486214&view=diff
==============================================================================
--- qpid/trunk/qpid/extras/dispatch/src/message.c (original)
+++ qpid/trunk/qpid/extras/dispatch/src/message.c Fri May 24 20:42:39 2013
@@ -785,62 +785,6 @@ dx_field_iterator_t *dx_message_field_it
}
-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);
Modified: qpid/trunk/qpid/extras/dispatch/src/router_node.c
URL:
http://svn.apache.org/viewvc/qpid/trunk/qpid/extras/dispatch/src/router_node.c?rev=1486214&r1=1486213&r2=1486214&view=diff
==============================================================================
--- qpid/trunk/qpid/extras/dispatch/src/router_node.c (original)
+++ qpid/trunk/qpid/extras/dispatch/src/router_node.c Fri May 24 20:42:39 2013
@@ -210,8 +210,14 @@ static void router_rx_handler(void* cont
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(
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);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]