try to fix read_until and writed more debug logs
This commit is contained in:
parent
d618f10156
commit
205e1ed373
@ -482,7 +482,11 @@ fn read_until(stream: &mut impl BufRead, delimiter: &[u8]) -> Option<Vec<u8>> {
|
|||||||
|
|
||||||
loop {
|
loop {
|
||||||
let mut buf = Vec::new();
|
let mut buf = Vec::new();
|
||||||
stream.read_until(last_byte, &mut buf).ok()?;
|
let buf_len = stream.read_until(last_byte, &mut buf).ok()?;
|
||||||
|
debug!("read buf len until {} {:?}", buf_len, String::from_utf8_lossy(&buf));
|
||||||
|
if buf_len == 0 {
|
||||||
|
return None
|
||||||
|
}
|
||||||
data.append(&mut buf);
|
data.append(&mut buf);
|
||||||
if data.ends_with(delimiter) {
|
if data.ends_with(delimiter) {
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user