From 1ec88deea93047a9d1a366e032b2a54aa3cd362b Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Tue, 2 Nov 2021 08:11:40 +0200 Subject: Bugfix: Dealing correctly with files without newline characters, also add more tests --- internal/clients/handlers/basehandler.go | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'internal/clients') diff --git a/internal/clients/handlers/basehandler.go b/internal/clients/handlers/basehandler.go index b520c25..3ffea82 100644 --- a/internal/clients/handlers/basehandler.go +++ b/internal/clients/handlers/basehandler.go @@ -60,14 +60,7 @@ func (h *baseHandler) SendMessage(command string) error { func (h *baseHandler) Write(p []byte) (n int, err error) { for _, b := range p { switch b { - /* - // NEXT: Next DTail version make it so that '\n' gets ignored. For now - // leave it for compatibility with older DTail server + ability to display - // the protocol mismatch warn message. - case '\n' { - continue - */ - case '\n', protocol.MessageDelimiter: + case protocol.MessageDelimiter: message := h.receiveBuf.String() h.handleMessage(message) h.receiveBuf.Reset() @@ -75,7 +68,6 @@ func (h *baseHandler) Write(p []byte) (n int, err error) { h.receiveBuf.WriteByte(b) } } - return len(p), nil } -- cgit v1.2.3