mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-01 18:25:30 +00:00
http glommio: stop looping if peer closed connection
This commit is contained in:
parent
6a1c12a38b
commit
90d560c307
1 changed files with 5 additions and 0 deletions
|
|
@ -244,6 +244,11 @@ impl Connection {
|
|||
::log::debug!("read");
|
||||
|
||||
let bytes_read = self.stream.read(&mut buf).await?;
|
||||
|
||||
if bytes_read == 0 {
|
||||
return Err(anyhow::anyhow!("peer closed connection"));
|
||||
}
|
||||
|
||||
let request_buffer_end = self.request_buffer_position + bytes_read;
|
||||
|
||||
if request_buffer_end > self.request_buffer.len() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue