From 89263ec94135dfa03fe1e4501c780d982ee78385 Mon Sep 17 00:00:00 2001 From: "Felix (xq) Queißner" Date: Fri, 12 Jun 2020 11:48:28 +0200 Subject: Fixes #7: Wrong end-of-document detection. --- src/gopherclient.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/gopherclient.cpp') diff --git a/src/gopherclient.cpp b/src/gopherclient.cpp index 2c2cdf5..74359c6 100644 --- a/src/gopherclient.cpp +++ b/src/gopherclient.cpp @@ -69,8 +69,8 @@ void GopherClient::on_readRead() if(not is_processing_binary) { // Strip the "lone dot" from gopher data - if(int index = body.indexOf(".\r\n"); index >= 0) { - body.resize(index); + if(int index = body.indexOf("\r\n.\r\n"); index >= 0) { + body.resize(index + 2); socket.close(); } } -- cgit v1.2.3