From 7a6923e56579977da0832964bede92ec86045f2a Mon Sep 17 00:00:00 2001 From: Patrick Sharp Date: Tue, 10 Nov 2015 15:31:33 -0600 Subject: [PATCH 1/2] handle newline as the first character --- lib/connection/netio.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/connection/netio.rb b/lib/connection/netio.rb index ba07216..659dc29 100644 --- a/lib/connection/netio.rb +++ b/lib/connection/netio.rb @@ -31,6 +31,8 @@ def _receive(read_socket, connread = false) end # return nil if line.nil? + #An extra \n at the beginning of the + line = '' if line = "\n" # p [ "wiredatain_01", line ] line = _normalize_line_end(line) if @protocol >= Stomp::SPL_12 # If the reading hangs for more than X seconds, abort the parsing process. From 88451a72c63cfac775177e2884c48e617373799a Mon Sep 17 00:00:00 2001 From: Patrick Sharp Date: Wed, 11 Nov 2015 11:27:54 -0600 Subject: [PATCH 2/2] fix comparison and expand comment --- lib/connection/netio.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/connection/netio.rb b/lib/connection/netio.rb index 659dc29..27cb772 100644 --- a/lib/connection/netio.rb +++ b/lib/connection/netio.rb @@ -31,8 +31,8 @@ def _receive(read_socket, connread = false) end # return nil if line.nil? - #An extra \n at the beginning of the - line = '' if line = "\n" + #An extra \n at the beginning of the frame, possibly not caught by is_ready? + line = '' if line == "\n" # p [ "wiredatain_01", line ] line = _normalize_line_end(line) if @protocol >= Stomp::SPL_12 # If the reading hangs for more than X seconds, abort the parsing process.