Skip to content

Commit

Permalink
Merge branch 'feature/cleanup' into feature/proxy_get_buffer_bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
yskopets committed Aug 19, 2020
2 parents 979b051 + 8b3ef76 commit f4f7a18
Show file tree
Hide file tree
Showing 4 changed files with 624 additions and 99 deletions.
16 changes: 8 additions & 8 deletions src/dispatcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -284,10 +284,10 @@ impl Dispatcher {
}
}

fn on_downstream_close(&self, context_id: u32, peer_type: PeerType) {
fn on_downstream_close(&self, context_id: u32, close_type: CloseType) {
if let Some(stream) = self.streams.borrow_mut().get_mut(&context_id) {
self.active_id.set(context_id);
stream.on_downstream_close(peer_type)
stream.on_downstream_close(close_type)
} else {
panic!("invalid context_id")
}
Expand All @@ -302,10 +302,10 @@ impl Dispatcher {
}
}

fn on_upstream_close(&self, context_id: u32, peer_type: PeerType) {
fn on_upstream_close(&self, context_id: u32, close_type: CloseType) {
if let Some(stream) = self.streams.borrow_mut().get_mut(&context_id) {
self.active_id.set(context_id);
stream.on_upstream_close(peer_type)
stream.on_upstream_close(close_type)
} else {
panic!("invalid context_id")
}
Expand Down Expand Up @@ -458,8 +458,8 @@ pub extern "C" fn proxy_on_downstream_data(
}

#[no_mangle]
pub extern "C" fn proxy_on_downstream_connection_close(context_id: u32, peer_type: PeerType) {
DISPATCHER.with(|dispatcher| dispatcher.on_downstream_close(context_id, peer_type))
pub extern "C" fn proxy_on_downstream_connection_close(context_id: u32, close_type: CloseType) {
DISPATCHER.with(|dispatcher| dispatcher.on_downstream_close(context_id, close_type))
}

#[no_mangle]
Expand All @@ -472,8 +472,8 @@ pub extern "C" fn proxy_on_upstream_data(
}

#[no_mangle]
pub extern "C" fn proxy_on_upstream_connection_close(context_id: u32, peer_type: PeerType) {
DISPATCHER.with(|dispatcher| dispatcher.on_upstream_close(context_id, peer_type))
pub extern "C" fn proxy_on_upstream_connection_close(context_id: u32, close_type: CloseType) {
DISPATCHER.with(|dispatcher| dispatcher.on_upstream_close(context_id, close_type))
}

#[no_mangle]
Expand Down
Loading

0 comments on commit f4f7a18

Please sign in to comment.