Blocking callbacks can now access the handler structure as mutable. v0.4.3.

This commit is contained in:
PinkP4nther 2021-10-07 15:33:51 -07:00
commit 5b132baada
4 changed files with 5 additions and 4 deletions

View file

@ -1,6 +1,6 @@
[package]
name = "sslrelay"
version = "0.4.2"
version = "0.4.3"
authors = ["PinkP4nther <pinkp4nther@protonmail.com> @Pink_P4nther"]
edition = "2018"
description = "A TCP relay library for relaying/modifying/spoofing TCP traffic by implementing callback code."

View file

@ -22,4 +22,6 @@ Then use this library to continuously rewrite or display decrypted network traff
10/06/2021 | v0.4.2 | Added documentation.
10/07/2021 | v0.4.3 | Blocking callbacks now pass self as a mutable reference. This can allow the developer to create structures that can be accessed every stream write ONLY in the BLOCKING callback. The self object is refreshed per TCP connection. Separate TCP connections can not touch eachothers data.
More updates/ideas to come.. I think..

View file

@ -191,9 +191,9 @@ pub enum CallbackRet {
/// Callback functions a user may or may not implement.
pub trait HandlerCallbacks {
fn ds_b_callback(&self, _in_data: Vec<u8>) -> CallbackRet {CallbackRet::Relay(_in_data)}
fn ds_b_callback(&mut self, _in_data: Vec<u8>) -> CallbackRet {CallbackRet::Relay(_in_data)}
fn ds_nb_callback(&self, _in_data: Vec<u8>){}
fn us_b_callback(&self, _in_data: Vec<u8>) -> CallbackRet {CallbackRet::Relay(_in_data)}
fn us_b_callback(&mut self, _in_data: Vec<u8>) -> CallbackRet {CallbackRet::Relay(_in_data)}
fn us_nb_callback(&self, _in_data: Vec<u8>){}
}

View file

@ -128,7 +128,6 @@ impl<H: HandlerCallbacks + std::marker::Sync + std::marker::Send + Clone + 'stat
return;
}
}
},
// UpStream Write Request
FullDuplexTcpState::UpStreamWrite(data) => {