PROTON-749: Change tick layer callbacks so that they're not chained just called in sequence
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/120639bf Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/120639bf Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/120639bf Branch: refs/heads/master Commit: 120639bf6ebed39fa52c4743baf92a90df87d497 Parents: c814d5c Author: Andrew Stitcher <astitc...@apache.org> Authored: Fri Aug 15 17:58:37 2014 -0400 Committer: Andrew Stitcher <astitc...@apache.org> Committed: Mon Nov 17 14:55:18 2014 -0500 ---------------------------------------------------------------------- proton-c/src/engine/engine-internal.h | 2 -- proton-c/src/sasl/sasl.c | 8 ++++---- proton-c/src/ssl/openssl.c | 10 +++++----- proton-c/src/transport/transport.c | 26 +++++++++++--------------- proton-c/src/windows/schannel.c | 10 +++++----- 5 files changed, 25 insertions(+), 31 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/120639bf/proton-c/src/engine/engine-internal.h ---------------------------------------------------------------------- diff --git a/proton-c/src/engine/engine-internal.h b/proton-c/src/engine/engine-internal.h index 86f5161..40a839b 100644 --- a/proton-c/src/engine/engine-internal.h +++ b/proton-c/src/engine/engine-internal.h @@ -300,8 +300,6 @@ void pn_link_dump(pn_link_t *link); void pn_dump(pn_connection_t *conn); void pn_transport_sasl_init(pn_transport_t *transport); -pn_timestamp_t pn_io_layer_tick_passthru(pn_transport_t *, unsigned int, pn_timestamp_t); - void pn_condition_init(pn_condition_t *condition); void pn_condition_tini(pn_condition_t *condition); void pn_modified(pn_connection_t *connection, pn_endpoint_t *endpoint, bool emit); http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/120639bf/proton-c/src/sasl/sasl.c ---------------------------------------------------------------------- diff --git a/proton-c/src/sasl/sasl.c b/proton-c/src/sasl/sasl.c index 97bead4..5034eb7 100644 --- a/proton-c/src/sasl/sasl.c +++ b/proton-c/src/sasl/sasl.c @@ -61,28 +61,28 @@ static ssize_t pn_output_write_sasl(pn_transport_t *transport, unsigned int laye const pn_io_layer_t sasl_headers_layer = { pn_input_read_sasl_header, pn_output_write_sasl_header, - pn_io_layer_tick_passthru, + NULL, NULL }; const pn_io_layer_t sasl_write_header_layer = { pn_input_read_sasl, pn_output_write_sasl_header, - pn_io_layer_tick_passthru, + NULL, NULL }; const pn_io_layer_t sasl_read_header_layer = { pn_input_read_sasl_header, pn_output_write_sasl, - pn_io_layer_tick_passthru, + NULL, NULL }; const pn_io_layer_t sasl_layer = { pn_input_read_sasl, pn_output_write_sasl, - pn_io_layer_tick_passthru, + NULL, NULL }; http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/120639bf/proton-c/src/ssl/openssl.c ---------------------------------------------------------------------- diff --git a/proton-c/src/ssl/openssl.c b/proton-c/src/ssl/openssl.c index a763cfb..7202f7a 100644 --- a/proton-c/src/ssl/openssl.c +++ b/proton-c/src/ssl/openssl.c @@ -670,35 +670,35 @@ int pn_ssl_domain_set_peer_authentication(pn_ssl_domain_t *domain, const pn_io_layer_t unknown_layer = { process_input_unknown, process_output_unknown, - pn_io_layer_tick_passthru, + NULL, NULL }; const pn_io_layer_t ssl_layer = { process_input_ssl, process_output_ssl, - pn_io_layer_tick_passthru, + NULL, buffered_output }; const pn_io_layer_t ssl_input_closed_layer = { process_input_done, process_output_ssl, - pn_io_layer_tick_passthru, + NULL, buffered_output }; const pn_io_layer_t ssl_output_closed_layer = { process_input_ssl, process_output_done, - pn_io_layer_tick_passthru, + NULL, buffered_output }; const pn_io_layer_t ssl_closed_layer = { process_input_done, process_output_done, - pn_io_layer_tick_passthru, + NULL, buffered_output }; http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/120639bf/proton-c/src/transport/transport.c ---------------------------------------------------------------------- diff --git a/proton-c/src/transport/transport.c b/proton-c/src/transport/transport.c index d93e16f..2c086db 100644 --- a/proton-c/src/transport/transport.c +++ b/proton-c/src/transport/transport.c @@ -109,7 +109,7 @@ static void pni_default_tracer(pn_transport_t *transport, const char *message) const pn_io_layer_t pni_passthru_layer = { pn_io_layer_input_passthru, pn_io_layer_output_passthru, - pn_io_layer_tick_passthru, + NULL, NULL }; @@ -1095,8 +1095,8 @@ static ssize_t transport_consume(pn_transport_t *transport) while (transport->input_pending || transport->tail_closed) { ssize_t n; - n = transport->io_layers[PN_IO_SSL]-> - process_input( transport, PN_IO_SSL, + n = transport->io_layers[0]-> + process_input( transport, 0, transport->input_buf + consumed, transport->input_pending ); if (n > 0) { @@ -1904,8 +1904,8 @@ static ssize_t transport_produce(pn_transport_t *transport) while (space > 0) { ssize_t n; - n = transport->io_layers[PN_IO_SSL]-> - process_output( transport, PN_IO_SSL, + n = transport->io_layers[0]-> + process_output( transport, 0, &transport->output_buf[transport->output_pending], space ); if (n > 0) { @@ -2052,7 +2052,12 @@ pn_millis_t pn_transport_get_remote_idle_timeout(pn_transport_t *transport) pn_timestamp_t pn_transport_tick(pn_transport_t *transport, pn_timestamp_t now) { - return transport->io_layers[PN_IO_SSL]->process_tick(transport, PN_IO_SSL, now); + pn_timestamp_t r = 0; + for (int i = 0; i<PN_IO_LAYER_CT; ++i) { + if (transport->io_layers[i]->process_tick) + r = pn_timestamp_min(r, transport->io_layers[i]->process_tick(transport, i, now)); + } + return r; } uint64_t pn_transport_get_frames_output(const pn_transport_t *transport) @@ -2085,15 +2090,6 @@ ssize_t pn_io_layer_output_passthru(pn_transport_t *transport, unsigned int laye return PN_EOS; } -/** Pass through tick handler */ -pn_timestamp_t pn_io_layer_tick_passthru(pn_transport_t *transport, unsigned int layer, pn_timestamp_t now) -{ - if (layer+1<PN_IO_LAYER_CT) - return transport->io_layers[layer+1]->process_tick(transport, layer+1, now); - return 0; -} - - /// // input http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/120639bf/proton-c/src/windows/schannel.c ---------------------------------------------------------------------- diff --git a/proton-c/src/windows/schannel.c b/proton-c/src/windows/schannel.c index 397fa21..7f47745 100644 --- a/proton-c/src/windows/schannel.c +++ b/proton-c/src/windows/schannel.c @@ -351,35 +351,35 @@ int pn_ssl_domain_set_peer_authentication(pn_ssl_domain_t *domain, const pn_io_layer_t unknown_layer = { process_input_unknown, process_output_unknown, - pn_io_layer_tick_passthru, + NULL, NULL }; const pn_io_layer_t ssl_layer = { process_input_ssl, process_output_ssl, - pn_io_layer_tick_passthru, + NULL, buffered_output }; const pn_io_layer_t ssl_input_closed_layer = { process_input_done, process_output_ssl, - pn_io_layer_tick_passthru, + NULL, buffered_output }; const pn_io_layer_t ssl_output_closed_layer = { process_input_ssl, process_output_done, - pn_io_layer_tick_passthru, + NULL, buffered_output }; const pn_io_layer_t ssl_closed_layer = { process_input_done, process_output_done, - pn_io_layer_tick_passthru, + NULL, buffered_output }; --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org For additional commands, e-mail: commits-h...@qpid.apache.org