Tolerate \r and \n inside retured data-lines
This commit is contained in:
parent
b15c236da2
commit
be1b86905c
1 changed files with 9 additions and 1 deletions
|
@ -2,7 +2,15 @@ use crate::FilterEntry;
|
||||||
use std::io::{self, Write};
|
use std::io::{self, Write};
|
||||||
|
|
||||||
pub fn return_data_line(entry: &FilterEntry, data_line: &[u8]) {
|
pub fn return_data_line(entry: &FilterEntry, data_line: &[u8]) {
|
||||||
|
let mut data_line = data_line.to_vec();
|
||||||
|
data_line.retain(|&c| c != 0x0d && c != 0x0a);
|
||||||
print!("filter-dataline|{}|{}|", entry.session_id, entry.token);
|
print!("filter-dataline|{}|{}|", entry.session_id, entry.token);
|
||||||
io::stdout().write_all(data_line).unwrap();
|
io::stdout().write_all(&data_line).unwrap();
|
||||||
println!();
|
println!();
|
||||||
|
log::trace!(
|
||||||
|
"Sent filter-dataline (session:id: {}, token: {}){}",
|
||||||
|
entry.session_id,
|
||||||
|
entry.token,
|
||||||
|
crate::error::get_pretty_hex(&data_line)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue