|
|
@ -143,12 +143,14 @@ impl VentedServer {
|
|
|
|
let event_handler = Arc::clone(&self.event_handler);
|
|
|
|
let event_handler = Arc::clone(&self.event_handler);
|
|
|
|
let connections = Arc::clone(&self.connections);
|
|
|
|
let connections = Arc::clone(&self.connections);
|
|
|
|
let pool = Arc::clone(&self.sender_pool);
|
|
|
|
let pool = Arc::clone(&self.sender_pool);
|
|
|
|
|
|
|
|
let known_nodes = Arc::clone(&self.known_nodes);
|
|
|
|
|
|
|
|
|
|
|
|
move |event| {
|
|
|
|
move |event| {
|
|
|
|
let payload = event.get_payload::<RedirectPayload>().ok()?;
|
|
|
|
let payload = event.get_payload::<RedirectPayload>().ok()?;
|
|
|
|
let event = Event::from_bytes(&mut &payload.content[..]).ok()?;
|
|
|
|
let event = Event::from_bytes(&mut &payload.content[..]).ok()?;
|
|
|
|
let proxy_stream = connections.lock().get(&payload.proxy)?.clone();
|
|
|
|
let proxy_stream = connections.lock().get(&payload.proxy)?.clone();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if known_nodes.lock().contains_key(&payload.source) {
|
|
|
|
pool.lock().execute({
|
|
|
|
pool.lock().execute({
|
|
|
|
let event_handler = Arc::clone(&event_handler);
|
|
|
|
let event_handler = Arc::clone(&event_handler);
|
|
|
|
move || {
|
|
|
|
move || {
|
|
|
@ -171,6 +173,7 @@ impl VentedServer {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
None
|
|
|
|
None
|
|
|
|
}
|
|
|
|
}
|
|
|
|