diff --git a/lib/runner/connection/buffer.rb b/lib/runner/connection/buffer.rb index cf8ca6fc..7a1b3af5 100644 --- a/lib/runner/connection/buffer.rb +++ b/lib/runner/connection/buffer.rb @@ -71,8 +71,8 @@ class Runner::Connection::Buffer @buffering = false @global_buffer = +'' # For our buffering, we identified line breaks with the `\n` and removed those temporarily. - # Thus, we now re-add the `\n` at the end of the string and remove the `\r` in the same time. - message = message.gsub(/\r$/, "\n") unless message.length == 1 + # Thus, we now re-add the `\n` at the end of the string and remove the `\r` at the same time. + message = message.gsub(/\r$/, "\n") @line_buffer.push message end @@ -83,10 +83,10 @@ class Runner::Connection::Buffer invalid_json = !valid_json?(message) # Second, if we have the beginning of a valid command but an invalid JSON return true if invalid_json && message.start_with?(/\s*{"cmd/) - # Third, global_buffer the message if it contains long messages (e.g., an image or turtle batch commands) + # Third, buffer the message if it contains long messages (e.g., an image or turtle batch commands) return true if invalid_json && (message.include?('