File tree Expand file tree Collapse file tree 1 file changed +14
-9
lines changed
Expand file tree Collapse file tree 1 file changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -1325,16 +1325,21 @@ is_vhost_alive(VHostPath, User) ->
13251325 end .
13261326
13271327is_over_node_connection_limit (Addr , Port ) ->
1328- Ref = rabbit_networking :ranch_ref (Addr , Port ),
1329- #{active_connections := ActiveConns } = ranch :info (Ref ),
13301328 Limit = rabbit_misc :get_env (rabbit , connection_max , infinity ),
1331- case ActiveConns > Limit of
1332- false -> ok ;
1333- true ->
1334- rabbit_misc :protocol_error (not_allowed ,
1335- " connection refused: "
1336- " node connection limit (~tp ) is reached" ,
1337- [Limit ])
1329+ case Limit of
1330+ infinity -> ok ;
1331+ N when is_integer (N ) ->
1332+ Ref = rabbit_networking :ranch_ref (Addr , Port ),
1333+ #{active_connections := ActiveConns } = ranch :info (Ref ),
1334+
1335+ case ActiveConns > Limit of
1336+ false -> ok ;
1337+ true ->
1338+ rabbit_misc :protocol_error (not_allowed ,
1339+ " connection refused: "
1340+ " node connection limit (~tp ) is reached" ,
1341+ [Limit ])
1342+ end
13381343 end .
13391344
13401345is_over_vhost_connection_limit (VHostPath , User ) ->
You can’t perform that action at this time.
0 commit comments