From 95af2a0acad2937b7bc8bce68b44712cf4209209 Mon Sep 17 00:00:00 2001 From: Nick Hahn Date: Tue, 28 Dec 2021 02:26:09 +0100 Subject: [PATCH] Fix line endings to only be `\n` On my machine the program would not even parse the SIZE from the server correctly without this change. --- src/pix/client.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pix/client.rs b/src/pix/client.rs index fdb0bfc..aeb34ac 100644 --- a/src/pix/client.rs +++ b/src/pix/client.rs @@ -80,7 +80,7 @@ impl Client { fn write_command(&mut self, cmd: &str) -> Result<(), Error> { // Write the pixels and a new line self.stream.write_all(cmd.as_bytes())?; - self.stream.write_all(b"\r\n")?; + self.stream.write_all(b"\n")?; // Flush, make sure to clear the send buffer // TODO: only flush each 100 pixels? @@ -114,7 +114,7 @@ impl Client { impl Drop for Client { /// Nicely drop the connection when the client is disconnected. fn drop(&mut self) { - let _ = self.write_command("\r\nQUIT".into()); + let _ = self.write_command("\nQUIT".into()); } }