diff options
| -rw-r--r-- | src/rabbit_reader.erl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rabbit_reader.erl b/src/rabbit_reader.erl index b55fde5a66..00ff4b1963 100644 --- a/src/rabbit_reader.erl +++ b/src/rabbit_reader.erl @@ -612,12 +612,12 @@ create_channel(Channel, State) -> vhost = VHost, capabilities = Capabilities}} = State, N = length(all_channels()), - case ChannelMax /= 0 andalso N > ChannelMax of + case ChannelMax /= 0 andalso N + 1 > ChannelMax of true -> %% we cannot use rabbit_misc:protocol_error here because amqp_error is caught %% only for the methods on channel 0. AmqpError = rabbit_misc:amqp_error( - not_allowed, "number of channels opened (~w) is greater than the negotiated channel_max (~w)", + not_allowed, "number of channels opened (~w) has reached the negotiated channel_max (~w)", [N, ChannelMax], 'channel.open'), throw({error, AmqpError}); false -> |
