Skip to content

Commit

Permalink
address pr feedback
Browse files Browse the repository at this point in the history
- fully remove unused items
  • Loading branch information
jmayclin committed Jun 28, 2024
1 parent 2982348 commit 0eebe6c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 46 deletions.
42 changes: 0 additions & 42 deletions bindings/rust/s2n-tls/src/testing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ pub trait Context {

pub enum Mode {
Client,
_Server,
}

#[derive(Debug)]
Expand Down Expand Up @@ -128,33 +127,11 @@ impl<Server: Connection, Client: Connection> Pair<Server, Client> {
}
}

pub fn _poll_send(&mut self, sender: Mode, buf: &[u8]) -> Poll<Result<()>> {
let result = match sender {
Mode::Client => self.client.0.poll_action(&mut self.client.1, |conn| {
connection::Connection::poll_send(conn, buf)
}),
Mode::_Server => self.server.0.poll_action(&mut self.server.1, |conn| {
connection::Connection::poll_send(conn, buf)
}),
};
self.server.1.transfer(&mut self.client.1);
match result {
Poll::Ready(result) => {
result?;
Ok(()).into()
}
Poll::Pending => Poll::Pending,
}
}

pub fn poll_recv(&mut self, receiver: Mode, buf: &mut [u8]) -> Poll<Result<()>> {
let result = match receiver {
Mode::Client => self.client.0.poll_action(&mut self.client.1, |conn| {
connection::Connection::poll_recv(conn, buf)
}),
Mode::_Server => self.server.0.poll_action(&mut self.server.1, |conn| {
connection::Connection::poll_recv(conn, buf)
}),
};
match result {
Poll::Ready(result) => {
Expand Down Expand Up @@ -294,25 +271,6 @@ pub fn tls_pair(config: crate::config::Config) -> Pair<Harness, Harness> {
Pair::new(server, client)
}

pub fn _establish_connection(config: crate::config::Config) {
// create and configure a server connection
let mut server = crate::connection::Connection::new_server();
server
.set_config(config.clone())
.expect("Failed to bind config to server connection");
let server = Harness::new(server);

// create a client connection
let mut client = crate::connection::Connection::new_client();
client
.set_config(config)
.expect("Unable to set client config");
let client = Harness::new(client);

let pair = Pair::new(server, client);
poll_tls_pair(pair);
}

pub fn poll_tls_pair(mut pair: Pair<Harness, Harness>) -> Pair<Harness, Harness> {
loop {
match pair.poll() {
Expand Down
4 changes: 0 additions & 4 deletions bindings/rust/s2n-tls/src/testing/s2n_tls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ impl Harness {
pub fn connection(&self) -> &Connection {
&self.connection
}

pub fn _connection_mut(&mut self) -> &mut Connection {
&mut self.connection
}
}

impl super::Connection for Harness {
Expand Down

0 comments on commit 0eebe6c

Please sign in to comment.