From c1dc6ccf0c09c7c1932bb7d5d948be2740412a8e Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Tue, 3 Dec 2019 14:23:25 +0100 Subject: [PATCH] actix-multipart: Fix multipart boundary reading If we're not ready to read the first line after the multipart field (which should be a "\r\n" line) then return NotReady instead of Ready(None) so that we will get called again to read that line. Without this I was getting MultipartError::Boundary from read_boundary() because it got the "\r\n" line instead of the boundary. --- actix-multipart/CHANGES.md | 4 ++++ actix-multipart/src/server.rs | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/actix-multipart/CHANGES.md b/actix-multipart/CHANGES.md index ca61176c7..72725bdc0 100644 --- a/actix-multipart/CHANGES.md +++ b/actix-multipart/CHANGES.md @@ -1,5 +1,9 @@ # Changes +## [0.1.5] - 2019-xx-xx + +* Multipart handling now handles NotReady during read of boundary #1189 + ## [0.1.4] - 2019-09-12 * Multipart handling now parses requests which do not end in CRLF #1038 diff --git a/actix-multipart/src/server.rs b/actix-multipart/src/server.rs index a7c787f46..44f636bce 100644 --- a/actix-multipart/src/server.rs +++ b/actix-multipart/src/server.rs @@ -604,7 +604,7 @@ impl InnerField { } match payload.readline()? { - None => Async::Ready(None), + None => Async::NotReady, Some(line) => { if line.as_ref() != b"\r\n" { log::warn!("multipart field did not read all the data or it is malformed");