You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by as...@apache.org on 2015/05/06 23:00:08 UTC
[2/2] qpid-proton git commit: NO-JIRA: We can now refactor the SASL
bypass flags back into the SASL struct
NO-JIRA: We can now refactor the SASL bypass flags back into the SASL struct
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/6dd8084b
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/6dd8084b
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/6dd8084b
Branch: refs/heads/master
Commit: 6dd8084b0de28ccdd51121137f3a60d3182e7bae
Parents: df8e9ac
Author: Andrew Stitcher <as...@apache.org>
Authored: Wed May 6 13:31:07 2015 -0400
Committer: Andrew Stitcher <as...@apache.org>
Committed: Wed May 6 16:18:57 2015 -0400
----------------------------------------------------------------------
proton-c/src/engine/engine-internal.h | 4 ----
proton-c/src/sasl/sasl-internal.h | 2 ++
proton-c/src/sasl/sasl.c | 14 ++++++++------
proton-c/src/transport/transport.c | 3 ---
4 files changed, 10 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/6dd8084b/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 748efbb..4b24a02 100644
--- a/proton-c/src/engine/engine-internal.h
+++ b/proton-c/src/engine/engine-internal.h
@@ -197,10 +197,6 @@ struct pn_transport_t {
bool encrypted;
bool referenced;
-
- // Temporarily here until refactor
- bool sasl_input_bypass;
- bool sasl_output_bypass;
};
struct pn_connection_t {
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/6dd8084b/proton-c/src/sasl/sasl-internal.h
----------------------------------------------------------------------
diff --git a/proton-c/src/sasl/sasl-internal.h b/proton-c/src/sasl/sasl-internal.h
index b2d30c8..19fc7ce 100644
--- a/proton-c/src/sasl/sasl-internal.h
+++ b/proton-c/src/sasl/sasl-internal.h
@@ -68,6 +68,8 @@ struct pni_sasl_t {
enum pni_sasl_state desired_state;
enum pni_sasl_state last_state;
bool client;
+ bool input_bypass;
+ bool output_bypass;
bool halt;
};
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/6dd8084b/proton-c/src/sasl/sasl.c
----------------------------------------------------------------------
diff --git a/proton-c/src/sasl/sasl.c b/proton-c/src/sasl/sasl.c
index 2b59460..01eeb88 100644
--- a/proton-c/src/sasl/sasl.c
+++ b/proton-c/src/sasl/sasl.c
@@ -114,12 +114,12 @@ static ssize_t pn_input_read_sasl(pn_transport_t* transport, unsigned int layer,
return PN_EOS;
}
- if (!transport->sasl_input_bypass) {
+ if (!transport->sasl->input_bypass) {
ssize_t n = pn_sasl_input(transport, bytes, available);
if (n != PN_EOS) return n;
- transport->sasl_input_bypass = true;
- if (transport->sasl_output_bypass)
+ transport->sasl->input_bypass = true;
+ if (transport->sasl->output_bypass)
transport->io_layers[layer] = &pni_passthru_layer;
}
return pni_passthru_layer.process_input(transport, layer, bytes, available );
@@ -141,7 +141,7 @@ static ssize_t pn_output_write_sasl_header(pn_transport_t *transport, unsigned i
static ssize_t pn_output_write_sasl(pn_transport_t* transport, unsigned int layer, char* bytes, size_t available)
{
- if (!transport->sasl_output_bypass) {
+ if (!transport->sasl->output_bypass) {
// this accounts for when pn_do_error is invoked, e.g. by idle timeout
ssize_t n;
if (transport->close_sent) {
@@ -151,8 +151,8 @@ static ssize_t pn_output_write_sasl(pn_transport_t* transport, unsigned int laye
}
if (n != PN_EOS) return n;
- transport->sasl_output_bypass = true;
- if (transport->sasl_input_bypass)
+ transport->sasl->output_bypass = true;
+ if (transport->sasl->input_bypass)
transport->io_layers[layer] = &pni_passthru_layer;
}
return pni_passthru_layer.process_output(transport, layer, bytes, available );
@@ -368,6 +368,8 @@ pn_sasl_t *pn_sasl(pn_transport_t *transport)
sasl->cyrus_out.start = NULL;
sasl->desired_state = SASL_NONE;
sasl->last_state = SASL_NONE;
+ sasl->input_bypass = false;
+ sasl->output_bypass = false;
sasl->halt = false;
transport->sasl = sasl;
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/6dd8084b/proton-c/src/transport/transport.c
----------------------------------------------------------------------
diff --git a/proton-c/src/transport/transport.c b/proton-c/src/transport/transport.c
index f6c3c19..46d6364 100644
--- a/proton-c/src/transport/transport.c
+++ b/proton-c/src/transport/transport.c
@@ -411,9 +411,6 @@ static void pn_transport_initialize(void *object)
transport->referenced = true;
- transport->sasl_input_bypass = false;
- transport->sasl_output_bypass = false;
-
transport->trace = (pn_env_bool("PN_TRACE_RAW") ? PN_TRACE_RAW : PN_TRACE_OFF) |
(pn_env_bool("PN_TRACE_FRM") ? PN_TRACE_FRM : PN_TRACE_OFF) |
(pn_env_bool("PN_TRACE_DRV") ? PN_TRACE_DRV : PN_TRACE_OFF);
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org