You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: client/src/h1/proto/dispatcher.rs
+16-1Lines changed: 16 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ use crate::{
10
10
body::BodyError,
11
11
bytes::{Bytes,BytesMut},
12
12
date::DateTimeHandle,
13
-
h1::Error,
13
+
h1::{error::UnexpectedStateError,Error},
14
14
http::{
15
15
header::{HeaderValue,EXPECT,HOST},
16
16
Method,Request,Response,StatusCode,
@@ -29,6 +29,21 @@ where
29
29
B:Stream<Item = Result<Bytes,E>> + Unpin,
30
30
BodyError:From<E>,
31
31
{
32
+
match stream.read(&mut[0;1]){
33
+
// if the stream is ready to read, it's not in correct state, which means there is either data to read (which means previous connection was not handled correctly) or the connection is closed).
0 commit comments