@@ -1212,13 +1212,14 @@ handle_method0(#'connection.open'{virtual_host = VHost},
1212
1212
State = # v1 {connection_state = opening ,
1213
1213
connection = Connection = # connection {
1214
1214
log_name = ConnName ,
1215
+ host = Addr ,
1215
1216
port = Port ,
1216
1217
user = User = # user {username = Username },
1217
1218
protocol = Protocol },
1218
1219
helper_sup = SupPid ,
1219
1220
sock = Sock ,
1220
1221
throttle = Throttle }) ->
1221
- ok = is_over_node_connection_limit (Port ),
1222
+ ok = is_over_node_connection_limit (Addr , Port ),
1222
1223
ok = is_over_vhost_connection_limit (VHost , User ),
1223
1224
ok = is_over_user_connection_limit (User ),
1224
1225
ok = rabbit_access_control :check_vhost_access (User , VHost , {socket , Sock }, #{}),
@@ -1319,8 +1320,7 @@ is_vhost_alive(VHostPath, User) ->
1319
1320
[VHostPath , User # user .username , VHostPath ])
1320
1321
end .
1321
1322
1322
- is_over_node_connection_limit (Port ) ->
1323
- {Addr , _ , _ } = hd (rabbit_networking :tcp_listener_addresses (Port )),
1323
+ is_over_node_connection_limit (Addr , Port ) ->
1324
1324
Ref = rabbit_networking :ranch_ref (Addr , Port ),
1325
1325
#{active_connections := ActiveConns } = ranch :info (Ref ),
1326
1326
Limit = rabbit_misc :get_env (rabbit , connection_max , infinity ),
0 commit comments