connection table cleanup
This commit is contained in:
@@ -149,8 +149,7 @@ impl RawTcpProtocolHandler {
|
||||
);
|
||||
let local_address = self.inner.lock().local_address;
|
||||
let conn = ProtocolNetworkConnection::RawTcp(RawTcpNetworkConnection::new(
|
||||
ConnectionDescriptor::new(peer_addr, SocketAddress::from_socket_addr(local_address))
|
||||
.map_err(|e| io::Error::new(io::ErrorKind::AddrNotAvailable, e))?,
|
||||
ConnectionDescriptor::new(peer_addr, SocketAddress::from_socket_addr(local_address)),
|
||||
ps,
|
||||
));
|
||||
|
||||
@@ -190,8 +189,7 @@ impl RawTcpProtocolHandler {
|
||||
ProtocolType::TCP,
|
||||
),
|
||||
SocketAddress::from_socket_addr(actual_local_address),
|
||||
)
|
||||
.map_err(|e| io::Error::new(io::ErrorKind::AddrNotAvailable, e))?,
|
||||
),
|
||||
ps,
|
||||
));
|
||||
|
||||
|
@@ -25,16 +25,10 @@ impl RawUdpProtocolHandler {
|
||||
ProtocolType::UDP,
|
||||
);
|
||||
let local_socket_addr = self.socket.local_addr()?;
|
||||
let descriptor = match ConnectionDescriptor::new(
|
||||
let descriptor = ConnectionDescriptor::new(
|
||||
peer_addr,
|
||||
SocketAddress::from_socket_addr(local_socket_addr),
|
||||
) {
|
||||
Ok(d) => d,
|
||||
Err(_) => {
|
||||
log_net!(debug "{}({}) at {}@{}:{}: {:?}", "Invalid peer scope".green(), "received message from invalid peer scope", file!(), line!(), column!(), peer_addr);
|
||||
continue;
|
||||
}
|
||||
};
|
||||
);
|
||||
|
||||
break (size, descriptor);
|
||||
};
|
||||
@@ -62,8 +56,7 @@ impl RawUdpProtocolHandler {
|
||||
let descriptor = ConnectionDescriptor::new(
|
||||
peer_addr,
|
||||
SocketAddress::from_socket_addr(local_socket_addr),
|
||||
)
|
||||
.map_err(|e| io::Error::new(io::ErrorKind::AddrNotAvailable, e))?;
|
||||
);
|
||||
|
||||
let len = network_result_try!(self
|
||||
.socket
|
||||
|
@@ -212,8 +212,7 @@ impl WebsocketProtocolHandler {
|
||||
ConnectionDescriptor::new(
|
||||
peer_addr,
|
||||
SocketAddress::from_socket_addr(self.arc.local_address),
|
||||
)
|
||||
.map_err(|e| io::Error::new(io::ErrorKind::AddrNotAvailable, e))?,
|
||||
),
|
||||
ws_stream,
|
||||
));
|
||||
|
||||
@@ -268,8 +267,7 @@ impl WebsocketProtocolHandler {
|
||||
let descriptor = ConnectionDescriptor::new(
|
||||
dial_info.to_peer_address(),
|
||||
SocketAddress::from_socket_addr(actual_local_addr),
|
||||
)
|
||||
.map_err(|e| io::Error::new(io::ErrorKind::AddrNotAvailable, e))?;
|
||||
);
|
||||
|
||||
// Negotiate TLS if this is WSS
|
||||
if tls {
|
||||
|
Reference in New Issue
Block a user