qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject qpid-proton git commit: PROTON-1173: Close channel with error on channel-max violation
Date Mon, 11 Apr 2016 15:47:33 GMT
Repository: qpid-proton
Updated Branches:
  refs/heads/master ac5d3c687 -> 9d88f823c


PROTON-1173: Close channel with error on channel-max violation


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

Branch: refs/heads/master
Commit: 9d88f823c1951012888440501fdbe111f344518d
Parents: ac5d3c6
Author: Chuck Rolke <crolke@redhat.com>
Authored: Mon Apr 11 11:47:21 2016 -0400
Committer: Chuck Rolke <crolke@redhat.com>
Committed: Mon Apr 11 11:47:21 2016 -0400

----------------------------------------------------------------------
 proton-c/src/transport/transport.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/9d88f823/proton-c/src/transport/transport.c
----------------------------------------------------------------------
diff --git a/proton-c/src/transport/transport.c b/proton-c/src/transport/transport.c
index cf7e593..cc0bc2f 100644
--- a/proton-c/src/transport/transport.c
+++ b/proton-c/src/transport/transport.c
@@ -1197,11 +1197,18 @@ int pn_do_begin(pn_transport_t *transport, uint8_t frame_type, uint16_t
channel,
 
   pn_session_t *ssn;
   if (reply) {
-    // XXX: what if session is NULL?
     ssn = (pn_session_t *) pn_hash_get(transport->local_channels, remote_channel);
   } else {
     ssn = pn_session(transport->connection);
   }
+  if (ssn == 0) {
+    pn_do_error(transport,
+                "amqp:connection:framing-error",
+                "remote channel is above negotiated channel_max %d.",
+                transport->channel_max
+               );
+    return PN_TRANSPORT_ERROR;
+  }
   ssn->state.incoming_transfer_count = next;
   pni_map_remote_channel(ssn, channel);
   PN_SET_REMOTE(ssn->endpoint.state, PN_REMOTE_ACTIVE);


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


Mime
View raw message