Skip to content

Commit

Permalink
Adjust read buffer sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
lazamar committed Sep 19, 2024
1 parent a0bb385 commit b73aa91
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ async fn inbound_handshake(
server_config: ServerConfig,
request_id: &str,
) -> TlsStream<TcpStream> {
let mut buffer = [0u8; 32];
let mut buffer = [0u8; 8];
inbound_stream.readable().await.unwrap();
inbound_stream.try_read(&mut buffer).unwrap();
if !buffer.starts_with(&[0, 0, 0, 8, 4, 210, 22, 47]) {
Expand Down Expand Up @@ -136,7 +136,7 @@ async fn outbound_handshake(
outbound_stream
.try_write(&[0, 0, 0, 8, 4, 210, 22, 47])
.unwrap();
let mut buffer = [0u8; 32];
let mut buffer = [0u8; 1];
outbound_stream.readable().await.unwrap();
outbound_stream.try_read(&mut buffer).unwrap();
if !buffer.starts_with(b"S") {
Expand Down

0 comments on commit b73aa91

Please sign in to comment.