From a534fdd1257f5b5625fe6afdea356bdaf6ae76f0 Mon Sep 17 00:00:00 2001 From: Neil Jensen Date: Sat, 19 Jan 2019 10:41:48 -0700 Subject: [PATCH 1/2] Add io handling for ECONNRESET when data has already been received --- src/server/mod.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/server/mod.rs b/src/server/mod.rs index b84986047..641298542 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -303,6 +303,8 @@ pub trait IoStream: AsyncRead + AsyncWrite + 'static { } else { Ok(Async::NotReady) } + } else if e.kind() == io::ErrorKind::ConnectionReset && read_some { + Ok(Async::Ready((read_some, true))) } else { Err(e) }; From f5bec968c754d7777fa69a1258c49f6f3ca07cbd Mon Sep 17 00:00:00 2001 From: Tomas Izquierdo Garcia-Faria Date: Fri, 25 Jan 2019 02:35:11 +0100 Subject: [PATCH 2/2] Bump v_htmlescape version to 0.4 --- Cargo.toml | 2 +- src/fs.rs | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f927e24e8..bd3cb306c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -64,7 +64,7 @@ cell = ["actix-net/cell"] actix = "0.7.9" actix-net = "0.2.6" -v_htmlescape = "0.3.2" +v_htmlescape = "0.4" base64 = "0.10" bitflags = "1.0" failure = "^0.1.2" diff --git a/src/fs.rs b/src/fs.rs index 47bd81a78..b7370c64c 100644 --- a/src/fs.rs +++ b/src/fs.rs @@ -11,7 +11,7 @@ use std::{cmp, io}; #[cfg(unix)] use std::os::unix::fs::MetadataExt; -use v_htmlescape::HTMLEscape; +use v_htmlescape::escape as escape_html_entity; use bytes::Bytes; use futures::{Async, Future, Poll, Stream}; use futures_cpupool::{CpuFuture, CpuPool}; @@ -569,11 +569,6 @@ macro_rules! encode_file_url { }; } -#[inline] -fn escape_html_entity(s: &str) -> HTMLEscape { - HTMLEscape::from(s) -} - // " -- " & -- & ' -- ' < -- < > -- > / -- / macro_rules! encode_file_name { ($entry:ident) => {