pub mod h2;
pub mod kawa_h1;
pub mod pipe;
pub mod proxy_protocol;
pub mod rustls;
use std::{cell::RefCell, rc::Rc};
use mio::Token;
use sozu_command::ready::Ready;
pub use crate::protocol::{
http::Http, kawa_h1 as http, pipe::Pipe, proxy_protocol::send::SendProxyProtocol,
rustls::TlsHandshake,
};
use crate::{
L7Proxy, ProxySession, SessionIsToBeClosed, SessionMetrics, SessionResult, StateResult,
};
pub trait SessionState {
fn ready(
&mut self,
session: Rc<RefCell<dyn ProxySession>>,
proxy: Rc<RefCell<dyn L7Proxy>>,
metrics: &mut SessionMetrics,
) -> SessionResult;
fn update_readiness(&mut self, token: Token, events: Ready);
fn close(&mut self, _proxy: Rc<RefCell<dyn L7Proxy>>, _metrics: &mut SessionMetrics) {}
fn timeout(&mut self, token: Token, metrics: &mut SessionMetrics) -> StateResult;
fn cancel_timeouts(&mut self);
fn print_state(&self, context: &str);
fn shutting_down(&mut self) -> SessionIsToBeClosed {
true
}
}