Pull request 176: Fix busy loop in http1_codec

Squashed commit of the following:

commit 467d684adb
Author: Zhavoronkov Aleksei <a.zhavoronkov@adguard.com>
Date:   Thu Mar 5 10:55:16 2026 +0300

    Fix busy loop in http1_codec
This commit is contained in:
Aleksei Zhavoronkov
2026-03-05 14:58:32 +00:00
parent a74f643424
commit 364ee5700b
2 changed files with 7 additions and 0 deletions

View File

@@ -1,5 +1,7 @@
# CHANGELOG
- [Fix] HTTP/1.1 codec busy loop when receiving partial request headers.
## 1.0.13
- [Fix] Change deep-link format from `tt://` to `tt://?`. For backward compatibility, `tt://` is still supported.

View File

@@ -188,6 +188,11 @@ where
let _ = self.upload_tx.reserve().await;
}
self.transport_stream.read_buf(&mut buffer).await?;
} else if matches!(self.state, State::WaitingRequest(_)) {
let bytes_read = self.transport_stream.read_buf(&mut buffer).await?;
if bytes_read == 0 {
buffer.clear();
}
}
Ok(buffer)
};