mirror of
https://github.com/ntex-rs/ntex.git
synced 2025-04-03 21:07:39 +03:00
get read buf from inner filter for ssl filters
This commit is contained in:
parent
ab3c2efa66
commit
211eb00715
5 changed files with 10 additions and 8 deletions
|
@ -144,7 +144,7 @@ impl IoState {
|
|||
}
|
||||
|
||||
#[inline]
|
||||
pub(super) fn shutdown_filters(&self) -> Result<(), io::Error> {
|
||||
pub(super) fn shutdown_filters(&self) -> io::Result<()> {
|
||||
let mut flags = self.flags.get();
|
||||
if !flags.intersects(Flags::IO_ERR | Flags::IO_SHUTDOWN) {
|
||||
let result = match self.filter.get().poll_shutdown() {
|
||||
|
|
|
@ -647,9 +647,7 @@ mod unixstream {
|
|||
continue;
|
||||
}
|
||||
Poll::Ready(Err(e)) => {
|
||||
log::trace!(
|
||||
"write task is closed with err during shutdown"
|
||||
);
|
||||
log::trace!("write task is closed with err during shutdown");
|
||||
this.state.close(Some(e));
|
||||
return Poll::Ready(());
|
||||
}
|
||||
|
|
|
@ -264,10 +264,11 @@ impl<F: Filter> FilterFactory<F> for SslAcceptor {
|
|||
let ssl = ctx_result.map_err(map_to_ioerr)?;
|
||||
let pool = st.memory_pool();
|
||||
let st = st.map_filter(|inner: F| {
|
||||
let read_buf = inner.get_read_buf();
|
||||
let inner = IoInner {
|
||||
pool,
|
||||
inner,
|
||||
read_buf: None,
|
||||
read_buf,
|
||||
write_buf: None,
|
||||
};
|
||||
let ssl_stream = ssl::SslStream::new(ssl, inner)?;
|
||||
|
@ -315,10 +316,11 @@ impl<F: Filter> FilterFactory<F> for SslConnector {
|
|||
let ssl = self.ssl;
|
||||
let pool = st.memory_pool();
|
||||
let st = st.map_filter(|inner: F| {
|
||||
let read_buf = inner.get_read_buf();
|
||||
let inner = IoInner {
|
||||
pool,
|
||||
inner,
|
||||
read_buf: None,
|
||||
read_buf,
|
||||
write_buf: None,
|
||||
};
|
||||
let ssl_stream = ssl::SslStream::new(ssl, inner)?;
|
||||
|
|
|
@ -223,10 +223,11 @@ impl<F: Filter> TlsClientFilter<F> {
|
|||
Err(error) => return Err(io::Error::new(io::ErrorKind::Other, error)),
|
||||
};
|
||||
let io = io.map_filter(|inner: F| {
|
||||
let read_buf = inner.get_read_buf();
|
||||
let inner = IoInner {
|
||||
pool,
|
||||
inner,
|
||||
read_buf: None,
|
||||
read_buf,
|
||||
write_buf: None,
|
||||
};
|
||||
|
||||
|
|
|
@ -224,10 +224,11 @@ impl<F: Filter> TlsServerFilter<F> {
|
|||
Err(error) => return Err(io::Error::new(io::ErrorKind::Other, error)),
|
||||
};
|
||||
let io = io.map_filter(|inner: F| {
|
||||
let read_buf = inner.get_read_buf();
|
||||
let inner = IoInner {
|
||||
pool,
|
||||
inner,
|
||||
read_buf: None,
|
||||
read_buf,
|
||||
write_buf: None,
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue