commit 798506a03c75032757afe5ebb73e0db8d23ec595
parent 7588b23fcb2208b76da4b19a65a5438a2851e113
Author: Matt Brubeck <mbrubeck@limpet.net>
Date: Fri, 22 May 2020 19:08:00 -0700
Fix error message when request is too long
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main.rs b/src/main.rs
@@ -91,7 +91,7 @@ async fn parse_request<R: Read + Unpin>(mut stream: R) -> Result<Url> {
let mut len = 0;
// Read until CRLF, end-of-stream, or there's no buffer space left.
- while !buf.is_empty() {
+ loop {
let bytes_read = stream.read(buf).await?;
len += bytes_read;
if request[..len].ends_with(b"\r\n") {