diff --git a/veilid-core/src/connection_table.rs b/veilid-core/src/connection_table.rs index ccc3b341..da6d33aa 100644 --- a/veilid-core/src/connection_table.rs +++ b/veilid-core/src/connection_table.rs @@ -34,7 +34,7 @@ impl ConnectionTable { assert!(res.is_none()); let conns = self.conns_by_remote.entry(descriptor.remote).or_default(); - warn!("add_connection: {:?}", conn); + //warn!("add_connection: {:?}", conn); conns.push(conn); Ok(()) @@ -42,7 +42,7 @@ impl ConnectionTable { pub fn get_connection(&self, descriptor: ConnectionDescriptor) -> Option { let out = self.conn_by_descriptor.get(&descriptor).cloned(); - warn!("get_connection: {:?} -> {:?}", descriptor, out); + //warn!("get_connection: {:?} -> {:?}", descriptor, out); out } pub fn get_last_connection_by_remote(&self, remote: PeerAddress) -> Option { @@ -50,7 +50,7 @@ impl ConnectionTable { .conns_by_remote .get(&remote) .map(|v| v[(v.len() - 1)].clone()); - warn!("get_last_connection_by_remote: {:?} -> {:?}", remote, out); + //warn!("get_last_connection_by_remote: {:?} -> {:?}", remote, out); out } @@ -62,7 +62,7 @@ impl ConnectionTable { &mut self, descriptor: ConnectionDescriptor, ) -> Result { - warn!("remove_connection: {:?}", descriptor); + //warn!("remove_connection: {:?}", descriptor); let out = self .conn_by_descriptor .remove(&descriptor) diff --git a/veilid-core/src/intf/native/network/protocol/tcp.rs b/veilid-core/src/intf/native/network/protocol/tcp.rs index 4391eb04..e995a712 100644 --- a/veilid-core/src/intf/native/network/protocol/tcp.rs +++ b/veilid-core/src/intf/native/network/protocol/tcp.rs @@ -124,7 +124,7 @@ impl RawTcpProtocolHandler { ProtocolNetworkConnection::RawTcp(RawTcpNetworkConnection::new(stream)), ); - warn!("on_accept_async from: {}", socket_addr); + log_net!("on_accept_async from: {}", socket_addr); Ok(Some(conn)) } diff --git a/veilid-core/src/intf/native/network/protocol/ws.rs b/veilid-core/src/intf/native/network/protocol/ws.rs index c505ea32..8104fcab 100644 --- a/veilid-core/src/intf/native/network/protocol/ws.rs +++ b/veilid-core/src/intf/native/network/protocol/ws.rs @@ -22,7 +22,6 @@ pub struct WebsocketNetworkConnection where T: io::Read + io::Write + Send + Unpin + 'static, { - tls: bool, ws_stream: CloneStream>, } @@ -39,9 +38,8 @@ impl WebsocketNetworkConnection where T: io::Read + io::Write + Send + Unpin + 'static, { - pub fn new(tls: bool, ws_stream: WebSocketStream) -> Self { + pub fn new(ws_stream: WebSocketStream) -> Self { Self { - tls, ws_stream: CloneStream::new(ws_stream), } } @@ -103,9 +101,9 @@ impl WebsocketProtocolHandler { pub fn new(config: VeilidConfig, tls: bool, local_address: SocketAddr) -> Self { let c = config.get(); let path = if tls { - format!("GET {}", c.network.protocol.ws.path.trim_end_matches('/')) + format!("GET /{}", c.network.protocol.ws.path.trim_end_matches('/')) } else { - format!("GET {}", c.network.protocol.wss.path.trim_end_matches('/')) + format!("GET /{}", c.network.protocol.wss.path.trim_end_matches('/')) }; let connection_initial_timeout = if tls { c.network.tls.connection_initial_timeout @@ -151,7 +149,11 @@ impl WebsocketProtocolHandler { && peekbuf[request_path_len - 1] == b' ')); if !matches_path { - log_net!("not websocket"); + log_net!( + "not websocket: request_path: {} peekbuf:{}", + std::str::from_utf8(&self.arc.request_path).unwrap(), + std::str::from_utf8(&peekbuf).unwrap() + ); return Ok(None); } log_net!("found websocket"); @@ -176,10 +178,7 @@ impl WebsocketProtocolHandler { peer_addr, SocketAddress::from_socket_addr(self.arc.local_address), ), - ProtocolNetworkConnection::WsAccepted(WebsocketNetworkConnection::new( - self.arc.tls, - ws_stream, - )), + ProtocolNetworkConnection::WsAccepted(WebsocketNetworkConnection::new(ws_stream)), ); Ok(Some(conn)) @@ -246,7 +245,7 @@ impl WebsocketProtocolHandler { Ok(NetworkConnection::from_protocol( descriptor, - ProtocolNetworkConnection::Wss(WebsocketNetworkConnection::new(tls, ws_stream)), + ProtocolNetworkConnection::Wss(WebsocketNetworkConnection::new(ws_stream)), )) } else { let (ws_stream, _response) = client_async(request, tcp_stream) @@ -255,7 +254,7 @@ impl WebsocketProtocolHandler { .map_err(logthru_net!(error))?; Ok(NetworkConnection::from_protocol( descriptor, - ProtocolNetworkConnection::Ws(WebsocketNetworkConnection::new(tls, ws_stream)), + ProtocolNetworkConnection::Ws(WebsocketNetworkConnection::new(ws_stream)), )) } } diff --git a/veilid-core/src/intf/native/table_store.rs b/veilid-core/src/intf/native/table_store.rs index 3bca5824..eab40dc0 100644 --- a/veilid-core/src/intf/native/table_store.rs +++ b/veilid-core/src/intf/native/table_store.rs @@ -96,9 +96,11 @@ impl TableStore { let cfg = DatabaseConfig::with_columns(column_count); let db = Database::open(&dbpath, cfg).map_err(|e| format!("failed to open tabledb: {}", e))?; - info!( + trace!( "opened table store '{}' at path '{:?}' with {} columns", - name, dbpath, column_count + name, + dbpath, + column_count ); let table_db = TableDB::new(table_name.clone(), self.clone(), db); diff --git a/veilid-core/src/veilid_api/mod.rs b/veilid-core/src/veilid_api/mod.rs index 06ea707c..b264bc4f 100644 --- a/veilid-core/src/veilid_api/mod.rs +++ b/veilid-core/src/veilid_api/mod.rs @@ -461,18 +461,18 @@ impl FromStr for DialInfo { Ok(DialInfo::tcp(socket_address)) } "ws" => { - let (sa, rest) = s.split_once('|').ok_or_else(|| { + let (sa, rest) = rest.split_once('|').ok_or_else(|| { parse_error!("DialInfo::from_str missing socket address '|' separator", s) })?; let socket_address = SocketAddress::from_str(sa)?; - DialInfo::try_ws(socket_address, rest.to_string()) + DialInfo::try_ws(socket_address, format!("ws://{}", rest)) } "wss" => { - let (sa, rest) = s.split_once('|').ok_or_else(|| { + let (sa, rest) = rest.split_once('|').ok_or_else(|| { parse_error!("DialInfo::from_str missing socket address '|' separator", s) })?; let socket_address = SocketAddress::from_str(sa)?; - DialInfo::try_wss(socket_address, rest.to_string()) + DialInfo::try_wss(socket_address, format!("wss://{}", rest)) } _ => Err(parse_error!("DialInfo::from_str has invalid scheme", s)), }