summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Klishin <michael@rabbitmq.com>2013-11-29 12:44:54 +0400
committerMichael Klishin <michael@rabbitmq.com>2013-11-29 12:44:54 +0400
commit0a4519531c573db43efdf6123634842c40cef3e8 (patch)
treea14662691a16aabb913e844214adca0d95a7c2af /src
parenta047d93c78916776978fc5365f3d81095973424a (diff)
downloadrabbitmq-server-git-0a4519531c573db43efdf6123634842c40cef3e8.tar.gz
Fix off-by-1 issue
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_reader.erl4
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 ->