diff options
| author | Ted Ross <tross@apache.org> | 2013-05-16 12:11:14 +0000 |
|---|---|---|
| committer | Ted Ross <tross@apache.org> | 2013-05-16 12:11:14 +0000 |
| commit | f66d7a2bb369ad4a3baaa0cbb8eeaddb7b7a16fe (patch) | |
| tree | 13b72f7a32cf4e36eb93126038302addff9b22eb | |
| parent | de673957302602357c1476879b1f0dda971f81af (diff) | |
| download | qpid-python-f66d7a2bb369ad4a3baaa0cbb8eeaddb7b7a16fe.tar.gz | |
NO-JIRA - Stability fixes for use with non-presettled messages
1) Make the server module more conservative about when it calls pn_driver_wakeup
2) Remove the unconditional settling of dispositions from upstream senders
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1483313 13f79535-47bb-0310-9956-ffa450edef68
| -rw-r--r-- | extras/dispatch/src/router_node.c | 4 | ||||
| -rw-r--r-- | extras/dispatch/src/server.c | 19 |
2 files changed, 17 insertions, 6 deletions
diff --git a/extras/dispatch/src/router_node.c b/extras/dispatch/src/router_node.c index cc96cd5051..791434f576 100644 --- a/extras/dispatch/src/router_node.c +++ b/extras/dispatch/src/router_node.c @@ -267,9 +267,9 @@ static void router_disp_handler(void* context, dx_link_t *link, pn_delivery_t *d return; } + } else { + // TODO - Handle disposition updates from upstream } - - pn_delivery_settle(delivery); } diff --git a/extras/dispatch/src/server.c b/extras/dispatch/src/server.c index 536af048d8..cb57458319 100644 --- a/extras/dispatch/src/server.c +++ b/extras/dispatch/src/server.c @@ -145,18 +145,21 @@ static void block_if_paused_LH(dx_server_t *dx_server) } -static void process_connector(dx_server_t *dx_server, pn_connector_t *cxtr) +static int process_connector(dx_server_t *dx_server, pn_connector_t *cxtr) { dx_connection_t *ctx = pn_connector_context(cxtr); int events = 0; int auth_passes = 0; + int passes = 0; if (ctx->state == CONN_STATE_USER) { dx_server->ufd_handler(ctx->ufd->context, ctx->ufd); - return; + return 0; } do { + passes++; + // // Step the engine for pre-handler processing // @@ -239,6 +242,8 @@ static void process_connector(dx_server_t *dx_server, pn_connector_t *cxtr) break; } } while (events > 0); + + return passes > 1; } @@ -444,7 +449,7 @@ static void *thread_run(void *arg) // Process the connector that we now have exclusive access to. // if (work) { - process_connector(dx_server, work); + int work_done = process_connector(dx_server, work); // // Check to see if the connector was closed during processing @@ -454,11 +459,16 @@ static void *thread_run(void *arg) // Connector is closed. Free the context and the connector. // conn = pn_connector_connection(work); + + // + // If this is a dispatch connector, schedule the re-connect timer + // if (ctx->connector) { ctx->connector->ctx = 0; ctx->connector->state = CXTR_STATE_CONNECTING; dx_timer_schedule(ctx->connector->timer, ctx->connector->delay); } + sys_mutex_lock(dx_server->lock); free_dx_connection_t(ctx); pn_connector_free(work); @@ -480,7 +490,8 @@ static void *thread_run(void *arg) // Wake up the proton driver to force it to reconsider its set of FDs // in light of the processing that just occurred. // - pn_driver_wakeup(dx_server->driver); + if (work_done) + pn_driver_wakeup(dx_server->driver); } } |
