qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acon...@apache.org
Subject [02/50] [abbrv] qpid-proton git commit: PROTON-1069: Windows SChannel: tell transport application input closed or ssl input closed sooner
Date Wed, 30 Dec 2015 21:12:50 GMT
PROTON-1069: Windows SChannel: tell transport application input closed or ssl input closed
sooner


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/a267629f
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/a267629f
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/a267629f

Branch: refs/heads/go1
Commit: a267629f97c9f088ad4d818079c38461dc79d48d
Parents: f1b484a
Author: Clifford Jansen <cliffjansen@apache.org>
Authored: Sun Nov 29 18:06:15 2015 -0800
Committer: Clifford Jansen <cliffjansen@apache.org>
Committed: Sun Nov 29 18:06:15 2015 -0800

----------------------------------------------------------------------
 proton-c/src/windows/schannel.c | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/a267629f/proton-c/src/windows/schannel.c
----------------------------------------------------------------------
diff --git a/proton-c/src/windows/schannel.c b/proton-c/src/windows/schannel.c
index 57345d7..7de629f 100644
--- a/proton-c/src/windows/schannel.c
+++ b/proton-c/src/windows/schannel.c
@@ -1523,9 +1523,9 @@ static ssize_t process_input_ssl(pn_transport_t *transport, unsigned
int layer,
 
   do {
     if (ssl->sc_input_shutdown) {
-      // TLS protocol shutdown detected on input
+      // TLS protocol shutdown detected on input, so we are done.
       read_closed(transport, layer, 0);
-      return consumed;
+      return PN_EOS;
     }
 
     // sc_inbuf should be ready for new or additional network encrypted bytes.
@@ -1596,7 +1596,7 @@ static ssize_t process_input_ssl(pn_transport_t *transport, unsigned
int layer,
         start_ssl_shutdown(transport);
       }
     } else if (ssl->state == SSL_CLOSED) {
-      return consumed ? consumed : -1;
+      return PN_EOS;
     }
 
     // Consume or discard the decrypted bytes
@@ -1632,12 +1632,16 @@ static ssize_t process_input_ssl(pn_transport_t *transport, unsigned
int layer,
     }
   } while (available || (ssl->sc_in_count && !ssl->sc_in_incomplete));
 
-  if (ssl->app_input_closed && ssl->state >= SHUTTING_DOWN) {
-    consumed = ssl->app_input_closed;
-    if (transport->io_layers[layer]==&ssl_output_closed_layer) {
-      transport->io_layers[layer] = &ssl_closed_layer;
-    } else {
-      transport->io_layers[layer] = &ssl_input_closed_layer;
+  if (ssl->state >= SHUTTING_DOWN) {
+    if (ssl->app_input_closed || ssl->sc_input_shutdown) {
+      // Next layer doesn't want more bytes, or it can't process without more data than it
has seen so far
+      // but the ssl stream has ended
+      consumed = ssl->app_input_closed ? ssl->app_input_closed : PN_EOS;
+      if (transport->io_layers[layer]==&ssl_output_closed_layer) {
+        transport->io_layers[layer] = &ssl_closed_layer;
+      } else {
+        transport->io_layers[layer] = &ssl_input_closed_layer;
+      }
     }
   }
   ssl_log(transport, "process_input_ssl() returning %d, forwarded %d\n", (int) consumed,
(int) forwarded);


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message