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