Return-Path: X-Original-To: apmail-qpid-commits-archive@www.apache.org Delivered-To: apmail-qpid-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 10D5F1946A for ; Mon, 11 Apr 2016 15:47:34 +0000 (UTC) Received: (qmail 6512 invoked by uid 500); 11 Apr 2016 15:47:34 -0000 Delivered-To: apmail-qpid-commits-archive@qpid.apache.org Received: (qmail 6477 invoked by uid 500); 11 Apr 2016 15:47:33 -0000 Mailing-List: contact commits-help@qpid.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@qpid.apache.org Delivered-To: mailing list commits@qpid.apache.org Received: (qmail 6468 invoked by uid 99); 11 Apr 2016 15:47:33 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Apr 2016 15:47:33 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id B9CD2DFBA3; Mon, 11 Apr 2016 15:47:33 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: chug@apache.org To: commits@qpid.apache.org Message-Id: <88d162ef874c48398b4580338dcbeadb@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: qpid-proton git commit: PROTON-1173: Close channel with error on channel-max violation Date: Mon, 11 Apr 2016 15:47:33 +0000 (UTC) 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 Authored: Mon Apr 11 11:47:21 2016 -0400 Committer: Chuck Rolke 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