diff --git a/src/header/mod.rs b/src/header/mod.rs index 3588b2d5..d2e7a3f1 100644 --- a/src/header/mod.rs +++ b/src/header/mod.rs @@ -432,7 +432,7 @@ pub struct HeaderFormatter(H); impl Show for HeaderFormatter { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - self.fmt_header(f) + self.0.fmt_header(f) } } diff --git a/src/http.rs b/src/http.rs index 1651c9ae..bc599e2e 100644 --- a/src/http.rs +++ b/src/http.rs @@ -82,6 +82,8 @@ impl Reader for HttpReader { debug!("Chunked read, remaining={}", rem); if rem == 0 { + *opt_remaining = Some(0); + // chunk of size 0 signals the end of the chunked stream // if the 0 digit was missing from the stream, it would // be an InvalidInput error instead.