Skip to content
This repository has been archived by the owner on Apr 10, 2024. It is now read-only.

Commit

Permalink
Fixes windows issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
mkrueger committed Feb 9, 2024
1 parent 1c5f1f2 commit cb6ef12
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/com/telnet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,8 @@ impl Com for ComTelnetImpl {
}

fn read_data(&mut self) -> TermComResult<Option<Vec<u8>>> {
let mut buf = [0; 1024 * 256];
let mut buf: [u8; 262144] = [0; 1024 * 256];
self.tcp_stream.set_nonblocking(true)?;
match self.tcp_stream.read(&mut buf) {
Ok(size) => {
if size == 0 {
Expand Down
2 changes: 1 addition & 1 deletion src/ui/buffer_update_thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ impl BufferUpdateThread {
fn update_buffer(&mut self, ctx: &egui::Context, buffer_parser: &mut dyn BufferParser, data: &[u8]) -> (u64, usize) {
let has_data = !data.is_empty();
if !data.is_empty() {
// println!("data : {} {}", self.last_update.elapsed().as_millis(), data.len());
println!("data : {} {}", data.len(), self.enabled);
}
if !self.enabled {
return (10, 0);
Expand Down
6 changes: 3 additions & 3 deletions src/ui/com_thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ impl ConnectionThreadData {
Ok(Some(data)) => {
if self.baud_rate == 0 {
if let Err(err) = self.tx.send(SendData::Data(data)) {
log::error!("connection_thread::read_data: {err}");
log::error!("connection_thread::read_data1: {err}");
self.thread_is_running &= self.tx.send(SendData::Disconnect).is_ok();
}
} else {
Expand All @@ -52,14 +52,14 @@ impl ConnectionThreadData {
Ok(None) => return false,

Err(err) => {
log::error!("connection_thread::read_data: {err}");
log::error!("connection_thread::read_data2: {err}");
self.disconnect();
return false;
}
}
} else if self.baud_rate == 0 {
if let Err(err) = self.tx.send(SendData::Data(self.data_buffer.drain(..).collect())) {
log::error!("connection_thread::read_data: {err}");
log::error!("connection_thread::read_data3: {err}");
self.thread_is_running &= self.tx.send(SendData::Disconnect).is_ok();
self.disconnect();
}
Expand Down

0 comments on commit cb6ef12

Please sign in to comment.