diff options
author | HimbeerserverDE <himbeerserverde@gmail.com> | 2023-03-09 19:27:38 +0100 |
---|---|---|
committer | HimbeerserverDE <himbeerserverde@gmail.com> | 2023-03-09 19:27:38 +0100 |
commit | caf51d4af18022e3fc4cdf82604877ae195ea14d (patch) | |
tree | 3f30d2a8643ee1fccf4c8eb1cb06113595a55bac | |
parent | b94de0325d7b6bd8df7c3b12ca92a18e95efe08e (diff) |
initialize PPP session with a RX buffer
-rw-r--r-- | src/client.rs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/client.rs b/src/client.rs index b26fb35..b072a3d 100644 --- a/src/client.rs +++ b/src/client.rs @@ -42,7 +42,7 @@ impl Client<'static> { password: password.as_bytes(), }; - Ok(Self { + let clt = Self { inner: Arc::new(Mutex::new(ClientRef { socket: Socket::on_interface(interface)?, session: PPPoS::new(config), @@ -50,7 +50,11 @@ impl Client<'static> { host_uniq, state: State::default(), })), - }) + }; + + clt.inner.lock().unwrap().session.put_rx_buf([0; 1024]); + + Ok(clt) } pub fn run(self) -> Result<()> { @@ -232,7 +236,7 @@ impl Client<'static> { struct ClientRef<'a> { socket: Socket, - session: PPPoS<'a, &'a mut [u8]>, + session: PPPoS<'a, [u8; 1024]>, started: bool, host_uniq: [u8; 16], state: State, |