From 7f760b91dc8021ff8416eef67aa526fe653d68f4 Mon Sep 17 00:00:00 2001 From: YiFang Xiao Date: Sun, 17 Nov 2024 08:47:39 +0800 Subject: [PATCH] fix: [dictserver] some word does not got displayed --- src/dict/dictserver.cc | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/dict/dictserver.cc b/src/dict/dictserver.cc index 720cd323..415284cf 100644 --- a/src/dict/dictserver.cc +++ b/src/dict/dictserver.cc @@ -844,16 +844,11 @@ void DictServerArticleRequest::readData( QByteArray reply ) articleData += string( "
" ) + dbName.toUtf8().data() + "[" + dbID.toUtf8().data() + "]" + "
"; - // Retreive MIME headers if any - - static QRegularExpression contentTypeExpr( "Content-Type\\s*:\\s*text/html", - QRegularExpression::CaseInsensitiveOption ); - reply = dictImpl->socket.readAll(); articleText += reply; qDebug() << "reply data:" << reply << QDateTime::currentDateTime(); - if ( articleText.contains( ".\r\n" ) ) { + if ( articleText.contains( "\r\n.\r\n" ) ) { //discard all left message. emit finishedArticle( articleText ); return; @@ -864,7 +859,7 @@ void DictServerArticleRequest::readData( QByteArray reply ) qDebug() << "reply data:" << reply << QDateTime::currentDateTime(); articleText += reply; - if ( reply.contains( ".\r\n" ) ) { + if ( reply.contains( "\r\n.\r\n" ) ) { //discard all left message. maybe delete all the remaining data after `.\r\n` emit finishedArticle( articleText ); return;