fix punish
This commit is contained in:
		| @@ -63,12 +63,13 @@ impl ConnectionManager { | ||||
|                 c.network.connection_inactivity_timeout_ms, | ||||
|             ) | ||||
|         }; | ||||
|         let address_filter = network_manager.address_filter(); | ||||
|  | ||||
|         ConnectionManagerArc { | ||||
|             network_manager, | ||||
|             connection_initial_timeout_ms, | ||||
|             connection_inactivity_timeout_ms, | ||||
|             connection_table: ConnectionTable::new(config), | ||||
|             connection_table: ConnectionTable::new(config, address_filter), | ||||
|             address_lock_table: AsyncTagLockTable::new(), | ||||
|             inner: Mutex::new(None), | ||||
|         } | ||||
|   | ||||
| @@ -38,7 +38,7 @@ pub struct ConnectionTable { | ||||
| } | ||||
|  | ||||
| impl ConnectionTable { | ||||
|     pub fn new(config: VeilidConfig) -> Self { | ||||
|     pub fn new(config: VeilidConfig, address_filter: AddressFilter) -> Self { | ||||
|         let max_connections = { | ||||
|             let c = config.get(); | ||||
|             vec![ | ||||
| @@ -58,7 +58,7 @@ impl ConnectionTable { | ||||
|                 protocol_index_by_id: BTreeMap::new(), | ||||
|                 id_by_descriptor: BTreeMap::new(), | ||||
|                 ids_by_remote: BTreeMap::new(), | ||||
|                 address_filter: AddressFilter::new(config), | ||||
|                 address_filter, | ||||
|             })), | ||||
|         } | ||||
|     } | ||||
|   | ||||
| @@ -5,8 +5,8 @@ use crate::tests::common::test_veilid_config::*; | ||||
|  | ||||
| pub async fn test_add_get_remove() { | ||||
|     let config = get_config(); | ||||
|  | ||||
|     let table = ConnectionTable::new(config); | ||||
|     let address_filter = AddressFilter::new(config.clone()); | ||||
|     let table = ConnectionTable::new(config, address_filter); | ||||
|  | ||||
|     let a1 = ConnectionDescriptor::new_no_local(PeerAddress::new( | ||||
|         SocketAddress::new(Address::IPV4(Ipv4Addr::new(192, 168, 0, 1)), 8080), | ||||
|   | ||||
		Reference in New Issue
	
	Block a user